mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 18:27:24 +01:00
Make some stuff work.
This commit is contained in:
parent
4eb46a9fff
commit
e79ee55f3b
8 changed files with 69 additions and 12 deletions
|
|
@ -61,7 +61,12 @@ public unsafe struct Customize
|
||||||
|
|
||||||
private static Customize GenerateDefault()
|
private static Customize GenerateDefault()
|
||||||
{
|
{
|
||||||
var ret = new Customize();
|
var ret = new Customize
|
||||||
|
{
|
||||||
|
Race = Race.Hyur,
|
||||||
|
Clan = SubRace.Midlander,
|
||||||
|
Gender = Gender.Male,
|
||||||
|
};
|
||||||
ret.Set(CustomizeIndex.BodyType, (CustomizeValue)1);
|
ret.Set(CustomizeIndex.BodyType, (CustomizeValue)1);
|
||||||
ret.Set(CustomizeIndex.Height, (CustomizeValue)50);
|
ret.Set(CustomizeIndex.Height, (CustomizeValue)50);
|
||||||
ret.Set(CustomizeIndex.Face, (CustomizeValue)1);
|
ret.Set(CustomizeIndex.Face, (CustomizeValue)1);
|
||||||
|
|
|
||||||
|
|
@ -247,7 +247,7 @@ public partial class Design : DesignData, ISavable
|
||||||
if (json == null)
|
if (json == null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
var customize = design.ModelData.Customize;
|
ref var customize = ref design.ModelData.Customize;
|
||||||
foreach (var idx in Enum.GetValues<CustomizeIndex>())
|
foreach (var idx in Enum.GetValues<CustomizeIndex>())
|
||||||
{
|
{
|
||||||
var tok = json[idx.ToString()];
|
var tok = json[idx.ToString()];
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ public struct ModelData
|
||||||
public ModelData(CharacterWeapon mainHand)
|
public ModelData(CharacterWeapon mainHand)
|
||||||
=> MainHand = mainHand;
|
=> MainHand = mainHand;
|
||||||
|
|
||||||
public CharacterArmor Armor(EquipSlot slot)
|
public readonly CharacterArmor Armor(EquipSlot slot)
|
||||||
=> slot switch
|
=> slot switch
|
||||||
{
|
{
|
||||||
EquipSlot.MainHand => MainHand.ToArmor(),
|
EquipSlot.MainHand => MainHand.ToArmor(),
|
||||||
|
|
@ -72,7 +72,7 @@ public struct ModelData
|
||||||
_ => CharacterArmor.Empty,
|
_ => CharacterArmor.Empty,
|
||||||
};
|
};
|
||||||
|
|
||||||
public CharacterWeapon Piece(EquipSlot slot)
|
public readonly CharacterWeapon Piece(EquipSlot slot)
|
||||||
=> slot switch
|
=> slot switch
|
||||||
{
|
{
|
||||||
EquipSlot.MainHand => MainHand,
|
EquipSlot.MainHand => MainHand,
|
||||||
|
|
|
||||||
57
Glamourer/Gui/ActorDebug.cs
Normal file
57
Glamourer/Gui/ActorDebug.cs
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
using Glamourer.Designs;
|
||||||
|
using ImGuiNET;
|
||||||
|
using OtterGui;
|
||||||
|
using OtterGui.Raii;
|
||||||
|
using Penumbra.GameData.Enums;
|
||||||
|
|
||||||
|
namespace Glamourer.Gui;
|
||||||
|
|
||||||
|
public static class ActorDebug
|
||||||
|
{
|
||||||
|
/// <summary> Draw the model data values as straight table data without evaluation. </summary>
|
||||||
|
public static unsafe void Draw(in ModelData model)
|
||||||
|
{
|
||||||
|
using var table = ImRaii.Table("##drawObjectData", 3, ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.RowBg);
|
||||||
|
if (!table)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ImGuiUtil.DrawTableColumn("Model ID");
|
||||||
|
ImGuiUtil.DrawTableColumn(model.ModelId.ToString());
|
||||||
|
ImGuiUtil.DrawTableColumn(model.ModelId.ToString("X8"));
|
||||||
|
|
||||||
|
for (var i = 0; i < Penumbra.GameData.Structs.CustomizeData.Size; ++i)
|
||||||
|
{
|
||||||
|
ImGuiUtil.DrawTableColumn($"Customize[{i:D2}]");
|
||||||
|
ImGuiUtil.DrawTableColumn(model.Customize.Data.Data[i].ToString());
|
||||||
|
ImGuiUtil.DrawTableColumn(model.Customize.Data.Data[i].ToString("X2"));
|
||||||
|
}
|
||||||
|
ImGuiUtil.DrawTableColumn("Race");
|
||||||
|
ImGuiUtil.DrawTableColumn(model.Customize.Race.ToString());
|
||||||
|
ImGui.TableNextColumn();
|
||||||
|
|
||||||
|
ImGuiUtil.DrawTableColumn("Clan");
|
||||||
|
ImGuiUtil.DrawTableColumn(model.Customize.Clan.ToString());
|
||||||
|
ImGui.TableNextColumn();
|
||||||
|
|
||||||
|
ImGuiUtil.DrawTableColumn("Gender");
|
||||||
|
ImGuiUtil.DrawTableColumn(model.Customize.Gender.ToString());
|
||||||
|
ImGui.TableNextColumn();
|
||||||
|
|
||||||
|
for (var i = 0; i < 10; ++i)
|
||||||
|
{
|
||||||
|
var slot = EquipSlotExtensions.EqdpSlots[i];
|
||||||
|
ImGuiUtil.DrawTableColumn($"Equipment[{i}] ({slot})");
|
||||||
|
var armor = model.Armor(slot);
|
||||||
|
ImGuiUtil.DrawTableColumn($"{armor.Set.Value}, {armor.Variant}, {armor.Stain.Value}");
|
||||||
|
ImGuiUtil.DrawTableColumn(armor.Value.ToString("X8"));
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGuiUtil.DrawTableColumn("Mainhand");
|
||||||
|
ImGuiUtil.DrawTableColumn($"{model.MainHand.Set.Value}, {model.MainHand.Type.Value}, {model.MainHand.Variant}, {model.MainHand.Stain.Value}");
|
||||||
|
ImGuiUtil.DrawTableColumn(model.MainHand.Value.ToString("X16"));
|
||||||
|
|
||||||
|
ImGuiUtil.DrawTableColumn("Offhand");
|
||||||
|
ImGuiUtil.DrawTableColumn($"{model.OffHand.Set.Value}, {model.OffHand.Type.Value}, {model.OffHand.Variant}, {model.OffHand.Stain.Value}");
|
||||||
|
ImGuiUtil.DrawTableColumn(model.OffHand.Value.ToString("X16"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,14 +1,12 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using Glamourer.Customization;
|
using Glamourer.Customization;
|
||||||
using Glamourer.Services;
|
using Glamourer.Services;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using CustomizeData = Penumbra.GameData.Structs.CustomizeData;
|
|
||||||
|
|
||||||
namespace Glamourer.Gui.Customization;
|
namespace Glamourer.Gui.Customization;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,8 @@ public partial class Interface
|
||||||
_currentSave.Initialize(_items, _currentData.Objects[0]);
|
_currentSave.Initialize(_items, _currentData.Objects[0]);
|
||||||
|
|
||||||
RevertButton();
|
RevertButton();
|
||||||
|
ActorDebug.Draw(_currentSave.ModelData);
|
||||||
|
return;
|
||||||
if (_main._customizationDrawer.Draw(_currentSave.ModelData.Customize, _identifier.Type == IdentifierType.Special))
|
if (_main._customizationDrawer.Draw(_currentSave.ModelData.Customize, _identifier.Type == IdentifierType.Special))
|
||||||
_activeDesigns.ChangeCustomize(_currentSave, _main._customizationDrawer.Changed, _main._customizationDrawer.Customize.Data,
|
_activeDesigns.ChangeCustomize(_currentSave, _main._customizationDrawer.Changed, _main._customizationDrawer.Customize.Data,
|
||||||
false);
|
false);
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,12 @@
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using Dalamud.Game.ClientState.Keys;
|
using Dalamud.Game.ClientState.Keys;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using FFXIVClientStructs.FFXIV.Client.Game.InstanceContent;
|
|
||||||
using Glamourer.Customization;
|
using Glamourer.Customization;
|
||||||
using Glamourer.Designs;
|
using Glamourer.Designs;
|
||||||
using Glamourer.Gui.Designs;
|
using Glamourer.Gui.Designs;
|
||||||
using Glamourer.Interop;
|
using Glamourer.Interop;
|
||||||
using Glamourer.Services;
|
|
||||||
using Glamourer.State;
|
using Glamourer.State;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
using Microsoft.VisualBasic;
|
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using Penumbra.GameData.Enums;
|
using Penumbra.GameData.Enums;
|
||||||
|
|
@ -72,13 +69,13 @@ public partial class Interface
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var group = ImRaii.Group();
|
using var group = ImRaii.Group();
|
||||||
|
|
||||||
ApplySelfButton();
|
ApplySelfButton();
|
||||||
|
|
||||||
using var child = ImRaii.Child("##DesignPanel", new Vector2(-0.001f), true, ImGuiWindowFlags.HorizontalScrollbar);
|
using var child = ImRaii.Child("##DesignPanel", new Vector2(-0.001f), true, ImGuiWindowFlags.HorizontalScrollbar);
|
||||||
if (!child)
|
if (!child)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
ActorDebug.Draw(Selector.Selected.ModelData);
|
||||||
_main._customizationDrawer.Draw(Selector.Selected.ModelData.Customize, CustomizeFlagExtensions.All, true);
|
_main._customizationDrawer.Draw(Selector.Selected.ModelData.Customize, CustomizeFlagExtensions.All, true);
|
||||||
foreach (var slot in EquipSlotExtensions.EqdpSlots)
|
foreach (var slot in EquipSlotExtensions.EqdpSlots)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ using Glamourer.Interop;
|
||||||
using Penumbra.GameData.Actors;
|
using Penumbra.GameData.Actors;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Linq;
|
|
||||||
using FFXIVClientStructs.FFXIV.Client.Game.Object;
|
using FFXIVClientStructs.FFXIV.Client.Game.Object;
|
||||||
using Glamourer.Api;
|
using Glamourer.Api;
|
||||||
using Glamourer.Customization;
|
using Glamourer.Customization;
|
||||||
|
|
@ -14,7 +13,6 @@ using Penumbra.Api.Enums;
|
||||||
using Penumbra.GameData.Enums;
|
using Penumbra.GameData.Enums;
|
||||||
using Penumbra.GameData.Structs;
|
using Penumbra.GameData.Structs;
|
||||||
using CustomizeData = Penumbra.GameData.Structs.CustomizeData;
|
using CustomizeData = Penumbra.GameData.Structs.CustomizeData;
|
||||||
using Object = FFXIVClientStructs.FFXIV.Client.Graphics.Scene.Object;
|
|
||||||
|
|
||||||
namespace Glamourer.State;
|
namespace Glamourer.State;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue