From a310e012968fcf50f57b6fdc80010c1759c5cedb Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Tue, 11 Jul 2023 16:21:25 +0200 Subject: [PATCH] Fix offhand handling. --- Glamourer/Gui/Equipment/EquipmentDrawer.cs | 8 +++----- Glamourer/Gui/Tabs/ActorTab/ActorPanel.cs | 2 +- Glamourer/Gui/Tabs/DesignTab/DesignPanel.cs | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Glamourer/Gui/Equipment/EquipmentDrawer.cs b/Glamourer/Gui/Equipment/EquipmentDrawer.cs index 007a72f..e5b8a1d 100644 --- a/Glamourer/Gui/Equipment/EquipmentDrawer.cs +++ b/Glamourer/Gui/Equipment/EquipmentDrawer.cs @@ -190,7 +190,9 @@ public class EquipmentDrawer return false; var change = combo.Draw(weapon.Name, weapon.ItemId, 320 * ImGuiHelpers.GlobalScale); - if (!offType.IsOffhandType() && weapon.ModelId.Value != 0) + if (change) + weapon = combo.CurrentSelection; + else if (!offType.IsOffhandType() && weapon.ModelId.Value != 0) { ImGuiUtil.HoverTooltip("Right-click to clear."); if (ImGui.IsItemClicked(ImGuiMouseButton.Right)) @@ -199,10 +201,6 @@ public class EquipmentDrawer weapon = ItemManager.NothingItem(offType); } } - else if (change) - { - weapon = combo.CurrentSelection; - } return change; } diff --git a/Glamourer/Gui/Tabs/ActorTab/ActorPanel.cs b/Glamourer/Gui/Tabs/ActorTab/ActorPanel.cs index b15d14c..9ea5cb1 100644 --- a/Glamourer/Gui/Tabs/ActorTab/ActorPanel.cs +++ b/Glamourer/Gui/Tabs/ActorTab/ActorPanel.cs @@ -159,7 +159,7 @@ public class ActorPanel ImGui.SameLine(); var oh = _state.ModelData.Item(EquipSlot.OffHand); - if (_equipmentDrawer.DrawMainhand(oh, false, out var newOh)) + if (_equipmentDrawer.DrawOffhand(oh, newMh.Type, out var newOh)) _stateManager.ChangeEquip(_state, EquipSlot.OffHand, newOh, newOhStain, StateChanged.Source.Manual); } } diff --git a/Glamourer/Gui/Tabs/DesignTab/DesignPanel.cs b/Glamourer/Gui/Tabs/DesignTab/DesignPanel.cs index 4b2a4ce..58ceac1 100644 --- a/Glamourer/Gui/Tabs/DesignTab/DesignPanel.cs +++ b/Glamourer/Gui/Tabs/DesignTab/DesignPanel.cs @@ -157,7 +157,7 @@ public class DesignPanel ImGui.SameLine(); var oh = _selector.Selected!.DesignData.Item(EquipSlot.OffHand); - if (_equipmentDrawer.DrawMainhand(oh, false, out var newOh)) + if (_equipmentDrawer.DrawOffhand(oh, newMh.Type, out var newOh)) _manager.ChangeWeapon(_selector.Selected!, EquipSlot.OffHand, newOh); } }