diff --git a/Glamourer/Gui/Tabs/ActorTab/ActorPanel.cs b/Glamourer/Gui/Tabs/ActorTab/ActorPanel.cs index d00cf39..f42b9b3 100644 --- a/Glamourer/Gui/Tabs/ActorTab/ActorPanel.cs +++ b/Glamourer/Gui/Tabs/ActorTab/ActorPanel.cs @@ -124,7 +124,10 @@ public class ActorPanel private void DrawCustomizationsHeader() { - if (!ImGui.CollapsingHeader("Customization")) + var header = _state!.ModelData.ModelId == 0 + ? "Customization" + : $"Customization (Model Id #{_state.ModelData.ModelId})###Customization"; + if (!ImGui.CollapsingHeader(header)) return; if (_customizationDrawer.Draw(_state!.ModelData.Customize, _state.IsLocked, _identifier.Type is IdentifierType.Special)) diff --git a/Glamourer/Gui/Tabs/DesignTab/DesignPanel.cs b/Glamourer/Gui/Tabs/DesignTab/DesignPanel.cs index 5307c73..880489b 100644 --- a/Glamourer/Gui/Tabs/DesignTab/DesignPanel.cs +++ b/Glamourer/Gui/Tabs/DesignTab/DesignPanel.cs @@ -167,7 +167,10 @@ public class DesignPanel private void DrawCustomize() { - if (!ImGui.CollapsingHeader("Customization")) + var header = _selector.Selected!.DesignData.ModelId == 0 + ? "Customization" + : $"Customization (Model Id #{_selector.Selected!.DesignData.ModelId})###Customization"; + if (!ImGui.CollapsingHeader(header)) return; if (_customizationDrawer.Draw(_selector.Selected!.DesignData.Customize, _selector.Selected.ApplyCustomize, diff --git a/Glamourer/State/StateManager.cs b/Glamourer/State/StateManager.cs index 7dac2f9..5ed6e97 100644 --- a/Glamourer/State/StateManager.cs +++ b/Glamourer/State/StateManager.cs @@ -113,13 +113,16 @@ 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((uint)actor.AsCharacter->CharacterData.ModelCharaId)) + if (!_humans.IsHuman(ret.ModelId)) { ret.LoadNonHuman((uint)actor.AsCharacter->CharacterData.ModelCharaId, *(Customize*)&actor.AsCharacter->DrawData.CustomizeData, (nint)(&actor.AsCharacter->DrawData.Head)); return ret; } + ret.ModelId = (uint)actor.AsCharacter->CharacterData.ModelCharaId; + ret.IsHuman = true; + CharacterWeapon main; CharacterWeapon off; @@ -273,7 +276,8 @@ public class StateManager : IReadOnlyDictionary var type = slot.ToIndex() < 10 ? StateChanged.Type.Equip : StateChanged.Type.Weapon; var actors = type is StateChanged.Type.Equip ? _applier.ChangeArmor(state, slot, source is StateChanged.Source.Manual or StateChanged.Source.Ipc) - : _applier.ChangeWeapon(state, slot, source is StateChanged.Source.Manual or StateChanged.Source.Ipc, item.Type != (slot is EquipSlot.MainHand ? state.BaseData.MainhandType : state.BaseData.OffhandType)); + : _applier.ChangeWeapon(state, slot, source is StateChanged.Source.Manual or StateChanged.Source.Ipc, + item.Type != (slot is EquipSlot.MainHand ? state.BaseData.MainhandType : state.BaseData.OffhandType)); Glamourer.Log.Verbose( $"Set {slot.ToName()} in state {state.Identifier.Incognito(null)} from {old.Name} ({old.ItemId}) to {item.Name} ({item.ItemId}) and its stain from {oldStain.Id} to {stain.Id}. [Affecting {actors.ToLazyString("nothing")}.]"); _event.Invoke(type, source, state, actors, (old, item, slot));