diff --git a/JobBars/Cursors/Manager/CursorManager.cs b/JobBars/Cursors/Manager/CursorManager.cs index 49c346c8..3302efe7 100644 --- a/JobBars/Cursors/Manager/CursorManager.cs +++ b/JobBars/Cursors/Manager/CursorManager.cs @@ -5,6 +5,7 @@ using JobBars.UI; using FFXIVClientStructs.FFXIV.Component.GUI; using JobBars.Helper; +using Dalamud.Interface.Utility; namespace JobBars.Cursors.Manager { public unsafe partial class CursorManager : PerJobManager { diff --git a/JobBars/Data/ItemSelector.cs b/JobBars/Data/ItemSelector.cs index fb6643f0..b2afd2cb 100644 --- a/JobBars/Data/ItemSelector.cs +++ b/JobBars/Data/ItemSelector.cs @@ -1,6 +1,10 @@ -using ImGuiNET; +using Dalamud.Interface.Internal; +using ImGuiNET; using JobBars.Helper; +using Lumina; +using Lumina.Data; using Lumina.Data.Files; +using Lumina.Extensions; using System; using System.Collections.Generic; using System.Linq; @@ -9,7 +13,8 @@ namespace JobBars.Data { public class ItemSelector { private readonly List Data; - public ImGuiScene.TextureWrap Icon; + //public ImGuiScene.TextureWrap Icon; + public IDalamudTextureWrap Icon; private ItemData Selected = new() { Icon = 0, @@ -89,15 +94,20 @@ public bool Draw() { private void LoadIcon(uint iconId) { Icon?.Dispose(); Icon = null; + if (iconId > 0) { TexFile tex; try { - tex = JobBars.DataManager.GetIcon(iconId); + //tex = JobBars.DataManager.GetIcon(iconId); + Icon = JobBars.TextureProvider.GetIcon(iconId); } catch (Exception) { - tex = JobBars.DataManager.GetIcon(0); + //tex = JobBars.DataManager.GetIcon(0); + Icon = JobBars.TextureProvider.GetIcon(0); } - Icon = JobBars.PluginInterface.UiBuilder.LoadImageRaw(BGRA_to_RGBA(tex.ImageData), tex.Header.Width, tex.Header.Height, 4); + + //Icon = + // JobBars.PluginInterface.UiBuilder.LoadImageRaw(BGRA_to_RGBA(tex.ImageData),tex.Header.Width, tex.Header.Height, 4); } } @@ -130,4 +140,4 @@ public void Dispose() { Icon = null; } } -} +} \ No newline at end of file diff --git a/JobBars/Helper/InfoBox.cs b/JobBars/Helper/InfoBox.cs index 5808379f..bf868068 100644 --- a/JobBars/Helper/InfoBox.cs +++ b/JobBars/Helper/InfoBox.cs @@ -1,4 +1,5 @@ using Dalamud.Interface; +using Dalamud.Interface.Utility; using ImGuiNET; using System; using System.Numerics; diff --git a/JobBars/Helper/UIHelper.cs b/JobBars/Helper/UIHelper.cs index f09e733a..c9601899 100644 --- a/JobBars/Helper/UIHelper.cs +++ b/JobBars/Helper/UIHelper.cs @@ -25,17 +25,25 @@ public static unsafe Vector2 GetNodeScale(AtkResNode* node) { } public static void Hide(AtkResNode* node) { - node->Flags &= ~0x10; - node->Flags_2 |= 0x1; + //node->Flags &= ~0x10; + var nodeValue = ~0x10; + node->NodeFlags &= (NodeFlags) nodeValue; + + //node->Flags_2 |= 0x1; + node->DrawFlags |= 0x1; } public static void Show(AtkResNode* node) { - node->Flags |= 0x10; - node->Flags_2 |= 0x1; + //node->Flags |= 0x10; + node->NodeFlags |= (NodeFlags) 0x10; + + //node->Flags_2 |= 0x1; + node->DrawFlags |= 0x1; } public static void Update(AtkResNode* node) { - node->Flags_2 |= 0x1; + //node->Flags_2 |= 0x1; + node->DrawFlags |= 0x1; } public static void SetVisibility(AtkResNode* node, bool visiblity) { @@ -46,25 +54,30 @@ public static void SetVisibility(AtkResNode* node, bool visiblity) { public static void SetSize(AtkResNode* node, int? width, int? height) { if (width != null && width >= ushort.MinValue && width <= ushort.MaxValue) node->Width = (ushort)width.Value; if (height != null && height >= ushort.MinValue && height <= ushort.MaxValue) node->Height = (ushort)height.Value; - node->Flags_2 |= 0x1; + //node->Flags_2 |= 0x1; + node->DrawFlags |= 0x1; } public static void SetPosition(AtkResNode* node, float? x, float? y) { if (x != null) node->X = x.Value; if (y != null) node->Y = y.Value; - node->Flags_2 |= 0x1; + //node->Flags_2 |= 0x1; + node->DrawFlags |= 0x1; } public static void SetScale(AtkResNode* atkUnitBase, float? scaleX, float? scaleY) { atkUnitBase->ScaleX = scaleX.Value; atkUnitBase->ScaleY = scaleY.Value; - atkUnitBase->Flags_2 |= 0x1; - atkUnitBase->Flags_2 |= 0x4; + //atkUnitBase->Flags_2 |= 0x1; + //atkUnitBase->Flags_2 |= 0x4; + atkUnitBase->DrawFlags |= 0x1; + atkUnitBase->DrawFlags |= 0x4; } public static void SetRotation(AtkResNode* node, float rotation) { node->Rotation = rotation; - node->Flags_2 |= 0x1; + //node->Flags_2 |= 0x1; + node->DrawFlags |= 0x1; } public static void Link(AtkResNode* next, AtkResNode* prev) { diff --git a/JobBars/Helper/UiHelper.GameFunctions.cs b/JobBars/Helper/UiHelper.GameFunctions.cs index 082e2401..7c788b63 100644 --- a/JobBars/Helper/UiHelper.GameFunctions.cs +++ b/JobBars/Helper/UiHelper.GameFunctions.cs @@ -72,7 +72,7 @@ public static bool GetCurrentCast(out float currentTime, out float totalTime) { return JobBars.ClientState.LocalPlayer.IsCasting; } - public static bool GetRecastActive(uint actionId, out float timeElapsed, ActionType actionType = ActionType.Spell) { + public static bool GetRecastActive(uint actionId, out float timeElapsed, ActionType actionType = ActionType.Action) { var actionManager = ActionManager.Instance(); var adjustedId = actionManager->GetAdjustedActionId(actionId); timeElapsed = actionManager->GetRecastTimeElapsed(actionType, adjustedId); @@ -84,7 +84,7 @@ public static uint GetAdjustedAction(uint actionId) { return actionManager->GetAdjustedActionId(actionId); } - public static bool GetRecastActiveAndTotal(uint actionId, out float timeElapsed, out float timeTotal, ActionType actionType = ActionType.Spell) { + public static bool GetRecastActiveAndTotal(uint actionId, out float timeElapsed, out float timeTotal, ActionType actionType = ActionType.Action) { var actionManager = ActionManager.Instance(); var adjustedId = actionManager->GetAdjustedActionId(actionId); timeElapsed = actionManager->GetRecastTimeElapsed(actionType, adjustedId); diff --git a/JobBars/JobBars.Hooks.cs b/JobBars/JobBars.Hooks.cs index 698862d1..92c977fc 100644 --- a/JobBars/JobBars.Hooks.cs +++ b/JobBars/JobBars.Hooks.cs @@ -126,7 +126,7 @@ private IntPtr IconDimmedDetour(IntPtr iconUnk, byte dimmed) { return icon; } - private void ZoneChanged(object sender, ushort e) { + private void ZoneChanged(ushort e) { if (!IsLoaded) return; GaugeManager?.Reset(); diff --git a/JobBars/JobBars.Settings.cs b/JobBars/JobBars.Settings.cs index 5e7476cd..0db8006e 100644 --- a/JobBars/JobBars.Settings.cs +++ b/JobBars/JobBars.Settings.cs @@ -1,4 +1,5 @@ using Dalamud.Interface; +using Dalamud.Interface.Utility; using ImGuiNET; using JobBars.Data; using JobBars.Helper; diff --git a/JobBars/JobBars.cs b/JobBars/JobBars.cs index 9be441aa..c9dd8018 100644 --- a/JobBars/JobBars.cs +++ b/JobBars/JobBars.cs @@ -8,6 +8,7 @@ using Dalamud.Hooking; using Dalamud.Logging; using Dalamud.Plugin; +using Dalamud.Plugin.Services; using JobBars.Buffs.Manager; using JobBars.Cooldowns.Manager; using JobBars.Cursors.Manager; @@ -23,14 +24,15 @@ namespace JobBars { public unsafe partial class JobBars : IDalamudPlugin { public static DalamudPluginInterface PluginInterface { get; private set; } - public static ClientState ClientState { get; private set; } - public static JobGauges JobGauges { get; private set; } - public static Framework Framework { get; private set; } - public static Condition Condition { get; private set; } - public static CommandManager CommandManager { get; private set; } - public static ObjectTable Objects { get; private set; } - public static SigScanner SigScanner { get; private set; } - public static DataManager DataManager { get; private set; } + public static IClientState ClientState { get; private set; } + public static IJobGauges JobGauges { get; private set; } + public static IFramework Framework { get; private set; } + public static ICondition Condition { get; private set; } + public static ICommandManager CommandManager { get; private set; } + public static IObjectTable Objects { get; private set; } + public static ISigScanner SigScanner { get; private set; } + public static IDataManager DataManager { get; private set; } + public static ITextureProvider TextureProvider { get; private set; } public static Configuration Config { get; private set; } public static UIBuilder Builder { get; private set; } @@ -67,24 +69,27 @@ public unsafe partial class JobBars : IDalamudPlugin { public JobBars( DalamudPluginInterface pluginInterface, - ClientState clientState, - CommandManager commandManager, - Condition condition, - Framework framework, - ObjectTable objects, - SigScanner sigScanner, - DataManager dataManager, - JobGauges jobGauges + IClientState clientState, + ICommandManager commandManager, + ICondition condition, + IFramework framework, + IObjectTable objects, + ISigScanner sigScanner, + IDataManager dataManager, + IJobGauges jobGauges, + IGameInteropProvider gameInteropProvider, + ITextureProvider textureProvider ) { PluginInterface = pluginInterface; - ClientState = clientState; - Framework = framework; - Condition = condition; - CommandManager = commandManager; - Objects = objects; - SigScanner = sigScanner; - DataManager = dataManager; - JobGauges = jobGauges; + ClientState = clientState; + Framework = framework; + Condition = condition; + CommandManager = commandManager; + Objects = objects; + SigScanner = sigScanner; + DataManager = dataManager; + JobGauges = jobGauges; + TextureProvider = textureProvider; UIHelper.Setup(); UIColor.SetupColors(); @@ -113,15 +118,15 @@ JobGauges jobGauges InitializeUI(); IntPtr receiveActionEffectFuncPtr = SigScanner.ScanText(Constants.ReceiveActionEffectSig); - ReceiveActionEffectHook = Hook.FromAddress(receiveActionEffectFuncPtr, ReceiveActionEffect); + ReceiveActionEffectHook = gameInteropProvider.HookFromAddress(receiveActionEffectFuncPtr, ReceiveActionEffect); ReceiveActionEffectHook.Enable(); IntPtr actorControlSelfPtr = SigScanner.ScanText(Constants.ActorControlSig); - ActorControlSelfHook = Hook.FromAddress(actorControlSelfPtr, ActorControlSelf); + ActorControlSelfHook = gameInteropProvider.HookFromAddress(actorControlSelfPtr, ActorControlSelf); ActorControlSelfHook.Enable(); IntPtr iconDimmedPtr = SigScanner.ScanText(Constants.IconDimmedSig); - IconDimmedHook = Hook.FromAddress(iconDimmedPtr, IconDimmedDetour); + IconDimmedHook = gameInteropProvider.HookFromAddress(iconDimmedPtr, IconDimmedDetour); IconDimmedHook.Enable(); PluginInterface.UiBuilder.Draw += BuildSettingsUI; @@ -191,7 +196,7 @@ private void Animate() { Animation.Tick(); } - private void FrameworkOnUpdate(Framework framework) { + private void FrameworkOnUpdate(IFramework framework) { if (!IsLoaded) return; var addon = UIHelper.BuffGaugeAttachAddon; diff --git a/JobBars/JobBars.json b/JobBars/JobBars.json index 62b103ad..e212c478 100644 --- a/JobBars/JobBars.json +++ b/JobBars/JobBars.json @@ -8,5 +8,5 @@ "Tags": [ "UI", "Bars" ], "RepoUrl": "https://github.com/0ceal0t/JobBars", "ApplicableVersion": "any", - "DalamudApiLevel": 8 + "DalamudApiLevel": 9 } \ No newline at end of file diff --git a/JobBars/UI/Buff/UIBuff.cs b/JobBars/UI/Buff/UIBuff.cs index 791a0e9f..ffe9196f 100644 --- a/JobBars/UI/Buff/UIBuff.cs +++ b/JobBars/UI/Buff/UIBuff.cs @@ -1,6 +1,7 @@ using Dalamud.Logging; using FFXIVClientStructs.FFXIV.Client.Graphics; using FFXIVClientStructs.FFXIV.Component.GUI; +using ImGuiNET; using JobBars.Data; using JobBars.Helper; @@ -58,8 +59,8 @@ public UIBuff() : base() { TextNode->AlignmentFontType = 52; TextNode->AtkResNode.X = 0; TextNode->AtkResNode.Y = 0; - TextNode->AtkResNode.Flags |= 0x10; - TextNode->AtkResNode.Flags_2 = 1; + TextNode->AtkResNode.NodeFlags = NodeFlags.Visible; + TextNode->AtkResNode.DrawFlags = 1; TextNode->EdgeColor = new ByteColor { R = 0, G = 0, B = 0, A = 255 }; var layout = new LayoutNode(RootRes, new[] { diff --git a/JobBars/UI/Buff/UIBuffPartyList.cs b/JobBars/UI/Buff/UIBuffPartyList.cs index 3d7e791b..6e8cdc84 100644 --- a/JobBars/UI/Buff/UIBuffPartyList.cs +++ b/JobBars/UI/Buff/UIBuffPartyList.cs @@ -21,7 +21,6 @@ public UIBuffPartyList() { Highlight->LeftOffset = 20; Highlight->PartsTypeRenderType = 220; Highlight->AtkResNode.NodeID = 23; - Highlight->AtkResNode.Flags_2 = 0; Highlight->AtkResNode.DrawFlags = 0; Highlight->AtkResNode.NodeFlags = (NodeFlags)19; Highlight->AtkResNode.MultiplyBlue = 50; @@ -39,7 +38,7 @@ public UIBuffPartyList() { TextNode->AtkResNode.X = 30; TextNode->AtkResNode.Y = 20; TextNode->AtkResNode.NodeFlags = (NodeFlags)19; - TextNode->AtkResNode.Flags_2 = 1; + TextNode->AtkResNode.DrawFlags = 1; TextNode->AtkResNode.Priority = 0; TextNode->AtkResNode.NodeID = 24; TextNode->SetText(""); diff --git a/JobBars/UI/Builder/UBuilder.Cursor.cs b/JobBars/UI/Builder/UBuilder.Cursor.cs index a9f8a56b..f8a6279e 100644 --- a/JobBars/UI/Builder/UBuilder.Cursor.cs +++ b/JobBars/UI/Builder/UBuilder.Cursor.cs @@ -15,7 +15,7 @@ private void InitCursor() { CursorRoot = CreateResNode(); CursorRoot->Width = 44; CursorRoot->Height = 46; - CursorRoot->Flags = 9395; + CursorRoot->NodeFlags = (NodeFlags) 9395; CursorOuter = CreateImageNode(); CursorOuter->AtkResNode.Width = 44; diff --git a/JobBars/UI/Builder/UIBuilder.Buffs.cs b/JobBars/UI/Builder/UIBuilder.Buffs.cs index 777b6649..25433f7c 100644 --- a/JobBars/UI/Builder/UIBuilder.Buffs.cs +++ b/JobBars/UI/Builder/UIBuilder.Buffs.cs @@ -15,7 +15,7 @@ private void InitBuffs() { BuffRoot = CreateResNode(); BuffRoot->Width = 256; BuffRoot->Height = 100; - BuffRoot->Flags = 9395; + BuffRoot->DrawFlags = 9395; UIBuff lastBuff = null; for (var i = 0; i < MAX_BUFFS; i++) { diff --git a/JobBars/UI/Builder/UIBuilder.Cooldowns.cs b/JobBars/UI/Builder/UIBuilder.Cooldowns.cs index 5aa1b861..469e3058 100644 --- a/JobBars/UI/Builder/UIBuilder.Cooldowns.cs +++ b/JobBars/UI/Builder/UIBuilder.Cooldowns.cs @@ -12,7 +12,7 @@ private void InitCooldowns() { CooldownRoot = CreateResNode(); CooldownRoot->Width = 100; CooldownRoot->Height = 100; - CooldownRoot->Flags = 9395; + CooldownRoot->DrawFlags = 9395; UIHelper.SetPosition(CooldownRoot, -40, 40); UICooldown lastCooldown = null; diff --git a/JobBars/UI/Builder/UIBuilder.Create.cs b/JobBars/UI/Builder/UIBuilder.Create.cs index 88b0a2f0..9fefd71b 100644 --- a/JobBars/UI/Builder/UIBuilder.Create.cs +++ b/JobBars/UI/Builder/UIBuilder.Create.cs @@ -21,9 +21,9 @@ public unsafe partial class UIBuilder { node->ChildCount = 0; node->PrevSiblingNode = null; node->NextSiblingNode = null; - node->Flags = 8243; - node->Flags_2 = 1; - node->Flags_2 |= 4; + node->DrawFlags = 8243; + node->DrawFlags = 1; + node->DrawFlags |= 4; return node; } @@ -47,9 +47,7 @@ public unsafe partial class UIBuilder { node->AtkResNode.ChildCount = 0; node->AtkResNode.PrevSiblingNode = null; node->AtkResNode.NextSiblingNode = null; - node->AtkResNode.Flags = 8250; - node->AtkResNode.Flags_2 = 1; - node->AtkResNode.Flags_2 |= 4; + node->AtkResNode.NodeFlags = (NodeFlags) 8250; node->AtkResNode.DrawFlags = 8; node->TextId = 0; @@ -93,9 +91,9 @@ public unsafe partial class UIBuilder { node->AtkResNode.ChildCount = 0; node->AtkResNode.PrevSiblingNode = null; node->AtkResNode.NextSiblingNode = null; - node->AtkResNode.Flags = 8243; - node->AtkResNode.Flags_2 = 1; - node->AtkResNode.Flags_2 |= 4; + node->AtkResNode.NodeFlags = (NodeFlags) 8243; + node->AtkResNode.DrawFlags = 1; + node->AtkResNode.DrawFlags |= 4; return node; } @@ -121,9 +119,9 @@ public unsafe partial class UIBuilder { node->AtkResNode.ChildCount = 0; node->AtkResNode.PrevSiblingNode = null; node->AtkResNode.NextSiblingNode = null; - node->AtkResNode.Flags = 8243; - node->AtkResNode.Flags_2 = 1; - node->AtkResNode.Flags_2 |= 4; + node->AtkResNode.NodeFlags = (NodeFlags) 8243; + node->AtkResNode.DrawFlags = 1; + node->AtkResNode.DrawFlags |= 4; node->AtkResNode.DrawFlags = 8; return node; diff --git a/JobBars/UI/Builder/UIBuilder.Gauges.cs b/JobBars/UI/Builder/UIBuilder.Gauges.cs index 034925bd..2a7ad7c7 100644 --- a/JobBars/UI/Builder/UIBuilder.Gauges.cs +++ b/JobBars/UI/Builder/UIBuilder.Gauges.cs @@ -15,7 +15,7 @@ private void InitGauges() { GaugeRoot = CreateResNode(); GaugeRoot->Width = 256; GaugeRoot->Height = 100; - GaugeRoot->Flags = 9395; + GaugeRoot->DrawFlags = 9395; UIDiamond lastDiamond = null; for (int idx = 0; idx < MAX_GAUGES; idx++) { diff --git a/JobBars/UI/Cooldown/UICooldown.cs b/JobBars/UI/Cooldown/UICooldown.cs index cb4a6e2f..ce6ea834 100644 --- a/JobBars/UI/Cooldown/UICooldown.cs +++ b/JobBars/UI/Cooldown/UICooldown.cs @@ -30,8 +30,7 @@ public UICooldownItem() { TextNode->AtkResNode.Height = HEIGHT; TextNode->AtkResNode.X = 0; TextNode->AtkResNode.Y = 0; - TextNode->AtkResNode.Flags |= 0x10; - TextNode->AtkResNode.Flags_2 = 1; + TextNode->AtkResNode.DrawFlags |= 0x10; TextNode->EdgeColor = new ByteColor { R = 0, G = 0, B = 0, A = 255 }; Icon = UIBuilder.CreateImageNode(); diff --git a/JobBars/UI/Gauge/UIBar.cs b/JobBars/UI/Gauge/UIBar.cs index 050b81a5..8b9fafed 100644 --- a/JobBars/UI/Gauge/UIBar.cs +++ b/JobBars/UI/Gauge/UIBar.cs @@ -134,11 +134,11 @@ public UIBar() { TextNode = UIBuilder.CreateTextNode(); TextNode->AtkResNode.X = 14; TextNode->AtkResNode.Y = 5; - TextNode->AtkResNode.Flags |= 0x10; - TextNode->AtkResNode.Flags_2 = 1; + TextNode->AtkResNode.NodeFlags |= (NodeFlags) 0x10; + TextNode->AtkResNode.DrawFlags = 1; TextBlurNode = UIBuilder.CreateNineNode(); - TextBlurNode->AtkResNode.Flags = 8371; + TextBlurNode->AtkResNode.NodeFlags = (NodeFlags) 8371; TextBlurNode->AtkResNode.Width = 47; TextBlurNode->AtkResNode.Height = 40; TextBlurNode->AtkResNode.X = 0; diff --git a/JobBars/UI/Gauge/UIDiamond.cs b/JobBars/UI/Gauge/UIDiamond.cs index 4c37eac6..c8d096b3 100644 --- a/JobBars/UI/Gauge/UIDiamond.cs +++ b/JobBars/UI/Gauge/UIDiamond.cs @@ -99,8 +99,9 @@ public UIDiamond() { text->AtkResNode.Height = 32; text->AtkResNode.Y = 20; text->AtkResNode.X = 0; - text->AtkResNode.Flags |= 0x10; - text->AtkResNode.Flags_2 = 1; + //text->AtkResNode.Flags |= 0x10; + text->AtkResNode.DrawFlags |= 0x10; + //text->AtkResNode.Flags_2 = 1; text->EdgeColor = new FFXIVClientStructs.FFXIV.Client.Graphics.ByteColor { R = 40, G = 40, diff --git a/JobBars/UI/Icon/UIIconBuff.cs b/JobBars/UI/Icon/UIIconBuff.cs index a93cc223..5faf4ba1 100644 --- a/JobBars/UI/Icon/UIIconBuff.cs +++ b/JobBars/UI/Icon/UIIconBuff.cs @@ -24,9 +24,9 @@ public UIIconBuff(uint adjustedId, uint slotId, int hotbarIdx, int slotIdx, AtkC Combo->AtkResNode.X = -2; Combo->AtkResNode.Width = 48; Combo->AtkResNode.Height = 48; - Combo->AtkResNode.Flags = 8243; - Combo->AtkResNode.Flags_2 = 1; - Combo->AtkResNode.Flags_2 |= 4; + Combo->AtkResNode.NodeFlags = (NodeFlags) 8243; + Combo->AtkResNode.DrawFlags = 1; + Combo->AtkResNode.DrawFlags |= 4; Combo->WrapMode = 1; Combo->PartId = 0; Combo->PartsList = originalBorder->PartsList; @@ -35,9 +35,9 @@ public UIIconBuff(uint adjustedId, uint slotId, int hotbarIdx, int slotIdx, AtkC BigText->Ctor(); BigText->AtkResNode.NodeID = NodeIdx++; BigText->AtkResNode.Type = NodeType.Text; - BigText->AtkResNode.Flags = 8243; - BigText->AtkResNode.Flags_2 = 1; - BigText->AtkResNode.Flags_2 |= 4; + BigText->AtkResNode.NodeFlags = (NodeFlags) 8243; + BigText->AtkResNode.DrawFlags = 1; + BigText->AtkResNode.DrawFlags |= 4; RefreshVisuals(); BigText->SetText(""); diff --git a/JobBars/UI/Icon/UIIconTimer.cs b/JobBars/UI/Icon/UIIconTimer.cs index 83e93c5c..01ae9c1d 100644 --- a/JobBars/UI/Icon/UIIconTimer.cs +++ b/JobBars/UI/Icon/UIIconTimer.cs @@ -42,9 +42,9 @@ public UIIconTimer(uint adjustedId, uint slotId, int hotbarIdx, int slotIdx, Atk Combo->AtkResNode.X = 0; Combo->AtkResNode.Width = 48; Combo->AtkResNode.Height = 48; - Combo->AtkResNode.Flags = 8243; - Combo->AtkResNode.Flags_2 = 1; - Combo->AtkResNode.Flags_2 |= 4; + Combo->AtkResNode.NodeFlags = (NodeFlags) 8243; + Combo->AtkResNode.DrawFlags = 1; + Combo->AtkResNode.DrawFlags |= 4; Combo->WrapMode = 1; Combo->PartId = 0; Combo->PartsList = OriginalCombo->PartsList; @@ -61,9 +61,9 @@ public UIIconTimer(uint adjustedId, uint slotId, int hotbarIdx, int slotIdx, Atk Text->Ctor(); Text->AtkResNode.NodeID = NodeIdx++; Text->AtkResNode.Type = NodeType.Text; - Text->AtkResNode.Flags = 8243; - Text->AtkResNode.Flags_2 = 1; - Text->AtkResNode.Flags_2 |= 4; + Text->AtkResNode.NodeFlags = (NodeFlags) 8243; + Text->AtkResNode.DrawFlags = 1; + Text->AtkResNode.DrawFlags |= 4; RefreshVisuals(); Text->SetText(""); @@ -82,9 +82,9 @@ public UIIconTimer(uint adjustedId, uint slotId, int hotbarIdx, int slotIdx, Atk Ring->AtkResNode.Y = 2; Ring->AtkResNode.Width = 44; Ring->AtkResNode.Height = 46; - Ring->AtkResNode.Flags = 8243; - Ring->AtkResNode.Flags_2 = 1; - Ring->AtkResNode.Flags_2 |= 4; + Ring->AtkResNode.NodeFlags = (NodeFlags) 8243; + Ring->AtkResNode.DrawFlags = 1; + Ring->AtkResNode.DrawFlags |= 4; Ring->WrapMode = 1; Ring->PartId = 0; Ring->PartsList = originalRing->PartsList; diff --git a/JobBars/UI/UIColor.cs b/JobBars/UI/UIColor.cs index 6669ff5b..f2d57f49 100644 --- a/JobBars/UI/UIColor.cs +++ b/JobBars/UI/UIColor.cs @@ -46,19 +46,19 @@ public class UIColor { public unsafe static void SetColor(AtkImageNode* node, ElementColor color) => SetColor((AtkResNode*)node, color); public unsafe static void SetColor(AtkResNode* node, ElementColor color) => SetColor(node, color.AddRed, color.AddGreen, color.AddBlue, color.MultiplyRed, color.MultiplyGreen, color.MultiplyBlue); public unsafe static void SetColor(AtkResNode* node, short addRed, short addGreen, short addBlue, byte multRed, byte multGreen, byte multBlue) { - node->AddRed = (ushort)addRed; - node->AddGreen = (ushort)addGreen; - node->AddBlue = (ushort)addBlue; - node->AddRed_2 = (ushort)addRed; - node->AddGreen_2 = (ushort)addGreen; - node->AddBlue_2 = (ushort)addBlue; + node->AddRed = addRed; + node->AddGreen = addGreen; + node->AddBlue = addBlue; + node->AddRed_2 = addRed; + node->AddGreen_2 = addGreen; + node->AddBlue_2 = addBlue; - node->MultiplyRed = multRed; - node->MultiplyGreen = multGreen; - node->MultiplyBlue = multBlue; - node->MultiplyRed_2 = multRed; + node->MultiplyRed = multRed; + node->MultiplyGreen = multGreen; + node->MultiplyBlue = multBlue; + node->MultiplyRed_2 = multRed; node->MultiplyGreen_2 = multGreen; - node->MultiplyBlue_2 = multBlue; + node->MultiplyBlue_2 = multBlue; } public unsafe static void SetColorPulse(AtkResNode* node, ElementColor color, float percent) { // 0 = color