mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2026-02-21 23:17:43 +01:00
Show customization ID (mostly for hairstyles), give a useful message if failing to get human.cmp and don't crash when getting null as clipboard data. Update to 0.0.7.4
This commit is contained in:
parent
767ddeb429
commit
b141da40b0
7 changed files with 27 additions and 12 deletions
|
|
@ -91,12 +91,11 @@ namespace Glamourer.Gui
|
|||
if (!applyButton)
|
||||
return false;
|
||||
|
||||
var text = ImGui.GetClipboardText();
|
||||
if (!text.Any())
|
||||
return false;
|
||||
|
||||
try
|
||||
{
|
||||
var text = ImGui.GetClipboardText();
|
||||
if (!text.Any())
|
||||
return false;
|
||||
var save = CharacterSave.FromString(text);
|
||||
ConditionalApply(save, _player!);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -221,6 +221,7 @@ namespace Glamourer.Gui
|
|||
{
|
||||
var custom = set.Data(id, i);
|
||||
var icon = Glamourer.Customization.GetIcon(custom.IconId);
|
||||
ImGui.BeginGroup();
|
||||
if (ImGui.ImageButton(icon.ImGuiHandle, _iconSize))
|
||||
{
|
||||
value = custom;
|
||||
|
|
@ -234,6 +235,11 @@ namespace Glamourer.Gui
|
|||
ImGui.Image(icon.ImGuiHandle, new Vector2(icon.Width, icon.Height));
|
||||
}
|
||||
|
||||
var text = custom.Value.ToString();
|
||||
var textWidth = ImGui.CalcTextSize(text).X;
|
||||
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + (_iconSize.X - textWidth + 2 * ImGui.GetStyle().FramePadding.X)/2);
|
||||
ImGui.Text(text);
|
||||
ImGui.EndGroup();
|
||||
if (i % 8 != 7)
|
||||
ImGui.SameLine();
|
||||
}
|
||||
|
|
@ -285,7 +291,7 @@ namespace Glamourer.Gui
|
|||
if (id == CustomizationId.Hairstyle && customization.Race == Race.Hrothgar)
|
||||
customization[CustomizationId.Face] = (byte) ((customization[CustomizationId.Hairstyle] + 1) / 2);
|
||||
|
||||
ImGui.Text(label);
|
||||
ImGui.Text($"{label} ({custom.Value.Value})");
|
||||
ImGuiCustom.HoverTooltip(tooltip);
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue