Skip to content

Commit

Permalink
1.0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
paissaheavyindustries committed Jul 8, 2024
1 parent 520eea8 commit 9b3e7ab
Show file tree
Hide file tree
Showing 6 changed files with 314 additions and 178 deletions.
2 changes: 1 addition & 1 deletion Telesto/Context.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Context
{

internal Doodle doo = null;
internal GameObject go = null;
internal IGameObject go = null;

}

Expand Down
34 changes: 19 additions & 15 deletions Telesto/Doodle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ internal Vector3 UntranslatedPosition(Plugin p)
);
break;
case CoordinateTypeEnum.Entity:
GameObject go;
IGameObject go;
if (id > 0)
{
go = p.GetEntityById(id);
}
else
{
go = p.GetEntityByName(name);
{
go = p.GetEntityByName(p.ExpandVariables(null, name));
}
if (go != null)
{
Expand Down Expand Up @@ -118,13 +118,14 @@ internal Vector3 UntranslatedPosition(Plugin p)
}
return new Vector3();
case CoordinateTypeEnum.Waymark:
Waymark wm = p.GetWaymarkByName(name);
Plugin.Waymark wm = p.GetWaymarkByName(name);
if (wm != null && wm.Active == true)
{
{
wm.Active = false;
return new Vector3(
ofsx + wm.X_Float,
ofsy + wm.Y_Float,
ofsz + wm.Z_Float
ofsx + wm.X,
ofsy + wm.Y,
ofsz + wm.Z
);
}
return new Vector3();
Expand Down Expand Up @@ -163,14 +164,14 @@ internal void RefreshVector(Plugin p)
);
break;
case CoordinateTypeEnum.Entity:
GameObject go;
IGameObject go;
if (id > 0)
{
go = p.GetEntityById(id);
}
else
{
go = p.GetEntityByName(name);
go = p.GetEntityByName(p.ExpandVariables(null, name));
}
if (go != null)
{
Expand Down Expand Up @@ -215,13 +216,13 @@ internal void RefreshVector(Plugin p)
}
break;
case CoordinateTypeEnum.Waymark:
Waymark wm = p.GetWaymarkByName(name);
Plugin.Waymark wm = p.GetWaymarkByName(name);
if (wm != null && wm.Active == true)
{
cp = p.TranslateToScreen(
ofsx + wm.X_Float,
ofsy + wm.Y_Float,
ofsz + wm.Z_Float
ofsx + wm.X,
ofsy + wm.Y,
ofsz + wm.Z
);
}
else
Expand Down Expand Up @@ -269,7 +270,7 @@ internal void Initialize(Dictionary<string, object> d)
}
}
if (id == 0)
{
{
name = (d.ContainsKey("name") == true) ? d["name"].ToString() : "";
}
}
Expand Down Expand Up @@ -298,6 +299,8 @@ internal enum ExpiryTypeEnum
internal string B { get; set; }
internal string A { get; set; }

internal string ExpiryNotifyEndpoint { get; set; } = null;

internal virtual string DefaultR { get; } = "0";
internal virtual string DefaultG { get; } = "0";
internal virtual string DefaultB { get; } = "0";
Expand All @@ -316,6 +319,7 @@ internal virtual void Initialize(Dictionary<string, object> d)
G = (d.ContainsKey("g") == true) ? d["g"].ToString() : DefaultG;
B = (d.ContainsKey("b") == true) ? d["b"].ToString() : DefaultB;
A = (d.ContainsKey("a") == true) ? d["a"].ToString() : DefaultA;
ExpiryNotifyEndpoint = (d.ContainsKey("notifyonexpiry") == true) ? d["notifyonexpiry"].ToString() : null;
if (d.ContainsKey("expireson") == true)
{
ExpiryTypeEnum nt = 0;
Expand Down
22 changes: 8 additions & 14 deletions Telesto/Doodles/Image.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Dalamud.Interface.Internal;
using Dalamud.Interface.Textures;
using Dalamud.Interface.Textures.TextureWraps;
using ImGuiNET;
using ImGuiScene;
using System;
Expand Down Expand Up @@ -33,21 +35,11 @@ internal enum AlignmentEnum
internal AlignmentEnum valign = AlignmentEnum.Near;
internal Coordinate position { get; set; }
internal uint IconId = 0;
internal IDalamudTextureWrap? Texture { get; set; } = null;
internal ISharedImmediateTexture Texture { get; set; } = null;

internal int calcWidth;
internal int calcHeight;

public override void Dispose()
{
base.Dispose();
if (Texture != null)
{
Texture.Dispose();
Texture = null;
}
}

internal override Coordinate GetCoordinateByName(string id)
{
switch (id.ToLower())
Expand Down Expand Up @@ -123,11 +115,12 @@ internal override bool Update()
Texture = p.GetTexture(IconId);
IconId = 0;
}
IDalamudTextureWrap tx = Texture.GetWrapOrEmpty();
Match m;
m = rex.Match(Width);
if (m.Success == true)
{
calcWidth = (int)Math.Ceiling((float)Texture.Width * (float)int.Parse(m.Groups["val"].Value) / 100.0f);
calcWidth = (int)Math.Ceiling((float)tx.Width * (float)int.Parse(m.Groups["val"].Value) / 100.0f);
}
else
{
Expand All @@ -136,7 +129,7 @@ internal override bool Update()
m = rex.Match(Height);
if (m.Success == true)
{
calcHeight = (int)Math.Ceiling((float)Texture.Height * (float)int.Parse(m.Groups["val"].Value) / 100.0f);
calcHeight = (int)Math.Ceiling((float)tx.Height * (float)int.Parse(m.Groups["val"].Value) / 100.0f);
}
else
{
Expand Down Expand Up @@ -172,7 +165,8 @@ internal override void Draw()
}
}
ImGui.SetCursorPos(pt);
ImGui.Image(Texture.ImGuiHandle, new Vector2(calcWidth, calcHeight), new Vector2(0.0f, 0.0f), new Vector2(1.0f, 1.0f), col);
IDalamudTextureWrap tx = Texture.GetWrapOrEmpty();
ImGui.Image(tx.ImGuiHandle, new Vector2(calcWidth, calcHeight), new Vector2(0.0f, 0.0f), new Vector2(1.0f, 1.0f), col);
}

}
Expand Down
42 changes: 0 additions & 42 deletions Telesto/Interop/Waymarks.cs

This file was deleted.

Loading

0 comments on commit 9b3e7ab

Please sign in to comment.