From fcca756e20024318ddcbb34a8647591f968a9ca1 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Sun, 24 Dec 2023 14:37:36 +0100 Subject: [PATCH] Allow change of bodytype. --- .../CustomizationDrawer.GenderRace.cs | 16 +++++++++++++++- .../Gui/Customization/CustomizationDrawer.cs | 2 ++ Glamourer/Services/CustomizeService.cs | 10 ++++++++++ Penumbra.GameData | 2 +- 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Glamourer/Gui/Customization/CustomizationDrawer.GenderRace.cs b/Glamourer/Gui/Customization/CustomizationDrawer.GenderRace.cs index 097d99b..4b9fab7 100644 --- a/Glamourer/Gui/Customization/CustomizationDrawer.GenderRace.cs +++ b/Glamourer/Gui/Customization/CustomizationDrawer.GenderRace.cs @@ -1,11 +1,12 @@ using System; using System.Linq; +using System.Numerics; using Dalamud.Interface; -using Glamourer.GameData; using ImGuiNET; using OtterGui; using OtterGui.Raii; using Penumbra.GameData.Enums; +using Penumbra.GameData.Structs; namespace Glamourer.Gui.Customization; @@ -75,4 +76,17 @@ public partial class CustomizationDrawer if (_lockedRedraw && ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) ImGui.SetTooltip("The race can not be changed as this requires a redraw of the character, which is not supported for this actor."); } + + private void DrawBodyType() + { + if (_customize.BodyType.Value == 1) + return; + + if (!ImGuiUtil.DrawDisabledButton($"Reset Body Type {_customize.BodyType.Value} to Default", + new Vector2(_raceSelectorWidth + _framedIconSize.X + ImGui.GetStyle().ItemSpacing.X, 0), string.Empty, _lockedRedraw)) + return; + + Changed |= CustomizeFlag.BodyType; + _customize.BodyType = (CustomizeValue)1; + } } diff --git a/Glamourer/Gui/Customization/CustomizationDrawer.cs b/Glamourer/Gui/Customization/CustomizationDrawer.cs index 90cf5c2..a56040d 100644 --- a/Glamourer/Gui/Customization/CustomizationDrawer.cs +++ b/Glamourer/Gui/Customization/CustomizationDrawer.cs @@ -117,6 +117,8 @@ public partial class CustomizationDrawer(DalamudPluginInterface pi, CustomizeSer return DrawArtisan(); DrawRaceGenderSelector(); + DrawBodyType(); + _set = _service.Manager.GetSet(_customize.Clan, _customize.Gender); foreach (var id in _set.Order[CharaMakeParams.MenuType.Percentage]) diff --git a/Glamourer/Services/CustomizeService.cs b/Glamourer/Services/CustomizeService.cs index 6eeb9db..0b094f3 100644 --- a/Glamourer/Services/CustomizeService.cs +++ b/Glamourer/Services/CustomizeService.cs @@ -44,6 +44,16 @@ public sealed class CustomizeService( applied |= CustomizeFlag.Gender; } + if (applyWhich.HasFlag(CustomizeFlag.BodyType)) + { + if (oldValues[CustomizeIndex.BodyType] != newValues[CustomizeIndex.BodyType]) + { + ret.Set(CustomizeIndex.BodyType, newValues[CustomizeIndex.BodyType]); + changed |= CustomizeFlag.BodyType; + } + + applied |= CustomizeFlag.BodyType; + } var set = Manager.GetSet(ret.Clan, ret.Gender); applyWhich = applyWhich.FixApplication(set); diff --git a/Penumbra.GameData b/Penumbra.GameData index 3073db1..c1c9fb6 160000 --- a/Penumbra.GameData +++ b/Penumbra.GameData @@ -1 +1 @@ -Subproject commit 3073db1fc8a1894a4af8974ea9c22a63acd7316e +Subproject commit c1c9fb6d83be8b05dfb3f35031c05781daad1fc7