make shit compile.

This commit is contained in:
Ottermandias 2023-06-02 18:48:22 +02:00
parent 10631341cb
commit 4eb46a9fff
14 changed files with 56 additions and 63 deletions

View file

@ -20,13 +20,10 @@ public partial class CustomizationDrawer : IDisposable
private bool _withFlags = false;
private Exception? _terminate = null;
private readonly unsafe CustomizeData* _data;
private Customize _customize;
private CustomizationSet _set = null!;
public unsafe CustomizeData CustomizeData
=> *_data;
public Customize Customize;
public CustomizeFlag CurrentFlag { get; private set; }
public CustomizeFlag Changed { get; private set; }
@ -49,21 +46,12 @@ public partial class CustomizationDrawer : IDisposable
_service = service;
_items = items;
_legacyTattoo = GetLegacyTattooIcon(pi);
unsafe
{
_data = (CustomizeData*)Marshal.AllocHGlobal(sizeof(CustomizeData));
*_data = Customize.Default;
_customize = new Customize(_data);
}
Customize = Customize.Default;
}
public void Dispose()
{
_legacyTattoo?.Dispose();
unsafe
{
Marshal.FreeHGlobal((nint)_data);
}
}
public bool Draw(Customize current, bool locked)

View file

@ -72,8 +72,8 @@ public partial class Interface
_currentSave.Initialize(_items, _currentData.Objects[0]);
RevertButton();
if (_main._customizationDrawer.Draw(_currentSave.Customize, _identifier.Type == IdentifierType.Special))
_activeDesigns.ChangeCustomize(_currentSave, _main._customizationDrawer.Changed, _main._customizationDrawer.CustomizeData,
if (_main._customizationDrawer.Draw(_currentSave.ModelData.Customize, _identifier.Type == IdentifierType.Special))
_activeDesigns.ChangeCustomize(_currentSave, _main._customizationDrawer.Changed, _main._customizationDrawer.Customize.Data,
false);
foreach (var slot in EquipSlotExtensions.EqdpSlots)
@ -82,8 +82,8 @@ public partial class Interface
if (_main._equipmentDrawer.DrawStain(current.Stain, slot, out var stain))
_activeDesigns.ChangeStain(_currentSave, slot, stain.RowIndex, false);
ImGui.SameLine();
if (_main._equipmentDrawer.DrawArmor(current, slot, out var armor, _currentSave.Customize.Gender,
_currentSave.Customize.Race))
if (_main._equipmentDrawer.DrawArmor(current, slot, out var armor, _currentSave.ModelData.Customize.Gender,
_currentSave.ModelData.Customize.Race))
_activeDesigns.ChangeEquipment(_currentSave, slot, armor, false);
}

View file

@ -79,7 +79,7 @@ public partial class Interface
if (!child)
return;
_main._customizationDrawer.Draw(Selector.Selected.Customize, CustomizeFlagExtensions.All, true);
_main._customizationDrawer.Draw(Selector.Selected.ModelData.Customize, CustomizeFlagExtensions.All, true);
foreach (var slot in EquipSlotExtensions.EqdpSlots)
{
var current = Selector.Selected.Armor(slot);