mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-15 05:04:16 +01:00
Store Model ID for NPCs, fix issue with applying NPC data setting extended colors.
This commit is contained in:
parent
a50b63f67e
commit
c87885bd3b
4 changed files with 20 additions and 4 deletions
|
|
@ -72,6 +72,7 @@ public class NpcCustomizeSet : IAsyncDataContainer, IReadOnlyList<NpcData>
|
||||||
{
|
{
|
||||||
Name = name,
|
Name = name,
|
||||||
Customize = customize,
|
Customize = customize,
|
||||||
|
ModelId = row.ModelChara.Row,
|
||||||
Id = id,
|
Id = id,
|
||||||
Kind = ObjectKind.EventNpc,
|
Kind = ObjectKind.EventNpc,
|
||||||
};
|
};
|
||||||
|
|
@ -132,6 +133,7 @@ public class NpcCustomizeSet : IAsyncDataContainer, IReadOnlyList<NpcData>
|
||||||
var ret = new NpcData
|
var ret = new NpcData
|
||||||
{
|
{
|
||||||
Customize = customize,
|
Customize = customize,
|
||||||
|
ModelId = baseRow.ModelChara.Row,
|
||||||
Id = baseRow.RowId,
|
Id = baseRow.RowId,
|
||||||
Kind = ObjectKind.BattleNpc,
|
Kind = ObjectKind.BattleNpc,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,9 @@ public unsafe struct NpcData
|
||||||
/// <summary> The data ID of the NPC, either event NPC or battle NPC name. </summary>
|
/// <summary> The data ID of the NPC, either event NPC or battle NPC name. </summary>
|
||||||
public NpcId Id;
|
public NpcId Id;
|
||||||
|
|
||||||
|
/// <summary> The Model ID of the NPC. </summary>
|
||||||
|
public uint ModelId;
|
||||||
|
|
||||||
/// <summary> Whether the NPCs visor is toggled. </summary>
|
/// <summary> Whether the NPCs visor is toggled. </summary>
|
||||||
public bool VisorToggled;
|
public bool VisorToggled;
|
||||||
|
|
||||||
|
|
@ -87,6 +90,9 @@ public unsafe struct NpcData
|
||||||
/// <summary> Check if the appearance data, excluding ID and Name, of two NpcData is equal. </summary>
|
/// <summary> Check if the appearance data, excluding ID and Name, of two NpcData is equal. </summary>
|
||||||
public bool DataEquals(in NpcData other)
|
public bool DataEquals(in NpcData other)
|
||||||
{
|
{
|
||||||
|
if (ModelId != other.ModelId)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (VisorToggled != other.VisorToggled)
|
if (VisorToggled != other.VisorToggled)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ public class NpcAppearancePanel(NpcCombo _npcCombo, StateManager _state, ObjectM
|
||||||
ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X);
|
ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X);
|
||||||
var resetScroll = ImGui.InputTextWithHint("##npcFilter", "Filter...", ref _npcFilter, 64);
|
var resetScroll = ImGui.InputTextWithHint("##npcFilter", "Filter...", ref _npcFilter, 64);
|
||||||
|
|
||||||
using var table = ImRaii.Table("npcs", 6, ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollY | ImGuiTableFlags.SizingFixedFit,
|
using var table = ImRaii.Table("npcs", 7, ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollY | ImGuiTableFlags.SizingFixedFit,
|
||||||
new Vector2(-1, 400 * ImGuiHelpers.GlobalScale));
|
new Vector2(-1, 400 * ImGuiHelpers.GlobalScale));
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
@ -45,6 +45,7 @@ public class NpcAppearancePanel(NpcCombo _npcCombo, StateManager _state, ObjectM
|
||||||
ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.WidthFixed, ImGuiHelpers.GlobalScale * 300);
|
ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.WidthFixed, ImGuiHelpers.GlobalScale * 300);
|
||||||
ImGui.TableSetupColumn("Kind", ImGuiTableColumnFlags.WidthFixed);
|
ImGui.TableSetupColumn("Kind", ImGuiTableColumnFlags.WidthFixed);
|
||||||
ImGui.TableSetupColumn("Id", ImGuiTableColumnFlags.WidthFixed);
|
ImGui.TableSetupColumn("Id", ImGuiTableColumnFlags.WidthFixed);
|
||||||
|
ImGui.TableSetupColumn("Model", ImGuiTableColumnFlags.WidthFixed);
|
||||||
ImGui.TableSetupColumn("Visor", ImGuiTableColumnFlags.WidthFixed);
|
ImGui.TableSetupColumn("Visor", ImGuiTableColumnFlags.WidthFixed);
|
||||||
ImGui.TableSetupColumn("Compare", ImGuiTableColumnFlags.WidthStretch);
|
ImGui.TableSetupColumn("Compare", ImGuiTableColumnFlags.WidthStretch);
|
||||||
|
|
||||||
|
|
@ -83,6 +84,10 @@ public class NpcAppearancePanel(NpcCombo _npcCombo, StateManager _state, ObjectM
|
||||||
ImGui.AlignTextToFramePadding();
|
ImGui.AlignTextToFramePadding();
|
||||||
ImGui.TextUnformatted(data.Id.Id.ToString());
|
ImGui.TextUnformatted(data.Id.Id.ToString());
|
||||||
|
|
||||||
|
ImGui.TableNextColumn();
|
||||||
|
ImGui.AlignTextToFramePadding();
|
||||||
|
ImGui.TextUnformatted(data.ModelId.ToString());
|
||||||
|
|
||||||
using (_ = ImRaii.PushFont(UiBuilder.IconFont))
|
using (_ = ImRaii.PushFont(UiBuilder.IconFont))
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,10 @@ public class NpcPanel(
|
||||||
|
|
||||||
private void DrawCustomization()
|
private void DrawCustomization()
|
||||||
{
|
{
|
||||||
using var h = ImRaii.CollapsingHeader("Customization");
|
var header = _selector.Selection.ModelId == 0
|
||||||
|
? "Customization"
|
||||||
|
: $"Customization (Model Id #{_selector.Selection.ModelId})###Customization";
|
||||||
|
using var h = ImRaii.CollapsingHeader(header);
|
||||||
if (!h)
|
if (!h)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -197,8 +200,8 @@ public class NpcPanel(
|
||||||
|
|
||||||
if (_state.GetOrCreate(id, data.Objects[0], out var state))
|
if (_state.GetOrCreate(id, data.Objects[0], out var state))
|
||||||
{
|
{
|
||||||
var (applyGear, applyCustomize, applyCrest, applyParameters) = UiHelpers.ConvertKeysToFlags();
|
var (applyGear, applyCustomize, _, _) = UiHelpers.ConvertKeysToFlags();
|
||||||
var design = _converter.Convert(ToDesignData(), applyGear, applyCustomize, applyCrest, applyParameters);
|
var design = _converter.Convert(ToDesignData(), applyGear, applyCustomize, 0, 0);
|
||||||
_state.ApplyDesign(design, state, StateChanged.Source.Manual);
|
_state.ApplyDesign(design, state, StateChanged.Source.Manual);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue