From d3ff8a6efcfc1174fd5627bb4bb1b020cba53e01 Mon Sep 17 00:00:00 2001 From: Paissa Heavy Industries <50399685+paissaheavyindustries@users.noreply.github.com> Date: Wed, 8 May 2024 09:42:08 +0300 Subject: [PATCH] v1.0.3.1 --- Lemegeton/Content/EwCritAloalo.cs | 48 ++-- Lemegeton/Content/EwRaidAbyssos.cs | 28 ++- Lemegeton/Content/EwRaidAnabaseios.cs | 32 ++- Lemegeton/Content/UltAlexander.cs | 40 ++- Lemegeton/Content/UltDragonsongReprise.cs | 294 +++++++++++++++++++++- Lemegeton/Content/UltOmegaProtocol.cs | 43 +++- Lemegeton/Content/UltUcob.cs | 36 ++- Lemegeton/Content/UltWeaponsRefrain.cs | 28 ++- Lemegeton/Content/VisualEnhancement.cs | 281 +++++++++++++++++++++ Lemegeton/Core/UserInterface.cs | 6 + Lemegeton/Language/Chinese.cs | 21 ++ Lemegeton/Language/Danish.cs | 21 ++ Lemegeton/Language/English.cs | 21 ++ Lemegeton/Language/French.cs | 21 ++ Lemegeton/Language/German.cs | 21 ++ Lemegeton/Language/Japanese.cs | 21 ++ Lemegeton/Language/Korean.cs | 21 ++ Lemegeton/Plugin.cs | 6 +- 18 files changed, 927 insertions(+), 62 deletions(-) diff --git a/Lemegeton/Content/EwCritAloalo.cs b/Lemegeton/Content/EwCritAloalo.cs index bcccc8d..b897b4f 100644 --- a/Lemegeton/Content/EwCritAloalo.cs +++ b/Lemegeton/Content/EwCritAloalo.cs @@ -11,6 +11,7 @@ using Dalamud.Interface.Animation; using static Lemegeton.Content.EwCritAloalo; using System.Drawing; +using static Lemegeton.Core.State; namespace Lemegeton.Content { @@ -63,6 +64,7 @@ internal class EwCritAloalo : Core.Content private const int AbilityPinwheelingDartboard2 = 36031; private bool ZoneOk = false; + private bool _subbed = false; private SpringCrystal _springCrystal; private LalaRotation _lalaRotation; @@ -1230,13 +1232,22 @@ protected override bool ExecutionImplementation() private void SubscribeToEvents() { - _state.OnHeadMarker += _state_OnHeadMarker; - _state.OnStatusChange += _state_OnStatusChange; - _state.OnCastBegin += _state_OnCastBegin; - _state.OnCombatantAdded += _state_OnCombatantAdded; - _state.OnCombatantRemoved += _state_OnCombatantRemoved; - _state.OnAction += _state_OnAction; - _state.OnTether += _state_OnTether; + lock (this) + { + if (_subbed == true) + { + return; + } + _subbed = true; + Log(LogLevelEnum.Debug, null, "Subscribing to events"); + _state.OnHeadMarker += _state_OnHeadMarker; + _state.OnStatusChange += _state_OnStatusChange; + _state.OnCastBegin += _state_OnCastBegin; + _state.OnCombatantAdded += _state_OnCombatantAdded; + _state.OnCombatantRemoved += _state_OnCombatantRemoved; + _state.OnAction += _state_OnAction; + _state.OnTether += _state_OnTether; + } } private void _state_OnAction(uint src, uint dest, ushort actionId) @@ -1396,13 +1407,22 @@ private void _state_OnTether(uint src, uint dest, uint tetherId) private void UnsubscribeFromEvents() { - _state.OnHeadMarker -= _state_OnHeadMarker; - _state.OnStatusChange -= _state_OnStatusChange; - _state.OnCastBegin -= _state_OnCastBegin; - _state.OnCombatantAdded -= _state_OnCombatantAdded; - _state.OnCombatantRemoved -= _state_OnCombatantRemoved; - _state.OnAction -= _state_OnAction; - _state.OnTether -= _state_OnTether; + lock (this) + { + if (_subbed == false) + { + return; + } + Log(LogLevelEnum.Debug, null, "Unsubscribing from events"); + _state.OnHeadMarker -= _state_OnHeadMarker; + _state.OnStatusChange -= _state_OnStatusChange; + _state.OnCastBegin -= _state_OnCastBegin; + _state.OnCombatantAdded -= _state_OnCombatantAdded; + _state.OnCombatantRemoved -= _state_OnCombatantRemoved; + _state.OnAction -= _state_OnAction; + _state.OnTether -= _state_OnTether; + _subbed = false; + } } private void OnCombatChange(bool inCombat) diff --git a/Lemegeton/Content/EwRaidAbyssos.cs b/Lemegeton/Content/EwRaidAbyssos.cs index 5afc1c8..720f957 100644 --- a/Lemegeton/Content/EwRaidAbyssos.cs +++ b/Lemegeton/Content/EwRaidAbyssos.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Data; +using static Lemegeton.Core.State; namespace Lemegeton.Content { @@ -22,6 +23,7 @@ internal class EwRaidAbyssos : Core.Content private const int StatusPurgation4 = 0xd44; private bool ZoneOk = false; + private bool _subbed = false; private InviolateAM _inviolateAm; @@ -228,8 +230,17 @@ protected override bool ExecutionImplementation() private void SubscribeToEvents() { - _state.OnCastBegin += _state_OnCastBegin; - _state.OnStatusChange += _state_OnStatusChange; + lock (this) + { + if (_subbed == true) + { + return; + } + _subbed = true; + Log(LogLevelEnum.Debug, null, "Subscribing to events"); + _state.OnCastBegin += _state_OnCastBegin; + _state.OnStatusChange += _state_OnStatusChange; + } } private void _state_OnStatusChange(uint src, uint dest, uint statusId, bool gained, float duration, int stacks) @@ -242,8 +253,17 @@ private void _state_OnStatusChange(uint src, uint dest, uint statusId, bool gain private void UnsubscribeFromEvents() { - _state.OnStatusChange -= _state_OnStatusChange; - _state.OnCastBegin -= _state_OnCastBegin; + lock (this) + { + if (_subbed == false) + { + return; + } + Log(LogLevelEnum.Debug, null, "Unsubscribing from events"); + _state.OnStatusChange -= _state_OnStatusChange; + _state.OnCastBegin -= _state_OnCastBegin; + _subbed = false; + } } private void _state_OnCastBegin(uint src, uint dest, ushort actionId, float castTime, float rotation) diff --git a/Lemegeton/Content/EwRaidAnabaseios.cs b/Lemegeton/Content/EwRaidAnabaseios.cs index 40cf51c..71894e0 100644 --- a/Lemegeton/Content/EwRaidAnabaseios.cs +++ b/Lemegeton/Content/EwRaidAnabaseios.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using Lemegeton.Core; +using static Lemegeton.Core.State; namespace Lemegeton.Content { @@ -39,6 +40,7 @@ private ZoneEnum CurrentZone private bool _sawFirstHeadMarker = false; private uint _firstHeadMarker = 0; + private bool _subbed = false; private const int AbilityTwoMinds1 = 33156; private const int AbilityTwoMinds2 = 33157; @@ -529,9 +531,18 @@ protected override bool ExecutionImplementation() private void SubscribeToEvents() { - _state.OnHeadMarker += _state_OnHeadMarker; - _state.OnCastBegin += _state_OnCastBegin; - _state.OnStatusChange += _state_OnStatusChange; + lock (this) + { + if (_subbed == true) + { + return; + } + _subbed = true; + Log(LogLevelEnum.Debug, null, "Subscribing to events"); + _state.OnHeadMarker += _state_OnHeadMarker; + _state.OnCastBegin += _state_OnCastBegin; + _state.OnStatusChange += _state_OnStatusChange; + } } private void _state_OnStatusChange(uint src, uint dest, uint statusId, bool gained, float duration, int stacks) @@ -617,9 +628,18 @@ private void _state_OnHeadMarker(uint dest, uint markerId) private void UnsubscribeFromEvents() { - _state.OnStatusChange -= _state_OnStatusChange; - _state.OnCastBegin -= _state_OnCastBegin; - _state.OnHeadMarker -= _state_OnHeadMarker; + lock (this) + { + if (_subbed == false) + { + return; + } + Log(LogLevelEnum.Debug, null, "Unsubscribing from events"); + _state.OnStatusChange -= _state_OnStatusChange; + _state.OnCastBegin -= _state_OnCastBegin; + _state.OnHeadMarker -= _state_OnHeadMarker; + _subbed = false; + } } private void OnCombatChange(bool inCombat) diff --git a/Lemegeton/Content/UltAlexander.cs b/Lemegeton/Content/UltAlexander.cs index bee641b..3d1eba3 100644 --- a/Lemegeton/Content/UltAlexander.cs +++ b/Lemegeton/Content/UltAlexander.cs @@ -13,6 +13,7 @@ using System.Diagnostics; using System.Threading; using static Lemegeton.Content.UltAlexander; +using static Lemegeton.Core.State; namespace Lemegeton.Content { @@ -59,6 +60,7 @@ internal class UltAlexander : Core.Content private const int Headmarker8 = 86; private bool ZoneOk = false; + private bool _subbed = false; private bool _sawFirstHeadMarker = false; private uint _firstHeadMarker = 0; @@ -962,11 +964,20 @@ protected override bool ExecutionImplementation() private void SubscribeToEvents() { - _state.OnCastBegin += OnCastBegin; - _state.OnAction += OnAction; - _state.OnStatusChange += OnStatusChange; - _state.OnTether += OnTether; - _state.OnHeadMarker += OnHeadMarker; + lock (this) + { + if (_subbed == true) + { + return; + } + _subbed = true; + Log(LogLevelEnum.Debug, null, "Subscribing to events"); + _state.OnCastBegin += OnCastBegin; + _state.OnAction += OnAction; + _state.OnStatusChange += OnStatusChange; + _state.OnTether += OnTether; + _state.OnHeadMarker += OnHeadMarker; + } } private void OnHeadMarker(uint dest, uint markerId) @@ -1104,11 +1115,20 @@ private void OnTether(uint src, uint dest, uint tetherId) private void UnsubscribeFromEvents() { - _state.OnHeadMarker -= OnHeadMarker; - _state.OnTether -= OnTether; - _state.OnStatusChange -= OnStatusChange; - _state.OnAction -= OnAction; - _state.OnCastBegin -= OnCastBegin; + lock (this) + { + if (_subbed == false) + { + return; + } + Log(LogLevelEnum.Debug, null, "Unsubscribing from events"); + _state.OnHeadMarker -= OnHeadMarker; + _state.OnTether -= OnTether; + _state.OnStatusChange -= OnStatusChange; + _state.OnAction -= OnAction; + _state.OnCastBegin -= OnCastBegin; + _subbed = false; + } } private void OnCombatChange(bool inCombat) diff --git a/Lemegeton/Content/UltDragonsongReprise.cs b/Lemegeton/Content/UltDragonsongReprise.cs index 5267890..fe365d9 100644 --- a/Lemegeton/Content/UltDragonsongReprise.cs +++ b/Lemegeton/Content/UltDragonsongReprise.cs @@ -2,6 +2,17 @@ using Lemegeton.Core; using System.Collections.Generic; using System.Linq; +using Dalamud.Game.ClientState.Objects.Types; +using ImGuiNET; +using System.Collections; +using static Lemegeton.Content.UltDragonsongReprise; +using System.Numerics; +using static Lemegeton.Content.Overlays.DotTracker; +using Dalamud.Interface.Internal; +using GameObjectPtr = FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject; +using Dalamud.Interface.Utility; +using System.Data.SqlTypes; +using static Lemegeton.Core.State; namespace Lemegeton.Content { @@ -17,12 +28,17 @@ internal class UltDragonsongReprise : Core.Content private const int StatusPrey = 562; private const int StatusDoom = 2976; + private const int NameNidhogg = 3458; + private const int NameHraesvelgr = 4954; + private bool ZoneOk = false; + private bool _subbed = false; private MeteorAM _meteorAm; private ChainLightningAm _chainLightningAm; private DothAM _dothAm; private WrothAM _wrothAm; + private DoubleDragons _doubleDragons; #region MeteorAM @@ -458,6 +474,221 @@ from ix in pty.Members where _stacksGo.Contains(ix) == false && _spreadsGo.Conta #endregion + #region DoubleDragons + + public class DoubleDragons : Core.ContentItem + { + + public uint _idHraesvelgr = 0; + public uint _idNidhogg = 0; + + public override FeaturesEnum Features => FeaturesEnum.Drawing; + + [DebugOption] + [AttributeOrderNumber(3000)] + public System.Action Test { get; set; } + + public DoubleDragons(State state) : base(state) + { + Enabled = false; + Test = new System.Action(() => TestFunctionality()); + } + + public void TestFunctionality() + { + if (_idHraesvelgr > 0 || _idNidhogg > 0) + { + _idHraesvelgr = 0; + _idNidhogg = 0; + return; + } + _state.InvokeZoneChange(968); + GameObject me = _state.cs.LocalPlayer as GameObject; + _idNidhogg = me.ObjectId; + _idHraesvelgr = me.ObjectId; + foreach (GameObject go in _state.ot) + { + if (go.ObjectKind != Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Player && go.ObjectKind != Dalamud.Game.ClientState.Objects.Enums.ObjectKind.BattleNpc) + { + continue; + } + if (go.ObjectId == me.ObjectId) + { + continue; + } + bool isTargettable; + unsafe + { + GameObjectPtr* gop = (GameObjectPtr*)go.Address; + isTargettable = gop->GetIsTargetable(); + } + bool isHidden = (isTargettable == false); + if (isHidden == true) + { + continue; + } + Random r = new Random(); + _idNidhogg = go.ObjectId; + Log(State.LogLevelEnum.Debug, null, "Testing from {0} to {1}", me, go); + return; + } + Log(State.LogLevelEnum.Debug, null, "Testing on self"); + } + + public override void Reset() + { + Log(State.LogLevelEnum.Debug, null, "Reset"); + _idHraesvelgr = 0; + _idNidhogg = 0; + } + + protected override bool ExecutionImplementation() + { + ImDrawListPtr draw; + if (_idHraesvelgr == 0 || _idNidhogg == 0) + { + return false; + } + if (_state.StartDrawing(out draw) == false) + { + return false; + } + GameObject goH = _state.GetActorById(_idHraesvelgr); + if (goH == null) + { + return false; + } + GameObject goN = _state.GetActorById(_idNidhogg); + if (goN == null) + { + return false; + } + Character chH = (Character)goH; + Character chN = (Character)goN; + IDalamudTextureWrap bw, tw; + float x = 200.0f; + float y = 300.0f; + float w = 250.0f; + float hhp = (float)chH.CurrentHp / (float)chH.MaxHp * 100.0f; + float nhp = (float)chN.CurrentHp / (float)chN.MaxHp * 100.0f; + float dhp = Math.Abs(hhp - nhp); + Vector4 hcol, ncol, wcol; + hcol = new Vector4(1.0f, 1.0f, 1.0f, 1.0f); + ncol = hcol; + wcol = hcol; + float time = (float)(DateTime.Now - DateTime.Today).TotalMilliseconds / 200.0f; + if (dhp > 3.0f) + { + float ang = (float)Math.Abs(Math.Cos(time * 2.0f)); + if (hhp > nhp) + { + hcol = new Vector4(1.0f, 0.0f, 0.0f, ang); + } + else + { + ncol = new Vector4(1.0f, 0.0f, 0.0f, ang); + } + wcol = new Vector4(1.0f, ang, 0.0f, 1.0f); + } + else if (dhp > 2.0f) + { + float ang = (float)Math.Abs(Math.Cos(time)); + if (hhp > nhp) + { + hcol = new Vector4(1.0f, 0.5f, 0.0f, ang); + } + else + { + ncol = new Vector4(1.0f, 0.5f, 0.0f, ang); + } + wcol = new Vector4(1.0f, 0.5f + (ang * 0.5f), 0.0f, 1.0f); + } + else if (dhp > 1.0f) + { + if (hhp > nhp) + { + hcol = new Vector4(1.0f, 1.0f, 0.0f, 1.0f); + } + else + { + ncol = new Vector4(1.0f, 1.0f, 0.0f, 1.0f); + } + wcol = new Vector4(1.0f, 1.0f, 0.0f, 1.0f); + } + tw = _state.plug._ui.GetMiscIcon(UserInterface.MiscIconEnum.DarkDragon); + bw = _state.plug._ui.GetMiscIcon(UserInterface.MiscIconEnum.LightCircle); + draw.AddImage( + bw.ImGuiHandle, + new Vector2(x, y), + new Vector2(x + tw.Width, y + tw.Height), + new Vector2(1.0f, 0.0f), + new Vector2(0.0f, 1.0f), + ImGui.GetColorU32(hcol) + ); + draw.AddImage( + bw.ImGuiHandle, + new Vector2(x + w - tw.Width, y), + new Vector2(x + w, y + tw.Height), + new Vector2(1.0f, 0.0f), + new Vector2(0.0f, 1.0f), + ImGui.GetColorU32(ncol) + ); + draw.AddImage( + tw.ImGuiHandle, + new Vector2(x, y), + new Vector2(x + tw.Width, y + tw.Height), + new Vector2(1.0f, 0.0f), + new Vector2(0.0f, 1.0f) + ); + tw = _state.plug._ui.GetMiscIcon(UserInterface.MiscIconEnum.LightDragon); + draw.AddImage( + tw.ImGuiHandle, + new Vector2(x + w - tw.Width, y), + new Vector2(x + w, y + tw.Height), + new Vector2(0.0f, 0.0f), + new Vector2(1.0f, 1.0f) + ); + float textSize = 24.0f, scale; + string temp; + Vector2 sz; + temp = String.Format("{0:0.0} %", hhp); + sz = ImGui.CalcTextSize(temp); + scale = textSize / sz.Y; + sz = new Vector2(sz.X * scale, sz.Y * scale); + draw.AddText(ImGui.GetFont(), textSize, new Vector2(x + (tw.Width / 2.0f) - (sz.X / 2.0f) + 1.0f, y + tw.Height + 1.0f), ImGui.GetColorU32(new Vector4(0.0f, 0.0f, 0.0f, 1.0f)), temp); + draw.AddText(ImGui.GetFont(), textSize, new Vector2(x + (tw.Width / 2.0f) - (sz.X / 2.0f), y + tw.Height), ImGui.GetColorU32(new Vector4(1.0f, 1.0f, 1.0f, 1.0f)), temp); + temp = String.Format("{0:0.0} %", nhp); + sz = ImGui.CalcTextSize(temp); + scale = textSize / sz.Y; + sz = new Vector2(sz.X * scale, sz.Y * scale); + draw.AddText(ImGui.GetFont(), textSize, new Vector2(x + w - (tw.Width / 2.0f) - (sz.X / 2.0f) + 1.0f, y + tw.Height + 1.0f), ImGui.GetColorU32(new Vector4(0.0f, 0.0f, 0.0f, 1.0f)), temp); + draw.AddText(ImGui.GetFont(), textSize, new Vector2(x + w - (tw.Width / 2.0f) - (sz.X / 2.0f), y + tw.Height), ImGui.GetColorU32(new Vector4(1.0f, 1.0f, 1.0f, 1.0f)), temp); + temp = chH.Name.ToString(); + sz = ImGui.CalcTextSize(temp); + scale = textSize / sz.Y; + sz = new Vector2(sz.X * scale, sz.Y * scale); + draw.AddText(ImGui.GetFont(), textSize, new Vector2(x + (tw.Width / 2.0f) - (sz.X / 2.0f) + 1.0f, y - sz.Y + 1.0f), ImGui.GetColorU32(new Vector4(0.0f, 0.0f, 0.0f, 1.0f)), temp); + draw.AddText(ImGui.GetFont(), textSize, new Vector2(x + (tw.Width / 2.0f) - (sz.X / 2.0f), y - sz.Y), ImGui.GetColorU32(new Vector4(1.0f, 1.0f, 1.0f, 1.0f)), temp); + temp = chN.Name.ToString(); + sz = ImGui.CalcTextSize(temp); + scale = textSize / sz.Y; + sz = new Vector2(sz.X * scale, sz.Y * scale); + draw.AddText(ImGui.GetFont(), textSize, new Vector2(x + w - (tw.Width / 2.0f) - (sz.X / 2.0f) + 1.0f, y - sz.Y + 1.0f), ImGui.GetColorU32(new Vector4(0.0f, 0.0f, 0.0f, 1.0f)), temp); + draw.AddText(ImGui.GetFont(), textSize, new Vector2(x + w - (tw.Width / 2.0f) - (sz.X / 2.0f), y - sz.Y), ImGui.GetColorU32(new Vector4(1.0f, 1.0f, 1.0f, 1.0f)), temp); + temp = String.Format("{0:0.0} %", dhp); + textSize = 40.0f; + sz = ImGui.CalcTextSize(temp); + scale = textSize / sz.Y; + sz = new Vector2(sz.X * scale, sz.Y * scale); + draw.AddText(ImGui.GetFont(), textSize, new Vector2(x + (w / 2.0f) - (sz.X / 2.0f) + 1.0f, y + (tw.Height / 2.0f) - (sz.Y / 2.0f) + 1.0f), ImGui.GetColorU32(new Vector4(0.0f, 0.0f, 0.0f, 1.0f)), temp); + draw.AddText(ImGui.GetFont(), textSize, new Vector2(x + (w / 2.0f) - (sz.X / 2.0f), y + (tw.Height / 2.0f) - (sz.Y / 2.0f)), ImGui.GetColorU32(wcol), temp); + return true; + } + + } + + #endregion + public UltDragonsongReprise(State st) : base(st) { st.OnZoneChange += OnZoneChange; @@ -474,7 +705,54 @@ protected override bool ExecutionImplementation() private void SubscribeToEvents() { - _state.OnStatusChange += OnStatusChange; + lock (this) + { + if (_subbed == true) + { + return; + } + _subbed = true; + Log(LogLevelEnum.Debug, null, "Subscribing to events"); + _state.OnStatusChange += OnStatusChange; + _state.OnCombatantAdded += OnCombatantAdded; + _state.OnCombatantRemoved += OnCombatantRemoved; + } + } + + private void OnCombatantRemoved(uint actorId, nint addr) + { + if (actorId == _doubleDragons._idNidhogg && actorId > 0) + { + Log(State.LogLevelEnum.Debug, null, "Nidhogg is gone"); + _doubleDragons._idNidhogg = 0; + } + if (actorId == _doubleDragons._idHraesvelgr && actorId > 0) + { + Log(State.LogLevelEnum.Debug, null, "Hraesvelgr is gone"); + _doubleDragons._idHraesvelgr = 0; + } + } + + private void OnCombatantAdded(Dalamud.Game.ClientState.Objects.Types.GameObject go) + { + if (go is Character) + { + Character ch = go as Character; + if (ch.MaxHp != 4535368) + { + return; + } + if (ch.NameId == NameNidhogg) + { + Log(State.LogLevelEnum.Debug, null, "Nidhogg found as {0:X8}", go.ObjectId); + _doubleDragons._idNidhogg = go.ObjectId; + } + else if (ch.NameId == NameHraesvelgr) + { + Log(State.LogLevelEnum.Debug, null, "Hraesvelgr found as {0:X8}", go.ObjectId); + _doubleDragons._idHraesvelgr = go.ObjectId; + } + } } private void OnStatusChange(uint src, uint dest, uint statusId, bool gained, float duration, int stacks) @@ -499,7 +777,18 @@ private void OnStatusChange(uint src, uint dest, uint statusId, bool gained, flo private void UnsubscribeFromEvents() { - _state.OnStatusChange -= OnStatusChange; + lock (this) + { + if (_subbed == false) + { + return; + } + Log(LogLevelEnum.Debug, null, "Unsubscribing from events"); + _state.OnStatusChange -= OnStatusChange; + _state.OnCombatantAdded -= OnCombatantAdded; + _state.OnCombatantRemoved -= OnCombatantRemoved; + _subbed = false; + } } private void OnCombatChange(bool inCombat) @@ -525,6 +814,7 @@ private void OnZoneChange(ushort newZone) _chainLightningAm = (ChainLightningAm)Items["ChainLightningAm"]; _dothAm = (DothAM)Items["DothAM"]; _wrothAm = (WrothAM)Items["WrothAM"]; + _doubleDragons = (DoubleDragons)Items["DoubleDragons"]; _state.OnCombatChange += OnCombatChange; LogItems(); } diff --git a/Lemegeton/Content/UltOmegaProtocol.cs b/Lemegeton/Content/UltOmegaProtocol.cs index cfb541a..4a0ac51 100644 --- a/Lemegeton/Content/UltOmegaProtocol.cs +++ b/Lemegeton/Content/UltOmegaProtocol.cs @@ -10,6 +10,7 @@ using GameObjectStruct = FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject; using GameObjectPtr = FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject; using FFXIVClientStructs.FFXIV.Client.Game.Character; +using static Lemegeton.Core.State; namespace Lemegeton.Content { @@ -51,6 +52,7 @@ internal class UltOmegaProtocol : Core.Content private const int HeadmarkerTriangle = 417; private bool ZoneOk = false; + private bool _subbed = false; private bool _sawFirstHeadMarker = false; private uint _firstHeadMarker = 0; @@ -1746,9 +1748,10 @@ internal void ReadyForDecision() { firstMonitorsSelection.AddRange( (from ix in _dynamisStacks - where ix.Value == 2 + where ix.Value >= 2 && ix.Key != distant1st && ix.Key != near1st && ix.Key != distant2nd && ix.Key != near2nd + orderby ix.Value descending select ix.Key).Take(2 - firstMonitorsSelection.Count) ); } @@ -1828,11 +1831,20 @@ protected override bool ExecutionImplementation() private void SubscribeToEvents() { - _state.OnCastBegin += OnCastBegin; - _state.OnAction += OnAction; - _state.OnStatusChange += OnStatusChange; - _state.OnTether += OnTether; - _state.OnHeadMarker += OnHeadMarker; + lock (this) + { + if (_subbed == true) + { + return; + } + _subbed = true; + Log(LogLevelEnum.Debug, null, "Subscribing to events"); + _state.OnCastBegin += OnCastBegin; + _state.OnAction += OnAction; + _state.OnStatusChange += OnStatusChange; + _state.OnTether += OnTether; + _state.OnHeadMarker += OnHeadMarker; + } } private void OnHeadMarker(uint dest, uint markerId) @@ -2023,11 +2035,20 @@ private void OnTether(uint src, uint dest, uint tetherId) private void UnsubscribeFromEvents() { - _state.OnHeadMarker -= OnHeadMarker; - _state.OnTether -= OnTether; - _state.OnStatusChange -= OnStatusChange; - _state.OnAction -= OnAction; - _state.OnCastBegin -= OnCastBegin; + lock (this) + { + if (_subbed == false) + { + return; + } + Log(LogLevelEnum.Debug, null, "Unsubscribing from events"); + _state.OnHeadMarker -= OnHeadMarker; + _state.OnTether -= OnTether; + _state.OnStatusChange -= OnStatusChange; + _state.OnAction -= OnAction; + _state.OnCastBegin -= OnCastBegin; + _subbed = false; + } } private void OnCombatChange(bool inCombat) diff --git a/Lemegeton/Content/UltUcob.cs b/Lemegeton/Content/UltUcob.cs index 2bb5d02..0f97ece 100644 --- a/Lemegeton/Content/UltUcob.cs +++ b/Lemegeton/Content/UltUcob.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Collections; +using static Lemegeton.Core.State; namespace Lemegeton.Content { @@ -26,6 +27,7 @@ internal class UltUcob : Core.Content private const int TetherFireball = 5; private bool ZoneOk = false; + private bool _subbed = false; private FireballAm _fireballAm; private ChainLightningAm _chainLightningAm; @@ -429,10 +431,19 @@ protected override bool ExecutionImplementation() private void SubscribeToEvents() { - _state.OnTether += OnTether; - _state.OnHeadMarker += OnHeadMarker; - _state.OnAction += _state_OnAction; - _state.OnStatusChange += _state_OnStatusChange; + lock (this) + { + if (_subbed == true) + { + return; + } + _subbed = true; + Log(LogLevelEnum.Debug, null, "Subscribing to events"); + _state.OnTether += OnTether; + _state.OnHeadMarker += OnHeadMarker; + _state.OnAction += _state_OnAction; + _state.OnStatusChange += _state_OnStatusChange; + } } private void OnTether(uint src, uint dest, uint tetherId) @@ -503,10 +514,19 @@ private void _state_OnAction(uint src, uint dest, ushort actionId) private void UnsubscribeFromEvents() { - _state.OnTether -= OnTether; - _state.OnHeadMarker -= OnHeadMarker; - _state.OnStatusChange -= _state_OnStatusChange; - _state.OnAction -= _state_OnAction; + lock (this) + { + if (_subbed == false) + { + return; + } + Log(LogLevelEnum.Debug, null, "Unsubscribing from events"); + _state.OnTether -= OnTether; + _state.OnHeadMarker -= OnHeadMarker; + _state.OnStatusChange -= _state_OnStatusChange; + _state.OnAction -= _state_OnAction; + _subbed = false; + } } private void OnCombatChange(bool inCombat) diff --git a/Lemegeton/Content/UltWeaponsRefrain.cs b/Lemegeton/Content/UltWeaponsRefrain.cs index 759bcd1..4e31d3a 100644 --- a/Lemegeton/Content/UltWeaponsRefrain.cs +++ b/Lemegeton/Content/UltWeaponsRefrain.cs @@ -2,6 +2,7 @@ using Lemegeton.Core; using System.Collections.Generic; using System.Linq; +using static Lemegeton.Core.State; namespace Lemegeton.Content { @@ -16,6 +17,7 @@ internal class UltWeaponsRefrain : Core.Content private const int StatusFetters = 292; private bool ZoneOk = false; + private bool _subbed = false; private GaolAM _gaolAm; @@ -128,8 +130,17 @@ protected override bool ExecutionImplementation() private void SubscribeToEvents() { - _state.OnAction += _state_OnAction; - _state.OnStatusChange += _state_OnStatusChange; + lock (this) + { + if (_subbed == true) + { + return; + } + _subbed = true; + Log(LogLevelEnum.Debug, null, "Subscribing to events"); + _state.OnAction += _state_OnAction; + _state.OnStatusChange += _state_OnStatusChange; + } } private void _state_OnStatusChange(uint src, uint dest, uint statusId, bool gained, float duration, int stacks) @@ -150,8 +161,17 @@ private void _state_OnAction(uint src, uint dest, ushort actionId) private void UnsubscribeFromEvents() { - _state.OnStatusChange -= _state_OnStatusChange; - _state.OnAction -= _state_OnAction; + lock (this) + { + if (_subbed == false) + { + return; + } + Log(LogLevelEnum.Debug, null, "Unsubscribing from events"); + _state.OnStatusChange -= _state_OnStatusChange; + _state.OnAction -= _state_OnAction; + _subbed = false; + } } private void OnCombatChange(bool inCombat) diff --git a/Lemegeton/Content/VisualEnhancement.cs b/Lemegeton/Content/VisualEnhancement.cs index 522b250..effed07 100644 --- a/Lemegeton/Content/VisualEnhancement.cs +++ b/Lemegeton/Content/VisualEnhancement.cs @@ -1,10 +1,15 @@ using Dalamud.Game.ClientState.Objects.Enums; using Dalamud.Game.ClientState.Objects.SubKinds; using Dalamud.Game.ClientState.Objects.Types; +using Dalamud.Interface.Internal; using ImGuiNET; using Lemegeton.Core; using System; +using System.Collections; +using System.Collections.Generic; using System.Numerics; +using static Lemegeton.Content.Overlays; +using static Lemegeton.Content.Overlays.DotTracker; using GameObject = Dalamud.Game.ClientState.Objects.Types.GameObject; using GameObjectPtr = FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject; @@ -16,6 +21,282 @@ public class VisualEnhancement : Core.Content public override FeaturesEnum Features => FeaturesEnum.None; + public class Castbar : Core.ContentItem + { + + public class CastbarVisualsWidget : CustomPropertyInterface + { + + public override void Deserialize(string data) + { + string[] temp = data.Split(";"); + foreach (string t in temp) + { + string[] item = t.Split("=", 2); + switch (item[0]) + { + case "WarningThreshold": _cb._visualWarningThreshold = float.Parse(item[1]); break; + case "BarWidth": _cb._visualBarWidth = float.Parse(item[1]); break; + case "BarHeight": _cb._visualBarHeight = float.Parse(item[1]); break; + case "FontSize": _cb._visualFontSize = float.Parse(item[1]); break; + case "BarOffsetWorldX": _cb._visualBarOffsetWorldX = float.Parse(item[1]); break; + case "BarOffsetWorldY": _cb._visualBarOffsetWorldY = float.Parse(item[1]); break; + case "BarOffsetWorldZ": _cb._visualBarOffsetWorldZ = float.Parse(item[1]); break; + case "BarOffsetScreenX": _cb._visualBarOffsetScreenX = float.Parse(item[1]); break; + case "BarOffsetScreenY": _cb._visualBarOffsetScreenY = float.Parse(item[1]); break; + } + } + } + + public override string Serialize() + { + List items = new List(); + items.Add(String.Format("WarningThreshold={0}", _cb._visualWarningThreshold)); + items.Add(String.Format("BarWidth={0}", _cb._visualBarWidth)); + items.Add(String.Format("BarHeight={0}", _cb._visualBarHeight)); + items.Add(String.Format("FontSize={0}", _cb._visualFontSize)); + items.Add(String.Format("BarOffsetWorldX={0}", _cb._visualBarOffsetWorldX)); + items.Add(String.Format("BarOffsetWorldY={0}", _cb._visualBarOffsetWorldY)); + items.Add(String.Format("BarOffsetWorldZ={0}", _cb._visualBarOffsetWorldZ)); + items.Add(String.Format("BarOffsetScreenX={0}", _cb._visualBarOffsetScreenX)); + items.Add(String.Format("BarOffsetScreenY={0}", _cb._visualBarOffsetScreenY)); + return String.Join(";", items); + } + + public override void RenderEditor(string path) + { + Vector2 avail = ImGui.GetContentRegionAvail(); + string proptr = I18n.Translate(path); + ImGui.Text(proptr); + ImGui.PushItemWidth(avail.X); + ImGui.Text(Environment.NewLine + I18n.Translate(path + "/WarningThreshold")); + float barr = _cb._visualWarningThreshold; + if (ImGui.DragFloat("##" + path + "/WarningThreshold", ref barr, 0.01f, 0.0f, 30.0f, "%.1f", ImGuiSliderFlags.AlwaysClamp) == true) + { + _cb._visualWarningThreshold = barr; + } + ImGui.Text(Environment.NewLine + I18n.Translate(path + "/BarWidth")); + float barw = _cb._visualBarWidth; + if (ImGui.SliderFloat("##" + path + "/BarWidth", ref barw, 50.0f, 600.0f, "%.0f") == true) + { + _cb._visualBarWidth = barw; + } + ImGui.Text(Environment.NewLine + I18n.Translate(path + "/BarHeight")); + float barh = _cb._visualBarHeight; + if (ImGui.SliderFloat("##" + path + "/ItemHeight", ref barh, 10.0f, 60.0f, "%.0f") == true) + { + _cb._visualBarHeight = barh; + } + ImGui.Text(Environment.NewLine + I18n.Translate(path + "/FontSize")); + float fnts = _cb._visualFontSize; + if (ImGui.SliderFloat("##" + path + "/FontSize", ref fnts, 8.0f, 56.0f, "%.0f") == true) + { + _cb._visualFontSize = fnts; + } + ImGui.TextWrapped(Environment.NewLine + I18n.Translate(path + "/BarOffsetWorld")); + float ofsworldx = _cb._visualBarOffsetWorldX; + if (ImGui.DragFloat("X##" + path + "/BarOffsetWorldX", ref ofsworldx, 0.01f, -5.0f, 5.0f, "%.2f", ImGuiSliderFlags.AlwaysClamp) == true) + { + _cb._visualBarOffsetWorldX = ofsworldx; + } + float ofsworldy = _cb._visualBarOffsetWorldY; + if (ImGui.DragFloat("Y##" + path + "/BarOffsetWorldY", ref ofsworldy, 0.01f, -5.0f, 5.0f, "%.2f", ImGuiSliderFlags.AlwaysClamp) == true) + { + _cb._visualBarOffsetWorldY = ofsworldy; + } + float ofsworldz = _cb._visualBarOffsetWorldZ; + if (ImGui.DragFloat("Z##" + path + "/BarOffsetWorldZ", ref ofsworldz, 0.01f, -5.0f, 5.0f, "%.2f", ImGuiSliderFlags.AlwaysClamp) == true) + { + _cb._visualBarOffsetWorldZ = ofsworldz; + } + ImGui.TextWrapped(Environment.NewLine + I18n.Translate(path + "/BarOffsetScreen")); + float ofsscreenx = _cb._visualBarOffsetScreenX; + if (ImGui.DragFloat("X##" + path + "/BarOffsetScreenX", ref ofsscreenx, 1.0f, -300.0f, 300.0f, "%.0f", ImGuiSliderFlags.AlwaysClamp) == true) + { + _cb._visualBarOffsetScreenX = ofsscreenx; + } + float ofsscreeny = _cb._visualBarOffsetScreenY; + if (ImGui.DragFloat("Y##" + path + "/BarOffsetScreenY", ref ofsscreeny, 1.0f, -300.0f, 300.0f, "%.0f", ImGuiSliderFlags.AlwaysClamp) == true) + { + _cb._visualBarOffsetScreenY = ofsscreeny; + } + ImGui.PopItemWidth(); + } + + private Castbar _cb; + + public CastbarVisualsWidget(Castbar cb) + { + _cb = cb; + } + + } + + public override FeaturesEnum Features => FeaturesEnum.Drawing; + + [AttributeOrderNumber(1000)] + public Vector4 CastColor { get; set; } = new Vector4(1.0f, 1.0f, 0.0f, 1.0f); + [AttributeOrderNumber(1001)] + public Vector4 WarningColor { get; set; } = new Vector4(1.0f, 0.5f, 0.0f, 1.0f); + [AttributeOrderNumber(1002)] + public Vector4 InterruptColor { get; set; } = new Vector4(1.0f, 0.0f, 1.0f, 1.0f); + + [AttributeOrderNumber(2000)] + public CastbarVisualsWidget CastbarVisuals { get; set; } + + [AttributeOrderNumber(3000)] + public bool OnlyCurrentTarget { get; set; } = true; + [AttributeOrderNumber(3001)] + public bool OnlyTargettable { get; set; } = true; + [AttributeOrderNumber(3002)] + public bool ShowCastName { get; set; } = false; + [AttributeOrderNumber(3003)] + public bool ShowCastTime { get; set; } = false; + + internal float _visualBarHeight { get; set; } = 20.0f; + internal float _visualBarWidth { get; set; } = 200.0f; + internal float _visualWarningThreshold { get; set; } = 2.5f; + internal float _visualFontSize { get; set; } = 16.0f; + + internal float _visualBarOffsetWorldX { get; set; } = 0.0f; + internal float _visualBarOffsetWorldY { get; set; } = 2.0f; + internal float _visualBarOffsetWorldZ { get; set; } = 0.0f; + internal float _visualBarOffsetScreenX { get; set; } = 0.0f; + internal float _visualBarOffsetScreenY { get; set; } = 0.0f; + + private void DrawCastBar(ImDrawListPtr draw, float x, float y, float width, float height, float timeRemaining, float timeMax, bool interruptable, string name) + { + float x2 = x + (width * timeRemaining / timeMax); + float yt = y + (height * 0.3f); + Vector4 maincol; + if (timeRemaining > _visualWarningThreshold) + { + maincol = CastColor; + } + else + { + maincol = WarningColor; + } + Vector4 bg = new Vector4(0.0f, 0.0f, 0.0f, 0.5f); + Vector4 shadow = new Vector4( + Math.Clamp(maincol.X * 0.5f, 0.0f, 1.0f), + Math.Clamp(maincol.Y * 0.5f, 0.0f, 1.0f), + Math.Clamp(maincol.Z * 0.5f, 0.0f, 1.0f), + maincol.W + ); + Vector4 hilite = new Vector4( + Math.Clamp(maincol.X + 0.2f, 0.0f, 1.0f), + Math.Clamp(maincol.Y + 0.2f, 0.0f, 1.0f), + Math.Clamp(maincol.Z + 0.2f, 0.0f, 1.0f), + maincol.W + ); + draw.AddRectFilled( + new Vector2(x2, y), + new Vector2(x + width, y + height), + ImGui.GetColorU32(bg) + ); + draw.AddRectFilledMultiColor( + new Vector2(x, y), + new Vector2(x2, yt), + ImGui.GetColorU32(maincol), + ImGui.GetColorU32(maincol), + ImGui.GetColorU32(hilite), + ImGui.GetColorU32(hilite) + ); + draw.AddRectFilledMultiColor( + new Vector2(x, yt), + new Vector2(x2, y + height), + ImGui.GetColorU32(hilite), + ImGui.GetColorU32(hilite), + ImGui.GetColorU32(shadow), + ImGui.GetColorU32(shadow) + ); + if (interruptable == true) + { + uint col = ImGui.GetColorU32(InterruptColor); + float ang = (float)Math.Abs(Math.Sin(timeRemaining * 10.0f)); + float ef = (float)Math.Round(ang * (_visualBarHeight / 10.0f)); + float thicc = (float)Math.Round(Math.Clamp((_visualBarHeight / 15.0f), 2.0f, 10.0f)); + draw.AddLine(new Vector2(x - ef, y - ef), new Vector2(x + width + ef, y - ef), col, thicc + (ang * thicc)); + draw.AddLine(new Vector2(x - ef, y + height + ef), new Vector2(x + width + ef, y + height + ef), col, thicc + (ang * thicc)); + draw.AddLine(new Vector2(x - ef, y - ef), new Vector2(x - ef, y + height + ef), col, thicc + (ang * thicc)); + draw.AddLine(new Vector2(x + width + ef, y - ef), new Vector2(x + width + ef, y + height + ef), col, thicc + (ang * thicc)); + } + if (ShowCastTime == true) + { + string str = String.Format("{0:0.0}", timeRemaining); + Vector2 sz = ImGui.CalcTextSize(str); + float scale = _visualFontSize / sz.Y; + sz = new Vector2(sz.X * scale, sz.Y * scale); + draw.AddText(ImGui.GetFont(), _visualFontSize, new Vector2(x2 + 5.0f, y + (height / 2.0f) - (sz.Y / 2.0f)), ImGui.GetColorU32(new Vector4(1.0f, 1.0f, 1.0f, 1.0f)), str); + } + if (name != "") + { + Vector2 sz = ImGui.CalcTextSize(name); + float scale = _visualFontSize / sz.Y; + sz = new Vector2(sz.X * scale, sz.Y * scale); + draw.AddText(ImGui.GetFont(), _visualFontSize, new Vector2(x + (width / 2.0f) - (sz.X / 2.0f) + 1.0f, y + (height / 2.0f) - (sz.Y / 2.0f) + 1.0f), ImGui.GetColorU32(new Vector4(0.0f, 0.0f, 0.0f, 1.0f)), name); + draw.AddText(ImGui.GetFont(), _visualFontSize, new Vector2(x + (width / 2.0f) - (sz.X / 2.0f), y + (height / 2.0f) - (sz.Y / 2.0f)), ImGui.GetColorU32(new Vector4(1.0f, 1.0f, 1.0f, 1.0f)), name); + } + } + + protected override bool ExecutionImplementation() + { + ImDrawListPtr draw; + if (_state.StartDrawing(out draw) == false) + { + return false; + } + PlayerCharacter c = _state.cs.LocalPlayer; + foreach (GameObject go in _state.ot) + { + if (go.ObjectKind != ObjectKind.BattleNpc) + { + continue; + } + if (OnlyCurrentTarget == true && (c.TargetObject == null || c.TargetObject.ObjectId != go.ObjectId)) + { + continue; + } + if (go.SubKind == 2) + { + continue; + } + bool isTargettable; + unsafe + { + GameObjectPtr* gop = (GameObjectPtr*)go.Address; + isTargettable = gop->GetIsTargetable(); + } + if (OnlyTargettable == true && isTargettable == false) + { + continue; + } + BattleChara bc = go as BattleChara; + if (bc.IsCasting == true && bc.CastActionId > 0) + { + Vector3 pos = _state.plug._ui.TranslateToScreen( + go.Position.X + _visualBarOffsetWorldX, + go.Position.Y + _visualBarOffsetWorldY, + go.Position.Z + _visualBarOffsetWorldZ + ); + pos = new Vector3(pos.X + _visualBarOffsetScreenX, pos.Y + _visualBarOffsetScreenY, pos.Z); + DrawCastBar(draw, pos.X - (_visualBarWidth / 2.0f), pos.Y - _visualBarHeight, _visualBarWidth, _visualBarHeight, bc.TotalCastTime - bc.CurrentCastTime, bc.TotalCastTime, bc.IsCastInterruptible, + ShowCastName == true ? _state.plug.GetActionName(bc.CastActionId) : "" + ); + } + } + return true; + } + + public Castbar(State state) : base(state) + { + Enabled = false; + CastbarVisuals = new CastbarVisualsWidget(this); + } + + } + public class Hitbox : Core.ContentItem { diff --git a/Lemegeton/Core/UserInterface.cs b/Lemegeton/Core/UserInterface.cs index dfa4c17..d9bd96b 100644 --- a/Lemegeton/Core/UserInterface.cs +++ b/Lemegeton/Core/UserInterface.cs @@ -51,6 +51,9 @@ internal enum MiscIconEnum TimelineActive = 19, TimelineInactive = 20, ProfileActive = 21, + LightDragon = 22, + DarkDragon = 23, + LightCircle = 24, } internal void LoadTextures() @@ -75,6 +78,9 @@ internal void LoadTextures() _misc[MiscIconEnum.TimelineActive] = GetTexture(61806); _misc[MiscIconEnum.TimelineInactive] = GetTexture(61807); _misc[MiscIconEnum.ProfileActive] = GetTexture(61803); + _misc[MiscIconEnum.LightDragon] = GetTexture(91113); + _misc[MiscIconEnum.DarkDragon] = GetTexture(91613); + _misc[MiscIconEnum.LightCircle] = GetTexture(60496); _signs[AutomarkerSigns.SignEnum.Attack1] = GetTexture(61201); _signs[AutomarkerSigns.SignEnum.Attack2] = GetTexture(61202); _signs[AutomarkerSigns.SignEnum.Attack3] = GetTexture(61203); diff --git a/Lemegeton/Language/Chinese.cs b/Lemegeton/Language/Chinese.cs index 5023ef9..b8fd840 100644 --- a/Lemegeton/Language/Chinese.cs +++ b/Lemegeton/Language/Chinese.cs @@ -14,6 +14,27 @@ internal class Chinese : Core.Language public Chinese(State st) : base(st) { + #region 1.0.3.1 + //AddEntry("Content/Ultimate/UltDragonsongReprise/DoubleDragons", "(P6) Dragon HP difference indicator"); + //AddEntry("Content/Ultimate/UltDragonsongReprise/DoubleDragons/Enabled", "Enabled"); + //AddEntry("Content/Ultimate/UltDragonsongReprise/DoubleDragons/Test", "Test on self and closest enemy"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar", "Enemy cast bar"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/Enabled", "Enabled"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastColor", "Cast bar color"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/WarningColor", "Cast bar time warning color"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/InterruptColor", "Interrupt highlight color"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals", "Cast bar visual configuration"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/WarningThreshold", "Cast time warning threshold in seconds"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarWidth", "Cast bar width"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarHeight", "Cast bar height"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/FontSize", "Text size"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarOffsetWorld", "Cast bar offset in world coordinates"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarOffsetScreen", "Cast bar offset in screen coordinates"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/OnlyCurrentTarget", "Draw only for current target"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/OnlyTargettable", "Draw only for targettable entities"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/ShowCastName", "Show ability name on cast bar"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/ShowCastTime", "Show remaining time on cast bar"); + #endregion #region 1.0.2.9 //AddEntry("Content/Criterion/EwCritAloalo/StaticePresentTether", "Statice Present Box tether indicator"); //AddEntry("Content/Criterion/EwCritAloalo/StaticePresentTether/Enabled", "Enabled"); diff --git a/Lemegeton/Language/Danish.cs b/Lemegeton/Language/Danish.cs index f861a76..f8a365b 100644 --- a/Lemegeton/Language/Danish.cs +++ b/Lemegeton/Language/Danish.cs @@ -14,6 +14,27 @@ internal class Danish : Core.Language public Danish(State st) : base(st) { + #region 1.0.3.1 + //AddEntry("Content/Ultimate/UltDragonsongReprise/DoubleDragons", "(P6) Dragon HP difference indicator"); + //AddEntry("Content/Ultimate/UltDragonsongReprise/DoubleDragons/Enabled", "Enabled"); + //AddEntry("Content/Ultimate/UltDragonsongReprise/DoubleDragons/Test", "Test on self and closest enemy"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar", "Enemy cast bar"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/Enabled", "Enabled"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastColor", "Cast bar color"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/WarningColor", "Cast bar time warning color"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/InterruptColor", "Interrupt highlight color"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals", "Cast bar visual configuration"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/WarningThreshold", "Cast time warning threshold in seconds"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarWidth", "Cast bar width"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarHeight", "Cast bar height"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/FontSize", "Text size"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarOffsetWorld", "Cast bar offset in world coordinates"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarOffsetScreen", "Cast bar offset in screen coordinates"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/OnlyCurrentTarget", "Draw only for current target"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/OnlyTargettable", "Draw only for targettable entities"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/ShowCastName", "Show ability name on cast bar"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/ShowCastTime", "Show remaining time on cast bar"); + #endregion #region 1.0.2.9 //AddEntry("Content/Criterion/EwCritAloalo/StaticePresentTether", "Statice Present Box tether indicator"); //AddEntry("Content/Criterion/EwCritAloalo/StaticePresentTether/Enabled", "Enabled"); diff --git a/Lemegeton/Language/English.cs b/Lemegeton/Language/English.cs index 9167303..c7778f6 100644 --- a/Lemegeton/Language/English.cs +++ b/Lemegeton/Language/English.cs @@ -14,6 +14,27 @@ internal class English : Core.Language public English(State st) : base(st) { + #region 1.0.3.1 + AddEntry("Content/Ultimate/UltDragonsongReprise/DoubleDragons", "(P6) Dragon HP difference indicator"); + AddEntry("Content/Ultimate/UltDragonsongReprise/DoubleDragons/Enabled", "Enabled"); + AddEntry("Content/Ultimate/UltDragonsongReprise/DoubleDragons/Test", "Test on self and closest enemy"); + AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar", "Enemy cast bar"); + AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/Enabled", "Enabled"); + AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastColor", "Cast bar color"); + AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/WarningColor", "Cast bar time warning color"); + AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/InterruptColor", "Interrupt highlight color"); + AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals", "Cast bar visual configuration"); + AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/WarningThreshold", "Cast time warning threshold in seconds"); + AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarWidth", "Cast bar width"); + AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarHeight", "Cast bar height"); + AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/FontSize", "Text size"); + AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarOffsetWorld", "Cast bar offset in world coordinates"); + AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarOffsetScreen", "Cast bar offset in screen coordinates"); + AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/OnlyCurrentTarget", "Draw only for current target"); + AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/OnlyTargettable", "Draw only for targettable entities"); + AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/ShowCastName", "Show ability name on cast bar"); + AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/ShowCastTime", "Show remaining time on cast bar"); + #endregion #region 1.0.2.9 AddEntry("Content/Criterion/EwCritAloalo/StaticePresentTether", "Statice Present Box tether indicator"); AddEntry("Content/Criterion/EwCritAloalo/StaticePresentTether/Enabled", "Enabled"); diff --git a/Lemegeton/Language/French.cs b/Lemegeton/Language/French.cs index 453e782..a739adc 100644 --- a/Lemegeton/Language/French.cs +++ b/Lemegeton/Language/French.cs @@ -14,6 +14,27 @@ internal class French : Core.Language public French(State st) : base(st) { + #region 1.0.3.1 + //AddEntry("Content/Ultimate/UltDragonsongReprise/DoubleDragons", "(P6) Dragon HP difference indicator"); + //AddEntry("Content/Ultimate/UltDragonsongReprise/DoubleDragons/Enabled", "Enabled"); + //AddEntry("Content/Ultimate/UltDragonsongReprise/DoubleDragons/Test", "Test on self and closest enemy"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar", "Enemy cast bar"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/Enabled", "Enabled"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastColor", "Cast bar color"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/WarningColor", "Cast bar time warning color"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/InterruptColor", "Interrupt highlight color"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals", "Cast bar visual configuration"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/WarningThreshold", "Cast time warning threshold in seconds"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarWidth", "Cast bar width"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarHeight", "Cast bar height"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/FontSize", "Text size"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarOffsetWorld", "Cast bar offset in world coordinates"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarOffsetScreen", "Cast bar offset in screen coordinates"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/OnlyCurrentTarget", "Draw only for current target"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/OnlyTargettable", "Draw only for targettable entities"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/ShowCastName", "Show ability name on cast bar"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/ShowCastTime", "Show remaining time on cast bar"); + #endregion #region 1.0.2.9 //AddEntry("Content/Criterion/EwCritAloalo/StaticePresentTether", "Statice Present Box tether indicator"); //AddEntry("Content/Criterion/EwCritAloalo/StaticePresentTether/Enabled", "Enabled"); diff --git a/Lemegeton/Language/German.cs b/Lemegeton/Language/German.cs index 57d516e..b407e68 100644 --- a/Lemegeton/Language/German.cs +++ b/Lemegeton/Language/German.cs @@ -14,6 +14,27 @@ internal class German : Core.Language public German(State st) : base(st) { + #region 1.0.3.1 + //AddEntry("Content/Ultimate/UltDragonsongReprise/DoubleDragons", "(P6) Dragon HP difference indicator"); + //AddEntry("Content/Ultimate/UltDragonsongReprise/DoubleDragons/Enabled", "Enabled"); + //AddEntry("Content/Ultimate/UltDragonsongReprise/DoubleDragons/Test", "Test on self and closest enemy"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar", "Enemy cast bar"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/Enabled", "Enabled"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastColor", "Cast bar color"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/WarningColor", "Cast bar time warning color"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/InterruptColor", "Interrupt highlight color"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals", "Cast bar visual configuration"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/WarningThreshold", "Cast time warning threshold in seconds"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarWidth", "Cast bar width"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarHeight", "Cast bar height"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/FontSize", "Text size"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarOffsetWorld", "Cast bar offset in world coordinates"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarOffsetScreen", "Cast bar offset in screen coordinates"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/OnlyCurrentTarget", "Draw only for current target"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/OnlyTargettable", "Draw only for targettable entities"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/ShowCastName", "Show ability name on cast bar"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/ShowCastTime", "Show remaining time on cast bar"); + #endregion #region 1.0.2.9 //AddEntry("Content/Criterion/EwCritAloalo/StaticePresentTether", "Statice Present Box tether indicator"); //AddEntry("Content/Criterion/EwCritAloalo/StaticePresentTether/Enabled", "Enabled"); diff --git a/Lemegeton/Language/Japanese.cs b/Lemegeton/Language/Japanese.cs index d88f5da..616ff26 100644 --- a/Lemegeton/Language/Japanese.cs +++ b/Lemegeton/Language/Japanese.cs @@ -14,6 +14,27 @@ internal class Japanese : Core.Language public Japanese(State st) : base(st) { + #region 1.0.3.1 + //AddEntry("Content/Ultimate/UltDragonsongReprise/DoubleDragons", "(P6) Dragon HP difference indicator"); + //AddEntry("Content/Ultimate/UltDragonsongReprise/DoubleDragons/Enabled", "Enabled"); + //AddEntry("Content/Ultimate/UltDragonsongReprise/DoubleDragons/Test", "Test on self and closest enemy"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar", "Enemy cast bar"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/Enabled", "Enabled"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastColor", "Cast bar color"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/WarningColor", "Cast bar time warning color"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/InterruptColor", "Interrupt highlight color"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals", "Cast bar visual configuration"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/WarningThreshold", "Cast time warning threshold in seconds"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarWidth", "Cast bar width"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarHeight", "Cast bar height"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/FontSize", "Text size"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarOffsetWorld", "Cast bar offset in world coordinates"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarOffsetScreen", "Cast bar offset in screen coordinates"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/OnlyCurrentTarget", "Draw only for current target"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/OnlyTargettable", "Draw only for targettable entities"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/ShowCastName", "Show ability name on cast bar"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/ShowCastTime", "Show remaining time on cast bar"); + #endregion #region 1.0.2.9 AddEntry("Content/Criterion/EwCritAloalo/StaticePresentTether", "スターチス プレゼントボックス線インジケーター"); AddEntry("Content/Criterion/EwCritAloalo/StaticePresentTether/Enabled", "有効"); diff --git a/Lemegeton/Language/Korean.cs b/Lemegeton/Language/Korean.cs index ec72a67..59558f4 100644 --- a/Lemegeton/Language/Korean.cs +++ b/Lemegeton/Language/Korean.cs @@ -14,6 +14,27 @@ internal class Korean : Core.Language public Korean(State st) : base(st) { + #region 1.0.3.1 + //AddEntry("Content/Ultimate/UltDragonsongReprise/DoubleDragons", "(P6) Dragon HP difference indicator"); + //AddEntry("Content/Ultimate/UltDragonsongReprise/DoubleDragons/Enabled", "Enabled"); + //AddEntry("Content/Ultimate/UltDragonsongReprise/DoubleDragons/Test", "Test on self and closest enemy"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar", "Enemy cast bar"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/Enabled", "Enabled"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastColor", "Cast bar color"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/WarningColor", "Cast bar time warning color"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/InterruptColor", "Interrupt highlight color"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals", "Cast bar visual configuration"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/WarningThreshold", "Cast time warning threshold in seconds"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarWidth", "Cast bar width"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarHeight", "Cast bar height"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/FontSize", "Text size"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarOffsetWorld", "Cast bar offset in world coordinates"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/CastbarVisuals/BarOffsetScreen", "Cast bar offset in screen coordinates"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/OnlyCurrentTarget", "Draw only for current target"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/OnlyTargettable", "Draw only for targettable entities"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/ShowCastName", "Show ability name on cast bar"); + //AddEntry("Content/Miscellaneous/VisualEnhancement/Castbar/ShowCastTime", "Show remaining time on cast bar"); + #endregion #region 1.0.2.9 //AddEntry("Content/Criterion/EwCritAloalo/StaticePresentTether", "Statice Present Box tether indicator"); //AddEntry("Content/Criterion/EwCritAloalo/StaticePresentTether/Enabled", "Enabled"); diff --git a/Lemegeton/Plugin.cs b/Lemegeton/Plugin.cs index e35cef8..ff15b04 100644 --- a/Lemegeton/Plugin.cs +++ b/Lemegeton/Plugin.cs @@ -54,7 +54,7 @@ public sealed class Plugin : IDalamudPlugin #else public string Name => "Lemegeton"; #endif - public string Version = "1.0.3.0"; + public string Version = "1.0.3.1"; internal class Downloadable { @@ -301,7 +301,7 @@ public Plugin( ChangeLanguage(_state.cfg.Language); InitializeActionTypes(); _ui.LoadTextures(); - _state.pi.UiBuilder.BuildFonts += UiBuilder_BuildFonts; + _state.pi.UiBuilder.BuildFonts += UiBuilder_BuildFonts; _mainThread = new Thread(new ParameterizedThreadStart(MainThreadProc)); _mainThread.Name = "Lemegeton main thread"; _mainThread.Start(this); @@ -3869,7 +3869,7 @@ private void DrawSoftmarkerOn(AutomarkerSigns.SignEnum sign, uint actorId) float calcHeight = tw.Height * 2.0f * _state.cfg.SoftmarkerScale; pt.X -= calcWidth / 2.0f; pt.Y -= calcHeight; - ImGui.SetCursorPos(pt); + ImGui.SetCursorPos(pt); draw.AddImage( tw.ImGuiHandle, new Vector2(pt.X, pt.Y),