mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 18:27:24 +01:00
Improve (hopefully) some handling of options and stuff. Remove localization because wonky.
This commit is contained in:
parent
68327d3563
commit
ec7a53bee2
7 changed files with 52 additions and 36 deletions
|
|
@ -3,13 +3,6 @@
|
|||
// Localization from the game files directly.
|
||||
public enum CustomName
|
||||
{
|
||||
Clan = 0,
|
||||
Gender,
|
||||
Reverse,
|
||||
OddEyes,
|
||||
IrisSmall,
|
||||
IrisLarge,
|
||||
IrisSize,
|
||||
MidlanderM,
|
||||
HighlanderM,
|
||||
WildwoodM,
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ public partial class CustomizationOptions
|
|||
foreach (var gender in Genders)
|
||||
_customizationSets[ToIndex(race, gender)] = tmp.GetSet(race, gender);
|
||||
}
|
||||
|
||||
tmp.SetNpcData(_customizationSets);
|
||||
}
|
||||
|
||||
|
|
@ -85,13 +86,6 @@ public partial class CustomizationOptions
|
|||
void Set(CustomName id, Lumina.Text.SeString? s, string def)
|
||||
=> _names[(int)id] = s?.ToDalamudString().TextValue ?? def;
|
||||
|
||||
Set(CustomName.Clan, tmp.Lobby.GetRow(102)?.Text, "Clan");
|
||||
Set(CustomName.Gender, tmp.Lobby.GetRow(103)?.Text, "Gender");
|
||||
Set(CustomName.Reverse, tmp.Lobby.GetRow(2135)?.Text, "Reverse");
|
||||
Set(CustomName.OddEyes, tmp.Lobby.GetRow(2125)?.Text, "Odd Eyes");
|
||||
Set(CustomName.IrisSmall, tmp.Lobby.GetRow(1076)?.Text, "Small");
|
||||
Set(CustomName.IrisLarge, tmp.Lobby.GetRow(1075)?.Text, "Large");
|
||||
Set(CustomName.IrisSize, tmp.Lobby.GetRow(244)?.Text, "Iris Size");
|
||||
Set(CustomName.MidlanderM, subRace.GetRow((int)SubRace.Midlander)?.Masculine, SubRace.Midlander.ToName());
|
||||
Set(CustomName.MidlanderF, subRace.GetRow((int)SubRace.Midlander)?.Feminine, SubRace.Midlander.ToName());
|
||||
Set(CustomName.HighlanderM, subRace.GetRow((int)SubRace.Highlander)?.Masculine, SubRace.Highlander.ToName());
|
||||
|
|
@ -184,10 +178,10 @@ public partial class CustomizationOptions
|
|||
{
|
||||
_options = options;
|
||||
_cmpFile = new CmpFile(gameData, log);
|
||||
_customizeSheet = gameData.GetExcelSheet<CharaMakeCustomize>()!;
|
||||
_bnpcCustomize = gameData.GetExcelSheet<BNpcCustomize>()!;
|
||||
_enpcBase = gameData.GetExcelSheet<ENpcBase>()!;
|
||||
Lobby = gameData.GetExcelSheet<Lobby>()!;
|
||||
_customizeSheet = gameData.GetExcelSheet<CharaMakeCustomize>(ClientLanguage.English)!;
|
||||
_bnpcCustomize = gameData.GetExcelSheet<BNpcCustomize>(ClientLanguage.English)!;
|
||||
_enpcBase = gameData.GetExcelSheet<ENpcBase>(ClientLanguage.English)!;
|
||||
Lobby = gameData.GetExcelSheet<Lobby>(ClientLanguage.English)!;
|
||||
var tmp = gameData.Excel.GetType().GetMethod("GetSheet", BindingFlags.Instance | BindingFlags.NonPublic)?
|
||||
.MakeGenericMethod(typeof(CharaMakeParams)).Invoke(gameData.Excel, new object?[]
|
||||
{
|
||||
|
|
@ -401,20 +395,25 @@ public partial class CustomizationOptions
|
|||
return c.ToDefaultName();
|
||||
}
|
||||
|
||||
// Facial Features and Tattoos is created by combining two strings.
|
||||
if (c is >= CustomizeIndex.FacialFeature1 and <= CustomizeIndex.LegacyTattoo)
|
||||
return
|
||||
$"{Lobby.GetRow(1741)?.Text.ToDalamudString().ToString() ?? "Facial Features"} & {Lobby.GetRow(1742)?.Text.ToDalamudString().ToString() ?? "Tattoos"}";
|
||||
|
||||
// Otherwise all is normal, get the menu name or if it does not work the default name.
|
||||
var textRow = Lobby.GetRow(menu.Value.Id);
|
||||
return textRow?.Text.ToDalamudString().ToString() ?? c.ToDefaultName();
|
||||
}).ToArray();
|
||||
|
||||
// Add names for both eye colors.
|
||||
nameArray[(int)CustomizeIndex.EyeColorLeft] = nameArray[(int)CustomizeIndex.EyeColorRight];
|
||||
nameArray[(int)CustomizeIndex.EyeColorRight] = _options.GetName(CustomName.OddEyes);
|
||||
|
||||
nameArray[(int)CustomizeIndex.EyeColorLeft] = CustomizeIndex.EyeColorLeft.ToDefaultName();
|
||||
nameArray[(int)CustomizeIndex.EyeColorRight] = CustomizeIndex.EyeColorRight.ToDefaultName();
|
||||
nameArray[(int)CustomizeIndex.FacialFeature1] = CustomizeIndex.FacialFeature1.ToDefaultName();
|
||||
nameArray[(int)CustomizeIndex.FacialFeature2] = CustomizeIndex.FacialFeature2.ToDefaultName();
|
||||
nameArray[(int)CustomizeIndex.FacialFeature3] = CustomizeIndex.FacialFeature3.ToDefaultName();
|
||||
nameArray[(int)CustomizeIndex.FacialFeature4] = CustomizeIndex.FacialFeature4.ToDefaultName();
|
||||
nameArray[(int)CustomizeIndex.FacialFeature5] = CustomizeIndex.FacialFeature5.ToDefaultName();
|
||||
nameArray[(int)CustomizeIndex.FacialFeature6] = CustomizeIndex.FacialFeature6.ToDefaultName();
|
||||
nameArray[(int)CustomizeIndex.FacialFeature7] = CustomizeIndex.FacialFeature7.ToDefaultName();
|
||||
nameArray[(int)CustomizeIndex.LegacyTattoo] = CustomizeIndex.LegacyTattoo.ToDefaultName();
|
||||
nameArray[(int)CustomizeIndex.SmallIris] = CustomizeIndex.SmallIris.ToDefaultName();
|
||||
nameArray[(int)CustomizeIndex.Lipstick] = CustomizeIndex.Lipstick.ToDefaultName();
|
||||
nameArray[(int)CustomizeIndex.FacePaintReversed] = CustomizeIndex.FacePaintReversed.ToDefaultName();
|
||||
set.OptionName = nameArray;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -111,14 +111,14 @@ public static class CustomizationExtensions
|
|||
CustomizeIndex.Clan => "Clan",
|
||||
CustomizeIndex.Face => "Head Style",
|
||||
CustomizeIndex.Hairstyle => "Hair Style",
|
||||
CustomizeIndex.Highlights => "Highlights",
|
||||
CustomizeIndex.Highlights => "Enable Highlights",
|
||||
CustomizeIndex.SkinColor => "Skin Color",
|
||||
CustomizeIndex.EyeColorRight => "Right Eye Color",
|
||||
CustomizeIndex.EyeColorRight => "Left Eye", // inverted due to compatibility fuckup.
|
||||
CustomizeIndex.HairColor => "Hair Color",
|
||||
CustomizeIndex.HighlightsColor => "Highlights Color",
|
||||
CustomizeIndex.TattooColor => "Tattoo Color",
|
||||
CustomizeIndex.Eyebrows => "Eyebrow Style",
|
||||
CustomizeIndex.EyeColorLeft => "Left Eye Color",
|
||||
CustomizeIndex.EyeColorLeft => "Right Eye", // inverted due to compatibility fuckup.
|
||||
CustomizeIndex.EyeShape => "Small Pupils",
|
||||
CustomizeIndex.Nose => "Nose Style",
|
||||
CustomizeIndex.Jaw => "Jaw Style",
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ public partial class CustomizationDrawer
|
|||
ImGui.SameLine();
|
||||
using var group = ImRaii.Group();
|
||||
DrawRaceCombo();
|
||||
var gender = _service.AwaitedService.GetName(CustomName.Gender);
|
||||
var clan = _service.AwaitedService.GetName(CustomName.Clan);
|
||||
if (_withApply)
|
||||
{
|
||||
using var disabled = ImRaii.Disabled(_locked);
|
||||
|
|
@ -33,7 +31,7 @@ public partial class CustomizationDrawer
|
|||
}
|
||||
|
||||
ImGui.AlignTextToFramePadding();
|
||||
ImGui.TextUnformatted($"{gender} & {clan}");
|
||||
ImGui.TextUnformatted("Gender & Clan");
|
||||
}
|
||||
|
||||
private void DrawGenderSelector()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System.Numerics;
|
||||
using System;
|
||||
using System.Numerics;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Glamourer.Customization;
|
||||
using ImGuiNET;
|
||||
|
|
@ -113,8 +114,32 @@ public partial class CustomizationDrawer
|
|||
ImGui.SameLine();
|
||||
ApplyCheckbox(CustomizeIndex.FacialFeature4);
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui.Dummy(new Vector2(ImGui.GetFrameHeight()));
|
||||
}
|
||||
|
||||
var oldValue = _customize.Data.At(_currentIndex.ToByteAndMask().ByteIdx);
|
||||
var tmp = (int)oldValue;
|
||||
ImGui.SetNextItemWidth(_inputIntSize);
|
||||
if (ImGui.InputInt("##text", ref tmp, 1, 1))
|
||||
{
|
||||
tmp = Math.Clamp(tmp, 0, byte.MaxValue);
|
||||
if (tmp != oldValue)
|
||||
{
|
||||
_customize.Data.Set(_currentIndex.ToByteAndMask().ByteIdx, (byte)tmp);
|
||||
var changes = (byte)tmp ^ oldValue;
|
||||
Changed |= ((changes & 0x01) == 0x01 ? CustomizeFlag.FacialFeature1 : 0)
|
||||
| ((changes & 0x02) == 0x02 ? CustomizeFlag.FacialFeature2 : 0)
|
||||
| ((changes & 0x04) == 0x04 ? CustomizeFlag.FacialFeature3 : 0)
|
||||
| ((changes & 0x08) == 0x08 ? CustomizeFlag.FacialFeature4 : 0)
|
||||
| ((changes & 0x10) == 0x10 ? CustomizeFlag.FacialFeature5 : 0)
|
||||
| ((changes & 0x20) == 0x20 ? CustomizeFlag.FacialFeature6 : 0)
|
||||
| ((changes & 0x40) == 0x40 ? CustomizeFlag.FacialFeature7 : 0)
|
||||
| ((changes & 0x80) == 0x80 ? CustomizeFlag.LegacyTattoo : 0);
|
||||
}
|
||||
}
|
||||
|
||||
PercentageInputInt();
|
||||
if (_set.DataByValue(CustomizeIndex.Face, _customize.Face, out _, _customize.Face) < 0)
|
||||
{
|
||||
ImGui.SameLine();
|
||||
|
|
@ -127,7 +152,7 @@ public partial class CustomizationDrawer
|
|||
ImGui.AlignTextToFramePadding();
|
||||
using (var _ = ImRaii.Enabled())
|
||||
{
|
||||
ImGui.TextUnformatted(_set.Option(CustomizeIndex.LegacyTattoo));
|
||||
ImGui.TextUnformatted("Facial Features & Tattoos");
|
||||
}
|
||||
|
||||
if (_withApply)
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ public partial class CustomizationDrawer : IDisposable
|
|||
private void UpdateSizes()
|
||||
{
|
||||
_spacing = ImGui.GetStyle().ItemSpacing with { X = ImGui.GetStyle().ItemInnerSpacing.X };
|
||||
_iconSize = new Vector2(ImGui.GetTextLineHeight() * 2 + ImGui.GetStyle().ItemSpacing.Y + 2 * ImGui.GetStyle().FramePadding.Y);
|
||||
_iconSize = new Vector2(ImGui.GetTextLineHeight() * 2 + _spacing.Y + 2 * ImGui.GetStyle().FramePadding.Y);
|
||||
_framedIconSize = _iconSize + 2 * ImGui.GetStyle().FramePadding;
|
||||
_inputIntSize = 2 * _framedIconSize.X + 1 * _spacing.X;
|
||||
_inputIntSizeNoButtons = _inputIntSize - 2 * _spacing.X - 2 * ImGui.GetFrameHeight();
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ public sealed class DesignFileSystemSelector : FileSystemSelector<Design, Design
|
|||
case DesignChanged.Type.Deleted:
|
||||
case DesignChanged.Type.ApplyCustomize:
|
||||
case DesignChanged.Type.ApplyEquip:
|
||||
case DesignChanged.Type.ApplyStain:
|
||||
case DesignChanged.Type.Customize:
|
||||
case DesignChanged.Type.Equip:
|
||||
case DesignChanged.Type.Weapon:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue