From 87d668411b52bdf9824eca79477f34a88e345574 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Mon, 31 Jul 2023 18:27:13 +0200 Subject: [PATCH] Model Id stuff. --- Glamourer/Gui/Tabs/ActorTab/ActorPanel.cs | 9 ++++----- Glamourer/State/StateManager.cs | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Glamourer/Gui/Tabs/ActorTab/ActorPanel.cs b/Glamourer/Gui/Tabs/ActorTab/ActorPanel.cs index f42b9b3..632d7f3 100644 --- a/Glamourer/Gui/Tabs/ActorTab/ActorPanel.cs +++ b/Glamourer/Gui/Tabs/ActorTab/ActorPanel.cs @@ -3,7 +3,6 @@ using System.Numerics; using Dalamud.Interface; using Dalamud.Interface.Internal.Notifications; using FFXIVClientStructs.FFXIV.Client.Game; -using FFXIVClientStructs.FFXIV.Client.UI; using Glamourer.Automation; using Glamourer.Customization; using Glamourer.Designs; @@ -270,7 +269,7 @@ public class ActorPanel Description = "Copy the current design to your clipboard.", Icon = FontAwesomeIcon.Copy, OnClick = ExportToClipboard, - Visible = _state?.ModelData.IsHuman ?? false, + Visible = _state?.ModelData.ModelId == 0, }; private HeaderDrawer.Button SaveAsDesignButton() @@ -279,7 +278,7 @@ public class ActorPanel Description = "Save the current state as a design.", Icon = FontAwesomeIcon.Save, OnClick = SaveDesignOpen, - Visible = _state?.ModelData.IsHuman ?? false, + Visible = _state?.ModelData.ModelId == 0, }; private HeaderDrawer.Button LockedButton() @@ -369,7 +368,7 @@ public class ActorPanel { var (id, data) = _objects.PlayerData; if (!ImGuiUtil.DrawDisabledButton("Apply to Yourself", Vector2.Zero, "Apply the current state to your own character.", - !data.Valid || id == _identifier || !_state!.ModelData.IsHuman)) + !data.Valid || id == _identifier || _state!.ModelData.ModelId != 0)) return; if (_stateManager.GetOrCreate(id, data.Objects[0], out var state)) @@ -386,7 +385,7 @@ public class ActorPanel : "The current target can not be manipulated." : "No valid target selected."; if (!ImGuiUtil.DrawDisabledButton("Apply to Target", Vector2.Zero, tt, - !data.Valid || id == _identifier || !_state!.ModelData.IsHuman || _objects.IsInGPose)) + !data.Valid || id == _identifier || _state!.ModelData.ModelId != 0 || _objects.IsInGPose)) return; if (_stateManager.GetOrCreate(id, data.Objects[0], out var state)) diff --git a/Glamourer/State/StateManager.cs b/Glamourer/State/StateManager.cs index 5ed6e97..998b789 100644 --- a/Glamourer/State/StateManager.cs +++ b/Glamourer/State/StateManager.cs @@ -113,7 +113,7 @@ public class StateManager : IReadOnlyDictionary // Model ID is only unambiguously contained in the game object. // The draw object only has the object type. // TODO reverse search model data to get model id from model. - if (!_humans.IsHuman(ret.ModelId)) + if (!_humans.IsHuman((uint)actor.AsCharacter->CharacterData.ModelCharaId)) { ret.LoadNonHuman((uint)actor.AsCharacter->CharacterData.ModelCharaId, *(Customize*)&actor.AsCharacter->DrawData.CustomizeData, (nint)(&actor.AsCharacter->DrawData.Head));