This commit is contained in:
Ottermandias 2023-01-23 12:09:32 +01:00
parent 9c6256bf1b
commit 6e7e6530cf
12 changed files with 360 additions and 203 deletions

View file

@ -1,15 +1,6 @@
using System;
using System.Linq;
using System.Numerics;
using Dalamud.Interface;
using Dalamud.Logging;
using Glamourer.Designs;
using Glamourer.Structs;
using ImGuiNET;
using OtterGui;
using OtterGui.Raii;
namespace Glamourer.Gui.Designs;
namespace Glamourer.Gui;
//internal partial class Interface
//{

View file

@ -91,7 +91,7 @@ public partial class EquipmentDrawer
private CharacterWeapon _lastWeapon = new(ulong.MaxValue);
private string _lastPreview = string.Empty;
private int _lastIndex;
public WeaponCategory LastCategory { get; private set; }
public FullEquipType LastCategory { get; private set; }
private bool _drawAll;
public WeaponCombo(EquipSlot slot)
@ -124,12 +124,12 @@ public partial class EquipmentDrawer
}
UpdateItem(weapon);
UpdateCategory((WeaponCategory?)LastItem!.ItemUICategory?.Row ?? WeaponCategory.Unknown);
UpdateCategory(((WeaponCategory) (LastItem!.ItemUICategory?.Row ?? 0)).ToEquipType());
newIdx = _lastIndex;
return Draw(Label, _lastPreview, ref newIdx, ItemComboWidth * ImGuiHelpers.GlobalScale, ImGui.GetTextLineHeight());
}
public bool Draw(CharacterWeapon weapon, WeaponCategory category, out int newIdx)
public bool Draw(CharacterWeapon weapon, FullEquipType category, out int newIdx)
{
if (_drawAll)
{
@ -166,7 +166,7 @@ public partial class EquipmentDrawer
_lastPreview = _lastIndex >= 0 ? Items[_lastIndex].Name : LastItem.Name.ToString();
}
private void UpdateCategory(WeaponCategory category)
private void UpdateCategory(FullEquipType category)
{
if (category == LastCategory)
return;
@ -225,7 +225,7 @@ public partial class EquipmentDrawer
Glamourer.RedrawManager.LoadWeapon(actor, _currentSlot, mainHand);
}
private void DrawOffHandSelector(ref CharacterWeapon offHand, WeaponCategory category)
private void DrawOffHandSelector(ref CharacterWeapon offHand, FullEquipType category)
{
var change = OffHandCombo.Draw(offHand, category, out var newIdx);
var newWeapon = change ? ToWeapon(OffHandCombo.Items[newIdx], offHand.Stain) : CharacterWeapon.Empty;

View file

@ -100,8 +100,8 @@ public partial class EquipmentDrawer
DrawStainCombo();
ImGui.SameLine();
DrawMainHandSelector(ref mainHand);
var offhand = MainHandCombo.LastCategory.AllowsOffHand();
if (offhand != WeaponCategory.Unknown)
var offhand = MainHandCombo.LastCategory.Offhand();
if (offhand != FullEquipType.Unknown)
{
_currentSlot = EquipSlot.OffHand;
DrawStainCombo();
@ -128,8 +128,8 @@ public partial class EquipmentDrawer
DrawStainCombo();
ImGui.SameLine();
DrawMainHandSelector(ref mainHand);
var offhand = MainHandCombo.LastCategory.AllowsOffHand();
if (offhand != WeaponCategory.Unknown)
var offhand = MainHandCombo.LastCategory.Offhand();
if (offhand != FullEquipType.Unknown)
{
_currentSlot = EquipSlot.OffHand;
DrawCheckbox(ref flags);