mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 10:17:23 +01:00
Some more changes.
This commit is contained in:
parent
7b6e037e5f
commit
c06f617e04
5 changed files with 40 additions and 7 deletions
|
|
@ -69,7 +69,7 @@ public class DesignBase
|
|||
private CustomizeFlag _applyCustomize = CustomizeFlagExtensions.AllRelevant;
|
||||
public CustomizeSet CustomizeSet { get; private set; }
|
||||
|
||||
public CustomizeParameterFlag ApplyParameters { get; private set; }
|
||||
public CustomizeParameterFlag ApplyParameters { get; internal set; }
|
||||
|
||||
internal CustomizeFlag ApplyCustomize
|
||||
{
|
||||
|
|
|
|||
|
|
@ -50,9 +50,10 @@ public class DesignConverter(ItemManager _items, DesignManager _designs, Customi
|
|||
public DesignBase Convert(in DesignData data, EquipFlag equipFlags, CustomizeFlag customizeFlags, CrestFlag crestFlags, CustomizeParameterFlag parameterFlags)
|
||||
{
|
||||
var design = _designs.CreateTemporary();
|
||||
design.ApplyEquip = equipFlags & EquipFlagExtensions.All;
|
||||
design.ApplyCustomize = customizeFlags & CustomizeFlagExtensions.AllRelevant;
|
||||
design.ApplyCrest = crestFlags & CrestExtensions.All;
|
||||
design.ApplyEquip = equipFlags & EquipFlagExtensions.All;
|
||||
design.ApplyCustomize = customizeFlags & CustomizeFlagExtensions.AllRelevant;
|
||||
design.ApplyCrest = crestFlags & CrestExtensions.All;
|
||||
design.ApplyParameters = parameterFlags & CustomizeParameterExtensions.All;
|
||||
design.SetApplyHatVisible(design.DoApplyEquip(EquipSlot.Head));
|
||||
design.SetApplyVisorToggle(design.DoApplyEquip(EquipSlot.Head));
|
||||
design.SetApplyWeaponVisible(design.DoApplyEquip(EquipSlot.MainHand) || design.DoApplyEquip(EquipSlot.OffHand));
|
||||
|
|
|
|||
|
|
@ -44,4 +44,24 @@ public static class CustomizeParameterExtensions
|
|||
|
||||
public static int ToInternalIndex(this CustomizeParameterFlag flag)
|
||||
=> BitOperations.TrailingZeroCount((uint)flag);
|
||||
|
||||
public static string ToName(this CustomizeParameterFlag flag)
|
||||
=> flag switch
|
||||
{
|
||||
CustomizeParameterFlag.SkinDiffuse => "Skin Color",
|
||||
CustomizeParameterFlag.MuscleTone => "Muscle Tone",
|
||||
CustomizeParameterFlag.SkinSpecular => "Skin Shine",
|
||||
CustomizeParameterFlag.LipDiffuse => "Lip Color",
|
||||
CustomizeParameterFlag.LipOpacity => "Lip Opacity",
|
||||
CustomizeParameterFlag.HairDiffuse => "Hair Color",
|
||||
CustomizeParameterFlag.HairSpecular => "Hair Shine",
|
||||
CustomizeParameterFlag.HairHighlight => "Hair Highlights",
|
||||
CustomizeParameterFlag.LeftEye => "Left Eye Color",
|
||||
CustomizeParameterFlag.RightEye => "Right Eye Color",
|
||||
CustomizeParameterFlag.FeatureColor => "Tattoo Color",
|
||||
CustomizeParameterFlag.FacePaintUvMultiplier => "Face Paint Orientation",
|
||||
CustomizeParameterFlag.FacePaintUvOffset => "Face Paint Offset",
|
||||
CustomizeParameterFlag.DecalColor => "Face Paint Color",
|
||||
_ => string.Empty,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
using Glamourer.Designs;
|
||||
using Glamourer.GameData;
|
||||
using Glamourer.State;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using ImGuiNET;
|
||||
using OtterGui;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
|
||||
namespace Glamourer.Gui.Customization;
|
||||
|
|
@ -12,6 +12,7 @@ public class CustomizeParameterDrawer(Configuration config) : IService
|
|||
{
|
||||
public void Draw(DesignManager designManager, Design design)
|
||||
{
|
||||
using var _ = EnsureSize();
|
||||
foreach (var flag in CustomizeParameterExtensions.RgbFlags)
|
||||
DrawColorInput3(CustomizeParameterDrawData.FromDesign(designManager, design, flag));
|
||||
|
||||
|
|
@ -25,8 +26,16 @@ public class CustomizeParameterDrawer(Configuration config) : IService
|
|||
DrawValueInput(CustomizeParameterDrawData.FromDesign(designManager, design, flag));
|
||||
}
|
||||
|
||||
private ImRaii.IEndObject EnsureSize()
|
||||
{
|
||||
var iconSize = ImGui.GetTextLineHeight() * 2 + ImGui.GetStyle().ItemSpacing.Y + 4 * ImGui.GetStyle().FramePadding.Y;
|
||||
var width = 6 * iconSize + 4 * ImGui.GetStyle().ItemInnerSpacing.X;
|
||||
return ImRaii.ItemWidth(width);
|
||||
}
|
||||
|
||||
public void Draw(StateManager stateManager, ActorState state)
|
||||
{
|
||||
using var _ = EnsureSize();
|
||||
foreach (var flag in CustomizeParameterExtensions.RgbFlags)
|
||||
DrawColorInput3(CustomizeParameterDrawData.FromState(stateManager, state, flag));
|
||||
|
||||
|
|
@ -49,6 +58,7 @@ public class CustomizeParameterDrawer(Configuration config) : IService
|
|||
if (ImGui.ColorEdit3("##value", ref value, ImGuiColorEditFlags.Float | ImGuiColorEditFlags.HDR | ImGuiColorEditFlags.NoOptions))
|
||||
data.ValueSetter(new CustomizeParameterValue(value));
|
||||
}
|
||||
|
||||
DrawRevert(data);
|
||||
|
||||
DrawApplyAndLabel(data);
|
||||
|
|
@ -63,6 +73,7 @@ public class CustomizeParameterDrawer(Configuration config) : IService
|
|||
if (ImGui.ColorEdit4("##value", ref value, ImGuiColorEditFlags.Float | ImGuiColorEditFlags.HDR | ImGuiColorEditFlags.NoOptions))
|
||||
data.ValueSetter(new CustomizeParameterValue(value));
|
||||
}
|
||||
|
||||
DrawRevert(data);
|
||||
|
||||
DrawApplyAndLabel(data);
|
||||
|
|
@ -78,6 +89,7 @@ public class CustomizeParameterDrawer(Configuration config) : IService
|
|||
if (ImGui.InputFloat("##value", ref value, 0.1f, 0.5f))
|
||||
data.ValueSetter(new CustomizeParameterValue(value));
|
||||
}
|
||||
|
||||
DrawRevert(data);
|
||||
|
||||
DrawApplyAndLabel(data);
|
||||
|
|
@ -126,6 +138,6 @@ public class CustomizeParameterDrawer(Configuration config) : IService
|
|||
}
|
||||
|
||||
ImGui.SameLine(0, ImGui.GetStyle().ItemInnerSpacing.X);
|
||||
ImGui.TextUnformatted(data.Flag.ToString());
|
||||
ImGui.TextUnformatted(data.Flag.ToName());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
2
OtterGui
2
OtterGui
|
|
@ -1 +1 @@
|
|||
Subproject commit 82df166f1fa0e8f1cf9ca8f677cbeac71fb549ab
|
||||
Subproject commit f8f3e0b9bd39ed58f1233affc40df187b0c2b70e
|
||||
Loading…
Add table
Add a link
Reference in a new issue