mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-15 05:04:15 +01:00
Replace some enums globally.
This commit is contained in:
parent
c098fbdfe8
commit
5c736576fa
57 changed files with 978 additions and 1007 deletions
2
Luna
2
Luna
|
|
@ -1 +1 @@
|
||||||
Subproject commit e69b638efaf89468517fe3741a300c8d3a7c6860
|
Subproject commit c872e220ebf7e8e53c6389be99a54827f0afd222
|
||||||
|
|
@ -303,12 +303,12 @@ public class FileEditor<T>(
|
||||||
ret = ImGui.Selectable(file.RelPath.ToString(), selected);
|
ret = ImGui.Selectable(file.RelPath.ToString(), selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.IsItemHovered())
|
if (Im.Item.Hovered())
|
||||||
{
|
{
|
||||||
using var tt = ImRaii.Tooltip();
|
using var tt = ImRaii.Tooltip();
|
||||||
ImGui.TextUnformatted("All Game Paths");
|
ImGui.TextUnformatted("All Game Paths");
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
using var t = ImRaii.Table("##Tooltip", 2, ImGuiTableFlags.SizingFixedFit);
|
using var t = Im.Table.Begin("##Tooltip"u8, 2, TableFlags.SizingFixedFit);
|
||||||
foreach (var (option, gamePath) in file.SubModUsage)
|
foreach (var (option, gamePath) in file.SubModUsage)
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ public class ItemSwapTab : IDisposable, ITab
|
||||||
: null;
|
: null;
|
||||||
var ret = base.DrawSelectable(globalIdx, selected);
|
var ret = base.DrawSelectable(globalIdx, selected);
|
||||||
if (inCollection.Count > 0)
|
if (inCollection.Count > 0)
|
||||||
ImUtf8.HoverTooltip(string.Join('\n', inCollection.Select(m => m.Name)));
|
Im.Tooltip.OnHover(string.Join('\n', inCollection.Select(m => m.Name)));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -506,8 +506,8 @@ public class ItemSwapTab : IDisposable, ITab
|
||||||
if (!tab)
|
if (!tab)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var table = ImRaii.Table("##settings", 3, ImGuiTableFlags.SizingFixedFit);
|
using var table = Im.Table.Begin("##settings"u8, 3, TableFlags.SizingFixedFit);
|
||||||
ImGui.TableSetupColumn("##text", ImGuiTableColumnFlags.WidthFixed, ImGui.CalcTextSize("and put them on these").X);
|
table.SetupColumn("##text"u8, TableColumnFlags.WidthFixed, Im.Font.CalculateSize("and put them on these"u8).X);
|
||||||
|
|
||||||
var (article1, article2, selector) = GetAccessorySelector(_slotFrom, true);
|
var (article1, article2, selector) = GetAccessorySelector(_slotFrom, true);
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
|
|
@ -566,7 +566,7 @@ public class ItemSwapTab : IDisposable, ITab
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
ImGuiUtil.DrawTextButton($"which will also affect {_affectedItems.Count - 1} other Items.", Vector2.Zero,
|
ImGuiUtil.DrawTextButton($"which will also affect {_affectedItems.Count - 1} other Items.", Vector2.Zero,
|
||||||
Colors.PressEnterWarningBg);
|
Colors.PressEnterWarningBg);
|
||||||
if (ImGui.IsItemHovered())
|
if (Im.Item.Hovered())
|
||||||
ImGui.SetTooltip(string.Join('\n', _affectedItems.Where(i => !ReferenceEquals(i.Name, selector.CurrentSelection.Item.Name))
|
ImGui.SetTooltip(string.Join('\n', _affectedItems.Where(i => !ReferenceEquals(i.Name, selector.CurrentSelection.Item.Name))
|
||||||
.Select(i => i.Name)));
|
.Select(i => i.Name)));
|
||||||
}
|
}
|
||||||
|
|
@ -595,7 +595,7 @@ public class ItemSwapTab : IDisposable, ITab
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var (sourceSelector, targetSelector, text1, text2) = _selectors[type];
|
var (sourceSelector, targetSelector, text1, text2) = _selectors[type];
|
||||||
using var table = ImRaii.Table("##settings", 2, ImGuiTableFlags.SizingFixedFit);
|
using var table = Im.Table.Begin("##settings"u8, 2, TableFlags.SizingFixedFit);
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImGui.AlignTextToFramePadding();
|
ImGui.AlignTextToFramePadding();
|
||||||
ImGui.TextUnformatted(text1);
|
ImGui.TextUnformatted(text1);
|
||||||
|
|
@ -627,7 +627,7 @@ public class ItemSwapTab : IDisposable, ITab
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
ImGuiUtil.DrawTextButton($"which will also affect {_affectedItems.Count - 1} other Items.", Vector2.Zero,
|
ImGuiUtil.DrawTextButton($"which will also affect {_affectedItems.Count - 1} other Items.", Vector2.Zero,
|
||||||
Colors.PressEnterWarningBg);
|
Colors.PressEnterWarningBg);
|
||||||
if (ImGui.IsItemHovered())
|
if (Im.Item.Hovered())
|
||||||
ImGui.SetTooltip(string.Join('\n', _affectedItems.Where(i => !ReferenceEquals(i.Name, targetSelector.CurrentSelection.Item.Name))
|
ImGui.SetTooltip(string.Join('\n', _affectedItems.Where(i => !ReferenceEquals(i.Name, targetSelector.CurrentSelection.Item.Name))
|
||||||
.Select(i => i.Name)));
|
.Select(i => i.Name)));
|
||||||
}
|
}
|
||||||
|
|
@ -638,7 +638,7 @@ public class ItemSwapTab : IDisposable, ITab
|
||||||
if (!tab)
|
if (!tab)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var table = ImRaii.Table("##settings", 2, ImGuiTableFlags.SizingFixedFit);
|
using var table = Im.Table.Begin("##settings"u8, 2, TableFlags.SizingFixedFit);
|
||||||
DrawTargetIdInput("Take this Hairstyle");
|
DrawTargetIdInput("Take this Hairstyle");
|
||||||
DrawSourceIdInput();
|
DrawSourceIdInput();
|
||||||
DrawGenderInput();
|
DrawGenderInput();
|
||||||
|
|
@ -650,7 +650,7 @@ public class ItemSwapTab : IDisposable, ITab
|
||||||
if (!tab)
|
if (!tab)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var table = ImRaii.Table("##settings", 2, ImGuiTableFlags.SizingFixedFit);
|
using var table = Im.Table.Begin("##settings"u8, 2, TableFlags.SizingFixedFit);
|
||||||
DrawTargetIdInput("Take this Tail Type");
|
DrawTargetIdInput("Take this Tail Type");
|
||||||
DrawSourceIdInput();
|
DrawSourceIdInput();
|
||||||
DrawGenderInput("for all", 2);
|
DrawGenderInput("for all", 2);
|
||||||
|
|
@ -663,7 +663,7 @@ public class ItemSwapTab : IDisposable, ITab
|
||||||
if (!tab)
|
if (!tab)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var table = ImRaii.Table("##settings", 2, ImGuiTableFlags.SizingFixedFit);
|
using var table = Im.Table.Begin("##settings"u8, 2, TableFlags.SizingFixedFit);
|
||||||
DrawTargetIdInput("Take this Ear Type");
|
DrawTargetIdInput("Take this Ear Type");
|
||||||
DrawSourceIdInput();
|
DrawSourceIdInput();
|
||||||
DrawGenderInput("for all Viera", 0);
|
DrawGenderInput("for all Viera", 0);
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ public sealed unsafe class MaterialTemplatePickers : Luna.IUiService
|
||||||
DrawTextureSlices(cbTextureRegionStart, cbMaxSize, itemSpacing.X, textureRHs, (byte)value);
|
DrawTextureSlices(cbTextureRegionStart, cbMaxSize, itemSpacing.X, textureRHs, (byte)value);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled) && (description.Length > 0 || compact && value != ushort.MaxValue))
|
if (Im.Item.Hovered(HoveredFlags.AllowWhenDisabled) && (description.Length > 0 || compact && value != ushort.MaxValue))
|
||||||
{
|
{
|
||||||
using var disabled = ImRaii.Enabled();
|
using var disabled = ImRaii.Enabled();
|
||||||
using var tt = ImUtf8.Tooltip();
|
using var tt = ImUtf8.Tooltip();
|
||||||
|
|
|
||||||
|
|
@ -285,7 +285,7 @@ public partial class MtrlTab
|
||||||
"Highlight this pair of rows on your character, if possible.\n\nHighlight colors can be configured in Penumbra's settings."u8,
|
"Highlight this pair of rows on your character, if possible.\n\nHighlight colors can be configured in Penumbra's settings."u8,
|
||||||
Im.Style.FrameHeight * Vector2.One, disabled || _colorTablePreviewers.Count == 0);
|
Im.Style.FrameHeight * Vector2.One, disabled || _colorTablePreviewers.Count == 0);
|
||||||
|
|
||||||
if (ImGui.IsItemHovered())
|
if (Im.Item.Hovered())
|
||||||
HighlightColorTablePair(pairIdx);
|
HighlightColorTablePair(pairIdx);
|
||||||
else if (_highlightedColorTablePair == pairIdx)
|
else if (_highlightedColorTablePair == pairIdx)
|
||||||
CancelColorTableHighlight();
|
CancelColorTableHighlight();
|
||||||
|
|
@ -297,7 +297,7 @@ public partial class MtrlTab
|
||||||
"Highlight this row on your character, if possible.\n\nHighlight colors can be configured in Penumbra's settings."u8,
|
"Highlight this row on your character, if possible.\n\nHighlight colors can be configured in Penumbra's settings."u8,
|
||||||
Im.Style.FrameHeight * Vector2.One, disabled || _colorTablePreviewers.Count == 0);
|
Im.Style.FrameHeight * Vector2.One, disabled || _colorTablePreviewers.Count == 0);
|
||||||
|
|
||||||
if (ImGui.IsItemHovered())
|
if (Im.Item.Hovered())
|
||||||
HighlightColorTableRow(rowIdx);
|
HighlightColorTableRow(rowIdx);
|
||||||
else if (_highlightedColorTableRow == rowIdx)
|
else if (_highlightedColorTableRow == rowIdx)
|
||||||
CancelColorTableHighlight();
|
CancelColorTableHighlight();
|
||||||
|
|
@ -357,7 +357,7 @@ public partial class MtrlTab
|
||||||
ImGui.GetWindowDrawList().AddText(letter, center, textColor);
|
ImGui.GetWindowDrawList().AddText(letter, center, textColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, description);
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, description);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
@ -387,7 +387,7 @@ public partial class MtrlTab
|
||||||
ImGui.GetWindowDrawList().AddText(letter, center, 0x80000000u);
|
ImGui.GetWindowDrawList().AddText(letter, center, 0x80000000u);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, description);
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, description);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -395,7 +395,7 @@ public partial class MtrlTab
|
||||||
{
|
{
|
||||||
var tmp = current;
|
var tmp = current;
|
||||||
var result = ApplyStainCheckbox.Draw(label, ref tmp);
|
var result = ApplyStainCheckbox.Draw(label, ref tmp);
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, description);
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, description);
|
||||||
if (!result || tmp == current)
|
if (!result || tmp == current)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -408,7 +408,7 @@ public partial class MtrlTab
|
||||||
{
|
{
|
||||||
var tmp = (float)value;
|
var tmp = (float)value;
|
||||||
var result = ImUtf8.DragScalar(label, ref tmp, format, min, max, speed);
|
var result = ImUtf8.DragScalar(label, ref tmp, format, min, max, speed);
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, description);
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, description);
|
||||||
if (!result)
|
if (!result)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -425,7 +425,7 @@ public partial class MtrlTab
|
||||||
{
|
{
|
||||||
var tmp = (float)value;
|
var tmp = (float)value;
|
||||||
var result = ImUtf8.DragScalar(label, ref tmp, format, min, max, speed);
|
var result = ImUtf8.DragScalar(label, ref tmp, format, min, max, speed);
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, description);
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, description);
|
||||||
if (!result)
|
if (!result)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -450,7 +450,7 @@ public partial class MtrlTab
|
||||||
{
|
{
|
||||||
var tmp = value;
|
var tmp = value;
|
||||||
var result = ImUtf8.DragScalar(label, ref tmp, format, min, max, speed);
|
var result = ImUtf8.DragScalar(label, ref tmp, format, min, max, speed);
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, description);
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, description);
|
||||||
if (!result || tmp == value)
|
if (!result || tmp == value)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -463,7 +463,7 @@ public partial class MtrlTab
|
||||||
{
|
{
|
||||||
var tmp = value;
|
var tmp = value;
|
||||||
var result = ImUtf8.DragScalar(label, ref tmp, format, min, max, speed);
|
var result = ImUtf8.DragScalar(label, ref tmp, format, min, max, speed);
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, description);
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, description);
|
||||||
if (!result || tmp == value)
|
if (!result || tmp == value)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ using OtterGui.Text;
|
||||||
using Penumbra.GameData.Files.MaterialStructs;
|
using Penumbra.GameData.Files.MaterialStructs;
|
||||||
using Penumbra.GameData.Files.StainMapStructs;
|
using Penumbra.GameData.Files.StainMapStructs;
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
|
using TableFlags = ImSharp.TableFlags;
|
||||||
|
|
||||||
namespace Penumbra.UI.AdvancedWindow.Materials;
|
namespace Penumbra.UI.AdvancedWindow.Materials;
|
||||||
|
|
||||||
|
|
@ -19,12 +20,12 @@ public partial class MtrlTab
|
||||||
|
|
||||||
private bool DrawLegacyColorTable(LegacyColorTable table, LegacyColorDyeTable? dyeTable, bool disabled)
|
private bool DrawLegacyColorTable(LegacyColorTable table, LegacyColorDyeTable? dyeTable, bool disabled)
|
||||||
{
|
{
|
||||||
using var imTable = ImUtf8.Table("##ColorTable"u8, dyeTable != null ? 10 : 8,
|
using var imTable = Im.Table.Begin("##ColorTable"u8, dyeTable is not null ? 10 : 8,
|
||||||
ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInnerV);
|
TableFlags.SizingFixedFit | TableFlags.RowBackground | TableFlags.BordersInnerVertical);
|
||||||
if (!imTable)
|
if (!imTable)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
DrawLegacyColorTableHeader(dyeTable != null);
|
DrawLegacyColorTableHeader(dyeTable is not null);
|
||||||
|
|
||||||
var ret = false;
|
var ret = false;
|
||||||
for (var i = 0; i < LegacyColorTable.NumRows; ++i)
|
for (var i = 0; i < LegacyColorTable.NumRows; ++i)
|
||||||
|
|
@ -43,12 +44,12 @@ public partial class MtrlTab
|
||||||
|
|
||||||
private bool DrawLegacyColorTable(ColorTable table, ColorDyeTable? dyeTable, bool disabled)
|
private bool DrawLegacyColorTable(ColorTable table, ColorDyeTable? dyeTable, bool disabled)
|
||||||
{
|
{
|
||||||
using var imTable = ImUtf8.Table("##ColorTable"u8, dyeTable != null ? 10 : 8,
|
using var imTable = Im.Table.Begin("##ColorTable"u8, dyeTable is not null ? 10 : 8,
|
||||||
ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInnerV);
|
TableFlags.SizingFixedFit | TableFlags.RowBackground | TableFlags.BordersInnerVertical);
|
||||||
if (!imTable)
|
if (!imTable)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
DrawLegacyColorTableHeader(dyeTable != null);
|
DrawLegacyColorTableHeader(dyeTable is not null);
|
||||||
|
|
||||||
var ret = false;
|
var ret = false;
|
||||||
for (var i = 0; i < ColorTable.NumRows; ++i)
|
for (var i = 0; i < ColorTable.NumRows; ++i)
|
||||||
|
|
@ -189,7 +190,7 @@ public partial class MtrlTab
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGuiUtil.HoverTooltip("Dye Template", ImGuiHoveredFlags.AllowWhenDisabled);
|
Im.Tooltip.OnHover("Dye Template"u8, HoveredFlags.AllowWhenDisabled);
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ret |= DrawLegacyDyePreview(rowIdx, disabled, dye, floatSize);
|
ret |= DrawLegacyDyePreview(rowIdx, disabled, dye, floatSize);
|
||||||
|
|
@ -304,7 +305,7 @@ public partial class MtrlTab
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGuiUtil.HoverTooltip("Dye Template", ImGuiHoveredFlags.AllowWhenDisabled);
|
Im.Tooltip.OnHover("Dye Template"u8, HoveredFlags.AllowWhenDisabled);
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ret |= DrawLegacyDyePreview(rowIdx, disabled, dye, floatSize);
|
ret |= DrawLegacyDyePreview(rowIdx, disabled, dye, floatSize);
|
||||||
|
|
|
||||||
|
|
@ -128,11 +128,11 @@ public partial class MtrlTab
|
||||||
|
|
||||||
var frameHeight = Im.Style.FrameHeight;
|
var frameHeight = Im.Style.FrameHeight;
|
||||||
var ret = false;
|
var ret = false;
|
||||||
using var table = ImRaii.Table("##Textures", 3);
|
using var table = Im.Table.Begin("##Textures"u8, 3);
|
||||||
|
|
||||||
ImGui.TableSetupColumn(string.Empty, ImGuiTableColumnFlags.WidthFixed, frameHeight);
|
table.SetupColumn(StringU8.Empty, TableColumnFlags.WidthFixed, frameHeight);
|
||||||
ImGui.TableSetupColumn("Path", ImGuiTableColumnFlags.WidthStretch);
|
table.SetupColumn("Path"u8, TableColumnFlags.WidthStretch);
|
||||||
ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.WidthFixed, TextureLabelWidth * Im.Style.GlobalScale);
|
table.SetupColumn("Name"u8, TableColumnFlags.WidthFixed, TextureLabelWidth * Im.Style.GlobalScale);
|
||||||
foreach (var (label, textureI, samplerI, description, monoFont) in Textures)
|
foreach (var (label, textureI, samplerI, description, monoFont) in Textures)
|
||||||
{
|
{
|
||||||
using var _ = ImRaii.PushId(samplerI);
|
using var _ = ImRaii.PushId(samplerI);
|
||||||
|
|
|
||||||
|
|
@ -183,18 +183,18 @@ public sealed class AtchMetaDrawer : MetaDrawer<AtchIdentifier, AtchEntry>
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.TextFramed(identifier.Race.ToName(), FrameColor);
|
ImUtf8.TextFramed(identifier.Race.ToName(), FrameColor);
|
||||||
ImUtf8.HoverTooltip("Model Race"u8);
|
Im.Tooltip.OnHover("Model Race"u8);
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
DrawGender(ref identifier, true);
|
DrawGender(ref identifier, true);
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.TextFramed(identifier.Type.ToName(), FrameColor);
|
ImUtf8.TextFramed(identifier.Type.ToName(), FrameColor);
|
||||||
ImUtf8.HoverTooltip("Attachment Point Type"u8);
|
Im.Tooltip.OnHover("Attachment Point Type"u8);
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.TextFramed(identifier.EntryIndex.ToString(), FrameColor);
|
ImUtf8.TextFramed(identifier.EntryIndex.ToString(), FrameColor);
|
||||||
ImUtf8.HoverTooltip("State Entry Index"u8);
|
Im.Tooltip.OnHover("State Entry Index"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool DrawEntry(in AtchEntry defaultEntry, ref AtchEntry entry, bool disabled)
|
private static bool DrawEntry(in AtchEntry defaultEntry, ref AtchEntry entry, bool disabled)
|
||||||
|
|
@ -205,42 +205,42 @@ public sealed class AtchMetaDrawer : MetaDrawer<AtchIdentifier, AtchEntry>
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImGui.SetNextItemWidth(200 * ImUtf8.GlobalScale);
|
ImGui.SetNextItemWidth(200 * Im.Style.GlobalScale);
|
||||||
if (ImUtf8.InputText("##BoneName"u8, entry.FullSpan, out TerminatedByteString newBone))
|
if (ImUtf8.InputText("##BoneName"u8, entry.FullSpan, out TerminatedByteString newBone))
|
||||||
{
|
{
|
||||||
entry.SetBoneName(newBone);
|
entry.SetBoneName(newBone);
|
||||||
changes = true;
|
changes = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, "Bone Name"u8);
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, "Bone Name"u8);
|
||||||
|
|
||||||
ImGui.SetNextItemWidth(200 * ImUtf8.GlobalScale);
|
ImGui.SetNextItemWidth(200 * Im.Style.GlobalScale);
|
||||||
changes |= ImUtf8.InputScalar("##AtchScale"u8, ref entry.Scale);
|
changes |= ImUtf8.InputScalar("##AtchScale"u8, ref entry.Scale);
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, "Scale"u8);
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, "Scale"u8);
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImGui.SetNextItemWidth(120 * ImUtf8.GlobalScale);
|
ImGui.SetNextItemWidth(120 * Im.Style.GlobalScale);
|
||||||
changes |= ImUtf8.InputScalar("##AtchOffsetX"u8, ref entry.OffsetX);
|
changes |= ImUtf8.InputScalar("##AtchOffsetX"u8, ref entry.OffsetX);
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, "Offset X-Coordinate"u8);
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, "Offset X-Coordinate"u8);
|
||||||
ImGui.SetNextItemWidth(120 * ImUtf8.GlobalScale);
|
ImGui.SetNextItemWidth(120 * Im.Style.GlobalScale);
|
||||||
changes |= ImUtf8.InputScalar("##AtchRotationX"u8, ref entry.RotationX);
|
changes |= ImUtf8.InputScalar("##AtchRotationX"u8, ref entry.RotationX);
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, "Rotation X-Axis"u8);
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, "Rotation X-Axis"u8);
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImGui.SetNextItemWidth(120 * ImUtf8.GlobalScale);
|
ImGui.SetNextItemWidth(120 * Im.Style.GlobalScale);
|
||||||
changes |= ImUtf8.InputScalar("##AtchOffsetY"u8, ref entry.OffsetY);
|
changes |= ImUtf8.InputScalar("##AtchOffsetY"u8, ref entry.OffsetY);
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, "Offset Y-Coordinate"u8);
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, "Offset Y-Coordinate"u8);
|
||||||
ImGui.SetNextItemWidth(120 * ImUtf8.GlobalScale);
|
ImGui.SetNextItemWidth(120 * Im.Style.GlobalScale);
|
||||||
changes |= ImUtf8.InputScalar("##AtchRotationY"u8, ref entry.RotationY);
|
changes |= ImUtf8.InputScalar("##AtchRotationY"u8, ref entry.RotationY);
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, "Rotation Y-Axis"u8);
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, "Rotation Y-Axis"u8);
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImGui.SetNextItemWidth(120 * ImUtf8.GlobalScale);
|
ImGui.SetNextItemWidth(120 * Im.Style.GlobalScale);
|
||||||
changes |= ImUtf8.InputScalar("##AtchOffsetZ"u8, ref entry.OffsetZ);
|
changes |= ImUtf8.InputScalar("##AtchOffsetZ"u8, ref entry.OffsetZ);
|
||||||
ImUtf8.HoverTooltip("Offset Z-Coordinate"u8);
|
Im.Tooltip.OnHover("Offset Z-Coordinate"u8);
|
||||||
ImGui.SetNextItemWidth(120 * ImUtf8.GlobalScale);
|
ImGui.SetNextItemWidth(120 * Im.Style.GlobalScale);
|
||||||
changes |= ImUtf8.InputScalar("##AtchRotationZ"u8, ref entry.RotationZ);
|
changes |= ImUtf8.InputScalar("##AtchRotationZ"u8, ref entry.RotationZ);
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, "Rotation Z-Axis"u8);
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, "Rotation Z-Axis"u8);
|
||||||
|
|
||||||
return changes;
|
return changes;
|
||||||
}
|
}
|
||||||
|
|
@ -248,7 +248,7 @@ public sealed class AtchMetaDrawer : MetaDrawer<AtchIdentifier, AtchEntry>
|
||||||
private static bool DrawRace(ref AtchIdentifier identifier, float unscaledWidth = 100)
|
private static bool DrawRace(ref AtchIdentifier identifier, float unscaledWidth = 100)
|
||||||
{
|
{
|
||||||
var ret = Combos.Race("##atchRace", identifier.Race, out var race, unscaledWidth);
|
var ret = Combos.Race("##atchRace", identifier.Race, out var race, unscaledWidth);
|
||||||
ImUtf8.HoverTooltip("Model Race"u8);
|
Im.Tooltip.OnHover("Model Race"u8);
|
||||||
if (ret)
|
if (ret)
|
||||||
identifier = identifier with { GenderRace = Names.CombinedRace(identifier.Gender, race) };
|
identifier = identifier with { GenderRace = Names.CombinedRace(identifier.Gender, race) };
|
||||||
|
|
||||||
|
|
@ -269,7 +269,7 @@ public sealed class AtchMetaDrawer : MetaDrawer<AtchIdentifier, AtchEntry>
|
||||||
|
|
||||||
private static bool DrawPointInput(ref AtchIdentifier identifier, AtchPointCombo combo)
|
private static bool DrawPointInput(ref AtchIdentifier identifier, AtchPointCombo combo)
|
||||||
{
|
{
|
||||||
if (!combo.Draw("##AtchPoint", identifier.Type.ToName(), "Attachment Point Type", 160 * ImUtf8.GlobalScale,
|
if (!combo.Draw("##AtchPoint", identifier.Type.ToName(), "Attachment Point Type", 160 * Im.Style.GlobalScale,
|
||||||
Im.Style.TextHeightWithSpacing))
|
Im.Style.TextHeightWithSpacing))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -280,10 +280,10 @@ public sealed class AtchMetaDrawer : MetaDrawer<AtchIdentifier, AtchEntry>
|
||||||
private static bool DrawEntryIndexInput(ref AtchIdentifier identifier, AtchPoint currentAtchPoint)
|
private static bool DrawEntryIndexInput(ref AtchIdentifier identifier, AtchPoint currentAtchPoint)
|
||||||
{
|
{
|
||||||
var index = identifier.EntryIndex;
|
var index = identifier.EntryIndex;
|
||||||
ImGui.SetNextItemWidth(40 * ImUtf8.GlobalScale);
|
ImGui.SetNextItemWidth(40 * Im.Style.GlobalScale);
|
||||||
var ret = ImUtf8.DragScalar("##AtchEntry"u8, ref index, 0, (ushort)(currentAtchPoint.Entries.Length - 1), 0.05f,
|
var ret = ImUtf8.DragScalar("##AtchEntry"u8, ref index, 0, (ushort)(currentAtchPoint.Entries.Length - 1), 0.05f,
|
||||||
ImGuiSliderFlags.AlwaysClamp);
|
ImGuiSliderFlags.AlwaysClamp);
|
||||||
ImUtf8.HoverTooltip("State Entry Index"u8);
|
Im.Tooltip.OnHover("State Entry Index"u8);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,13 +96,13 @@ public sealed class AtrMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
|
|
||||||
ImUtf8.TextFramed(ShpMetaDrawer.SlotName(identifier.Slot), FrameColor);
|
ImUtf8.TextFramed(ShpMetaDrawer.SlotName(identifier.Slot), FrameColor);
|
||||||
ImUtf8.HoverTooltip("Model Slot"u8);
|
Im.Tooltip.OnHover("Model Slot"u8);
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
if (identifier.GenderRaceCondition is not GenderRace.Unknown)
|
if (identifier.GenderRaceCondition is not GenderRace.Unknown)
|
||||||
{
|
{
|
||||||
ImUtf8.TextFramed($"{identifier.GenderRaceCondition.ToName()} ({identifier.GenderRaceCondition.ToRaceCode()})", FrameColor);
|
ImUtf8.TextFramed($"{identifier.GenderRaceCondition.ToName()} ({identifier.GenderRaceCondition.ToRaceCode()})", FrameColor);
|
||||||
ImUtf8.HoverTooltip("Gender & Race Code for this attribute to be set.");
|
Im.Tooltip.OnHover("Gender & Race Code for this attribute to be set.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -114,7 +114,7 @@ public sealed class AtrMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
ImUtf8.TextFramed($"{identifier.Id.Value.Id}", FrameColor);
|
ImUtf8.TextFramed($"{identifier.Id.Value.Id}", FrameColor);
|
||||||
else
|
else
|
||||||
ImUtf8.TextFramed("All IDs"u8, FrameColor);
|
ImUtf8.TextFramed("All IDs"u8, FrameColor);
|
||||||
ImUtf8.HoverTooltip("Primary ID"u8);
|
Im.Tooltip.OnHover("Primary ID"u8);
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.TextFramed(identifier.Attribute.AsSpan, FrameColor);
|
ImUtf8.TextFramed(identifier.Attribute.AsSpan, FrameColor);
|
||||||
|
|
@ -128,7 +128,7 @@ public sealed class AtrMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
var changes = ImUtf8.Checkbox("##atrEntry"u8, ref value);
|
var changes = ImUtf8.Checkbox("##atrEntry"u8, ref value);
|
||||||
if (changes)
|
if (changes)
|
||||||
entry = new AtrEntry(value);
|
entry = new AtrEntry(value);
|
||||||
ImUtf8.HoverTooltip("Whether to enable or disable this attribute for the selected items.");
|
Im.Tooltip.OnHover("Whether to enable or disable this attribute for the selected items.");
|
||||||
return changes;
|
return changes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -146,7 +146,7 @@ public sealed class AtrMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip(allSlots
|
Im.Tooltip.OnHover(allSlots
|
||||||
? "When using all slots, you also need to use all IDs."u8
|
? "When using all slots, you also need to use all IDs."u8
|
||||||
: "Enable this attribute for all model IDs."u8);
|
: "Enable this attribute for all model IDs."u8);
|
||||||
|
|
||||||
|
|
@ -167,7 +167,7 @@ public sealed class AtrMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip("Primary ID - You can usually find this as the 'e####' part of an item path or similar for customizations."u8);
|
Im.Tooltip.OnHover("Primary ID - You can usually find this as the 'e####' part of an item path or similar for customizations."u8);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
@ -175,7 +175,7 @@ public sealed class AtrMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
public bool DrawHumanSlot(ref AtrIdentifier identifier, float unscaledWidth = 150)
|
public bool DrawHumanSlot(ref AtrIdentifier identifier, float unscaledWidth = 150)
|
||||||
{
|
{
|
||||||
var ret = false;
|
var ret = false;
|
||||||
ImGui.SetNextItemWidth(unscaledWidth * ImUtf8.GlobalScale);
|
ImGui.SetNextItemWidth(unscaledWidth * Im.Style.GlobalScale);
|
||||||
using (var combo = ImUtf8.Combo("##atrSlot"u8, ShpMetaDrawer.SlotName(identifier.Slot)))
|
using (var combo = ImUtf8.Combo("##atrSlot"u8, ShpMetaDrawer.SlotName(identifier.Slot)))
|
||||||
{
|
{
|
||||||
if (combo)
|
if (combo)
|
||||||
|
|
@ -208,14 +208,14 @@ public sealed class AtrMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip("Model Slot"u8);
|
Im.Tooltip.OnHover("Model Slot"u8);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool DrawGenderRaceConditionInput(ref AtrIdentifier identifier, float unscaledWidth = 250)
|
private static bool DrawGenderRaceConditionInput(ref AtrIdentifier identifier, float unscaledWidth = 250)
|
||||||
{
|
{
|
||||||
var ret = false;
|
var ret = false;
|
||||||
ImGui.SetNextItemWidth(unscaledWidth * ImUtf8.GlobalScale);
|
ImGui.SetNextItemWidth(unscaledWidth * Im.Style.GlobalScale);
|
||||||
|
|
||||||
using (var combo = ImUtf8.Combo("##shpGenderRace"u8,
|
using (var combo = ImUtf8.Combo("##shpGenderRace"u8,
|
||||||
identifier.GenderRaceCondition is GenderRace.Unknown
|
identifier.GenderRaceCondition is GenderRace.Unknown
|
||||||
|
|
@ -243,7 +243,7 @@ public sealed class AtrMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip(
|
Im.Tooltip.OnHover(
|
||||||
"Only activate this attribute for this gender & race code."u8);
|
"Only activate this attribute for this gender & race code."u8);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -257,7 +257,7 @@ public sealed class AtrMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
var span = new Span<byte>(ptr, ShapeAttributeString.MaxLength + 1);
|
var span = new Span<byte>(ptr, ShapeAttributeString.MaxLength + 1);
|
||||||
using (ImStyleBorder.Frame.Push(Colors.RegexWarningBorder, Im.Style.GlobalScale, !valid))
|
using (ImStyleBorder.Frame.Push(Colors.RegexWarningBorder, Im.Style.GlobalScale, !valid))
|
||||||
{
|
{
|
||||||
ImGui.SetNextItemWidth(unscaledWidth * ImUtf8.GlobalScale);
|
ImGui.SetNextItemWidth(unscaledWidth * Im.Style.GlobalScale);
|
||||||
if (ImUtf8.InputText("##atrAttribute"u8, span, out int newLength, "Attribute..."u8))
|
if (ImUtf8.InputText("##atrAttribute"u8, span, out int newLength, "Attribute..."u8))
|
||||||
{
|
{
|
||||||
buffer.ForceLength((byte)newLength);
|
buffer.ForceLength((byte)newLength);
|
||||||
|
|
@ -268,7 +268,7 @@ public sealed class AtrMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip("Supported attribute need to have the format `atrx_*` and a maximum length of 30 characters."u8);
|
Im.Tooltip.OnHover("Supported attribute need to have the format `atrx_*` and a maximum length of 30 characters."u8);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -90,19 +90,19 @@ public sealed class EqdpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFil
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.TextFramed($"{identifier.SetId.Id}", FrameColor);
|
ImUtf8.TextFramed($"{identifier.SetId.Id}", FrameColor);
|
||||||
ImUtf8.HoverTooltip("Model Set ID"u8);
|
Im.Tooltip.OnHover("Model Set ID"u8);
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.TextFramed(identifier.Race.ToName(), FrameColor);
|
ImUtf8.TextFramed(identifier.Race.ToName(), FrameColor);
|
||||||
ImUtf8.HoverTooltip("Model Race"u8);
|
Im.Tooltip.OnHover("Model Race"u8);
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.TextFramed(identifier.Gender.ToName(), FrameColor);
|
ImUtf8.TextFramed(identifier.Gender.ToName(), FrameColor);
|
||||||
ImUtf8.HoverTooltip("Gender"u8);
|
Im.Tooltip.OnHover("Gender"u8);
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.TextFramed(identifier.Slot.ToName(), FrameColor);
|
ImUtf8.TextFramed(identifier.Slot.ToName(), FrameColor);
|
||||||
ImUtf8.HoverTooltip("Equip Slot"u8);
|
Im.Tooltip.OnHover("Equip Slot"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool DrawEntry(EqdpEntryInternal defaultEntry, ref EqdpEntryInternal entry, bool disabled)
|
private static bool DrawEntry(EqdpEntryInternal defaultEntry, ref EqdpEntryInternal entry, bool disabled)
|
||||||
|
|
@ -130,7 +130,7 @@ public sealed class EqdpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFil
|
||||||
{
|
{
|
||||||
var ret = IdInput("##eqdpPrimaryId"u8, unscaledWidth, identifier.SetId.Id, out var setId, 0, ExpandedEqpGmpBase.Count - 1,
|
var ret = IdInput("##eqdpPrimaryId"u8, unscaledWidth, identifier.SetId.Id, out var setId, 0, ExpandedEqpGmpBase.Count - 1,
|
||||||
identifier.SetId.Id <= 1);
|
identifier.SetId.Id <= 1);
|
||||||
ImUtf8.HoverTooltip(
|
Im.Tooltip.OnHover(
|
||||||
"Model Set ID - You can usually find this as the 'e####' part of an item path.\nThis should generally not be left <= 1 unless you explicitly want that."u8);
|
"Model Set ID - You can usually find this as the 'e####' part of an item path.\nThis should generally not be left <= 1 unless you explicitly want that."u8);
|
||||||
if (ret)
|
if (ret)
|
||||||
identifier = identifier with { SetId = setId };
|
identifier = identifier with { SetId = setId };
|
||||||
|
|
@ -140,7 +140,7 @@ public sealed class EqdpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFil
|
||||||
public static bool DrawRace(ref EqdpIdentifier identifier, float unscaledWidth = 100)
|
public static bool DrawRace(ref EqdpIdentifier identifier, float unscaledWidth = 100)
|
||||||
{
|
{
|
||||||
var ret = Combos.Race("##eqdpRace", identifier.Race, out var race, unscaledWidth);
|
var ret = Combos.Race("##eqdpRace", identifier.Race, out var race, unscaledWidth);
|
||||||
ImUtf8.HoverTooltip("Model Race"u8);
|
Im.Tooltip.OnHover("Model Race"u8);
|
||||||
if (ret)
|
if (ret)
|
||||||
identifier = identifier with { GenderRace = Names.CombinedRace(identifier.Gender, race) };
|
identifier = identifier with { GenderRace = Names.CombinedRace(identifier.Gender, race) };
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -149,7 +149,7 @@ public sealed class EqdpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFil
|
||||||
public static bool DrawGender(ref EqdpIdentifier identifier, float unscaledWidth = 120)
|
public static bool DrawGender(ref EqdpIdentifier identifier, float unscaledWidth = 120)
|
||||||
{
|
{
|
||||||
var ret = Combos.Gender("##eqdpGender", identifier.Gender, out var gender, unscaledWidth);
|
var ret = Combos.Gender("##eqdpGender", identifier.Gender, out var gender, unscaledWidth);
|
||||||
ImUtf8.HoverTooltip("Gender"u8);
|
Im.Tooltip.OnHover("Gender"u8);
|
||||||
if (ret)
|
if (ret)
|
||||||
identifier = identifier with { GenderRace = Names.CombinedRace(gender, identifier.Race) };
|
identifier = identifier with { GenderRace = Names.CombinedRace(gender, identifier.Race) };
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -158,7 +158,7 @@ public sealed class EqdpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFil
|
||||||
public static bool DrawEquipSlot(ref EqdpIdentifier identifier, float unscaledWidth = 100)
|
public static bool DrawEquipSlot(ref EqdpIdentifier identifier, float unscaledWidth = 100)
|
||||||
{
|
{
|
||||||
var ret = Combos.EqdpEquipSlot("##eqdpSlot", identifier.Slot, out var slot, unscaledWidth);
|
var ret = Combos.EqdpEquipSlot("##eqdpSlot", identifier.Slot, out var slot, unscaledWidth);
|
||||||
ImUtf8.HoverTooltip("Equip Slot"u8);
|
Im.Tooltip.OnHover("Equip Slot"u8);
|
||||||
if (ret)
|
if (ret)
|
||||||
identifier = identifier with { Slot = slot };
|
identifier = identifier with { Slot = slot };
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
|
|
@ -81,11 +82,11 @@ public sealed class EqpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.TextFramed($"{identifier.SetId.Id}", FrameColor);
|
ImUtf8.TextFramed($"{identifier.SetId.Id}", FrameColor);
|
||||||
ImUtf8.HoverTooltip("Model Set ID"u8);
|
Im.Tooltip.OnHover("Model Set ID"u8);
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.TextFramed(identifier.Slot.ToName(), FrameColor);
|
ImUtf8.TextFramed(identifier.Slot.ToName(), FrameColor);
|
||||||
ImUtf8.HoverTooltip("Equip Slot"u8);
|
Im.Tooltip.OnHover("Equip Slot"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool DrawEntry(EquipSlot slot, EqpEntryInternal defaultEntry, ref EqpEntryInternal entry, bool disabled)
|
private static bool DrawEntry(EquipSlot slot, EqpEntryInternal defaultEntry, ref EqpEntryInternal entry, bool disabled)
|
||||||
|
|
@ -122,7 +123,7 @@ public sealed class EqpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
{
|
{
|
||||||
var ret = IdInput("##eqpPrimaryId"u8, unscaledWidth, identifier.SetId.Id, out var setId, 0, ExpandedEqpGmpBase.Count - 1,
|
var ret = IdInput("##eqpPrimaryId"u8, unscaledWidth, identifier.SetId.Id, out var setId, 0, ExpandedEqpGmpBase.Count - 1,
|
||||||
identifier.SetId.Id <= 1);
|
identifier.SetId.Id <= 1);
|
||||||
ImUtf8.HoverTooltip(
|
Im.Tooltip.OnHover(
|
||||||
"Model Set ID - You can usually find this as the 'e####' part of an item path.\nThis should generally not be left <= 1 unless you explicitly want that."u8);
|
"Model Set ID - You can usually find this as the 'e####' part of an item path.\nThis should generally not be left <= 1 unless you explicitly want that."u8);
|
||||||
if (ret)
|
if (ret)
|
||||||
identifier = identifier with { SetId = setId };
|
identifier = identifier with { SetId = setId };
|
||||||
|
|
@ -132,7 +133,7 @@ public sealed class EqpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
public static bool DrawEquipSlot(ref EqpIdentifier identifier, float unscaledWidth = 100)
|
public static bool DrawEquipSlot(ref EqpIdentifier identifier, float unscaledWidth = 100)
|
||||||
{
|
{
|
||||||
var ret = Combos.EqpEquipSlot("##eqpSlot", identifier.Slot, out var slot, unscaledWidth);
|
var ret = Combos.EqpEquipSlot("##eqpSlot", identifier.Slot, out var slot, unscaledWidth);
|
||||||
ImUtf8.HoverTooltip("Equip Slot"u8);
|
Im.Tooltip.OnHover("Equip Slot"u8);
|
||||||
if (ret)
|
if (ret)
|
||||||
identifier = identifier with { Slot = slot };
|
identifier = identifier with { Slot = slot };
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using Penumbra.GameData.Enums;
|
using Penumbra.GameData.Enums;
|
||||||
|
|
@ -33,7 +34,8 @@ public sealed class EstMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
protected override void DrawNew()
|
protected override void DrawNew()
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
CopyToClipboardButton("Copy all current EST manipulations to clipboard."u8, new Lazy<JToken?>(() => MetaDictionary.SerializeTo([], Editor.Est)));
|
CopyToClipboardButton("Copy all current EST manipulations to clipboard."u8,
|
||||||
|
new Lazy<JToken?>(() => MetaDictionary.SerializeTo([], Editor.Est)));
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
var canAdd = !Editor.Contains(Identifier);
|
var canAdd = !Editor.Contains(Identifier);
|
||||||
|
|
@ -88,26 +90,26 @@ public sealed class EstMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.TextFramed($"{identifier.SetId.Id}", FrameColor);
|
ImUtf8.TextFramed($"{identifier.SetId.Id}", FrameColor);
|
||||||
ImUtf8.HoverTooltip("Model Set ID"u8);
|
Im.Tooltip.OnHover("Model Set ID"u8);
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.TextFramed(identifier.Race.ToName(), FrameColor);
|
ImUtf8.TextFramed(identifier.Race.ToName(), FrameColor);
|
||||||
ImUtf8.HoverTooltip("Model Race"u8);
|
Im.Tooltip.OnHover("Model Race"u8);
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.TextFramed(identifier.Gender.ToName(), FrameColor);
|
ImUtf8.TextFramed(identifier.Gender.ToName(), FrameColor);
|
||||||
ImUtf8.HoverTooltip("Gender"u8);
|
Im.Tooltip.OnHover("Gender"u8);
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.TextFramed(identifier.Slot.ToString(), FrameColor);
|
ImUtf8.TextFramed(identifier.Slot.ToString(), FrameColor);
|
||||||
ImUtf8.HoverTooltip("Extra Skeleton Type"u8);
|
Im.Tooltip.OnHover("Extra Skeleton Type"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool DrawEntry(EstEntry defaultEntry, ref EstEntry entry, bool disabled)
|
private static bool DrawEntry(EstEntry defaultEntry, ref EstEntry entry, bool disabled)
|
||||||
{
|
{
|
||||||
using var dis = ImRaii.Disabled(disabled);
|
using var dis = ImRaii.Disabled(disabled);
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
var ret = DragInput("##estValue"u8, [], 100f * ImUtf8.GlobalScale, entry.Value, defaultEntry.Value, out var newValue, (ushort)0,
|
var ret = DragInput("##estValue"u8, [], 100f * Im.Style.GlobalScale, entry.Value, defaultEntry.Value, out var newValue, (ushort)0,
|
||||||
ushort.MaxValue, 0.05f, !disabled);
|
ushort.MaxValue, 0.05f, !disabled);
|
||||||
if (ret)
|
if (ret)
|
||||||
entry = new EstEntry(newValue);
|
entry = new EstEntry(newValue);
|
||||||
|
|
@ -118,7 +120,7 @@ public sealed class EstMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
{
|
{
|
||||||
var ret = IdInput("##estPrimaryId"u8, unscaledWidth, identifier.SetId.Id, out var setId, 0, ExpandedEqpGmpBase.Count - 1,
|
var ret = IdInput("##estPrimaryId"u8, unscaledWidth, identifier.SetId.Id, out var setId, 0, ExpandedEqpGmpBase.Count - 1,
|
||||||
identifier.SetId.Id <= 1);
|
identifier.SetId.Id <= 1);
|
||||||
ImUtf8.HoverTooltip(
|
Im.Tooltip.OnHover(
|
||||||
"Model Set ID - You can usually find this as the 'e####' part of an item path.\nThis should generally not be left <= 1 unless you explicitly want that."u8);
|
"Model Set ID - You can usually find this as the 'e####' part of an item path.\nThis should generally not be left <= 1 unless you explicitly want that."u8);
|
||||||
if (ret)
|
if (ret)
|
||||||
identifier = identifier with { SetId = setId };
|
identifier = identifier with { SetId = setId };
|
||||||
|
|
@ -128,7 +130,7 @@ public sealed class EstMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
public static bool DrawRace(ref EstIdentifier identifier, float unscaledWidth = 100)
|
public static bool DrawRace(ref EstIdentifier identifier, float unscaledWidth = 100)
|
||||||
{
|
{
|
||||||
var ret = Combos.Race("##estRace", identifier.Race, out var race, unscaledWidth);
|
var ret = Combos.Race("##estRace", identifier.Race, out var race, unscaledWidth);
|
||||||
ImUtf8.HoverTooltip("Model Race"u8);
|
Im.Tooltip.OnHover("Model Race"u8);
|
||||||
if (ret)
|
if (ret)
|
||||||
identifier = identifier with { GenderRace = Names.CombinedRace(identifier.Gender, race) };
|
identifier = identifier with { GenderRace = Names.CombinedRace(identifier.Gender, race) };
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -137,7 +139,7 @@ public sealed class EstMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
public static bool DrawGender(ref EstIdentifier identifier, float unscaledWidth = 120)
|
public static bool DrawGender(ref EstIdentifier identifier, float unscaledWidth = 120)
|
||||||
{
|
{
|
||||||
var ret = Combos.Gender("##estGender", identifier.Gender, out var gender, unscaledWidth);
|
var ret = Combos.Gender("##estGender", identifier.Gender, out var gender, unscaledWidth);
|
||||||
ImUtf8.HoverTooltip("Gender"u8);
|
Im.Tooltip.OnHover("Gender"u8);
|
||||||
if (ret)
|
if (ret)
|
||||||
identifier = identifier with { GenderRace = Names.CombinedRace(gender, identifier.Race) };
|
identifier = identifier with { GenderRace = Names.CombinedRace(gender, identifier.Race) };
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -146,7 +148,7 @@ public sealed class EstMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
public static bool DrawSlot(ref EstIdentifier identifier, float unscaledWidth = 200)
|
public static bool DrawSlot(ref EstIdentifier identifier, float unscaledWidth = 200)
|
||||||
{
|
{
|
||||||
var ret = Combos.EstSlot("##estSlot", identifier.Slot, out var slot, unscaledWidth);
|
var ret = Combos.EstSlot("##estSlot", identifier.Slot, out var slot, unscaledWidth);
|
||||||
ImUtf8.HoverTooltip("Extra Skeleton Type"u8);
|
Im.Tooltip.OnHover("Extra Skeleton Type"u8);
|
||||||
if (ret)
|
if (ret)
|
||||||
identifier = identifier with { Slot = slot };
|
identifier = identifier with { Slot = slot };
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using Penumbra.GameData.Structs;
|
using Penumbra.GameData.Structs;
|
||||||
|
|
@ -20,7 +21,7 @@ public sealed class GlobalEqpMetaDrawer(ModMetaEditor editor, MetaFileManager me
|
||||||
|
|
||||||
protected override void Initialize()
|
protected override void Initialize()
|
||||||
{
|
{
|
||||||
Identifier = new GlobalEqpManipulation()
|
Identifier = new GlobalEqpManipulation
|
||||||
{
|
{
|
||||||
Condition = 1,
|
Condition = 1,
|
||||||
Type = GlobalEqpType.DoNotHideEarrings,
|
Type = GlobalEqpType.DoNotHideEarrings,
|
||||||
|
|
@ -30,7 +31,8 @@ public sealed class GlobalEqpMetaDrawer(ModMetaEditor editor, MetaFileManager me
|
||||||
protected override void DrawNew()
|
protected override void DrawNew()
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
CopyToClipboardButton("Copy all current global EQP manipulations to clipboard."u8, new Lazy<JToken?>(() => MetaDictionary.SerializeTo([], Editor.GlobalEqp)));
|
CopyToClipboardButton("Copy all current global EQP manipulations to clipboard."u8,
|
||||||
|
new Lazy<JToken?>(() => MetaDictionary.SerializeTo([], Editor.GlobalEqp)));
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
var canAdd = !Editor.Contains(Identifier);
|
var canAdd = !Editor.Contains(Identifier);
|
||||||
|
|
@ -72,19 +74,19 @@ public sealed class GlobalEqpMetaDrawer(ModMetaEditor editor, MetaFileManager me
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.TextFramed(identifier.Type.ToName(), FrameColor);
|
ImUtf8.TextFramed(identifier.Type.ToName(), FrameColor);
|
||||||
ImUtf8.HoverTooltip("Global EQP Type"u8);
|
Im.Tooltip.OnHover("Global EQP Type"u8);
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
if (identifier.Type.HasCondition())
|
if (identifier.Type.HasCondition())
|
||||||
{
|
{
|
||||||
ImUtf8.TextFramed($"{identifier.Condition.Id}", FrameColor);
|
ImUtf8.TextFramed($"{identifier.Condition.Id}", FrameColor);
|
||||||
ImUtf8.HoverTooltip("Conditional Model ID"u8);
|
Im.Tooltip.OnHover("Conditional Model ID"u8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool DrawType(ref GlobalEqpManipulation identifier, float unscaledWidth = 250)
|
public static bool DrawType(ref GlobalEqpManipulation identifier, float unscaledWidth = 250)
|
||||||
{
|
{
|
||||||
ImGui.SetNextItemWidth(unscaledWidth * ImUtf8.GlobalScale);
|
ImGui.SetNextItemWidth(unscaledWidth * Im.Style.GlobalScale);
|
||||||
using var combo = ImUtf8.Combo("##geqpType"u8, identifier.Type.ToName());
|
using var combo = ImUtf8.Combo("##geqpType"u8, identifier.Type.ToName());
|
||||||
if (!combo)
|
if (!combo)
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -102,7 +104,7 @@ public sealed class GlobalEqpMetaDrawer(ModMetaEditor editor, MetaFileManager me
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip(type.ToDescription());
|
Im.Tooltip.OnHover(type.ToDescription());
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -113,6 +115,6 @@ public sealed class GlobalEqpMetaDrawer(ModMetaEditor editor, MetaFileManager me
|
||||||
if (IdInput("##geqpCond"u8, unscaledWidth, identifier.Condition.Id, out var newId, 1, ushort.MaxValue,
|
if (IdInput("##geqpCond"u8, unscaledWidth, identifier.Condition.Id, out var newId, 1, ushort.MaxValue,
|
||||||
identifier.Condition.Id <= 1))
|
identifier.Condition.Id <= 1))
|
||||||
identifier = identifier with { Condition = newId };
|
identifier = identifier with { Condition = newId };
|
||||||
ImUtf8.HoverTooltip("The Model ID for the item that should not be hidden."u8);
|
Im.Tooltip.OnHover("The Model ID for the item that should not be hidden."u8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using Penumbra.GameData.Structs;
|
using Penumbra.GameData.Structs;
|
||||||
using Penumbra.Meta.Files;
|
using Penumbra.Meta.Files;
|
||||||
|
|
@ -32,7 +33,8 @@ public sealed class GmpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
protected override void DrawNew()
|
protected override void DrawNew()
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
CopyToClipboardButton("Copy all current Gmp manipulations to clipboard."u8, new Lazy<JToken?>(() => MetaDictionary.SerializeTo([], Editor.Gmp)));
|
CopyToClipboardButton("Copy all current Gmp manipulations to clipboard."u8,
|
||||||
|
new Lazy<JToken?>(() => MetaDictionary.SerializeTo([], Editor.Gmp)));
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
var canAdd = !Editor.Contains(Identifier);
|
var canAdd = !Editor.Contains(Identifier);
|
||||||
|
|
@ -74,7 +76,7 @@ public sealed class GmpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.TextFramed($"{identifier.SetId.Id}", FrameColor);
|
ImUtf8.TextFramed($"{identifier.SetId.Id}", FrameColor);
|
||||||
ImUtf8.HoverTooltip("Model Set ID"u8);
|
Im.Tooltip.OnHover("Model Set ID"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool DrawEntry(GmpEntry defaultEntry, ref GmpEntry entry, bool disabled)
|
private static bool DrawEntry(GmpEntry defaultEntry, ref GmpEntry entry, bool disabled)
|
||||||
|
|
@ -95,7 +97,7 @@ public sealed class GmpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
changes = true;
|
changes = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
var rotationWidth = 75 * ImUtf8.GlobalScale;
|
var rotationWidth = 75 * Im.Style.GlobalScale;
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
if (DragInput("##gmpRotationA"u8, "Rotation A in Degrees"u8, rotationWidth, entry.RotationA, defaultEntry.RotationA, out var rotationA,
|
if (DragInput("##gmpRotationA"u8, "Rotation A in Degrees"u8, rotationWidth, entry.RotationA, defaultEntry.RotationA, out var rotationA,
|
||||||
(ushort)0, (ushort)360, 0.05f, !disabled))
|
(ushort)0, (ushort)360, 0.05f, !disabled))
|
||||||
|
|
@ -120,7 +122,7 @@ public sealed class GmpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
changes = true;
|
changes = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
var unkWidth = 50 * ImUtf8.GlobalScale;
|
var unkWidth = 50 * Im.Style.GlobalScale;
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
if (DragInput("##gmpUnkA"u8, "Animation Type A?"u8, unkWidth, entry.UnknownA, defaultEntry.UnknownA, out var unknownA,
|
if (DragInput("##gmpUnkA"u8, "Animation Type A?"u8, unkWidth, entry.UnknownA, defaultEntry.UnknownA, out var unknownA,
|
||||||
(byte)0, (byte)15, 0.01f, !disabled))
|
(byte)0, (byte)15, 0.01f, !disabled))
|
||||||
|
|
@ -144,7 +146,7 @@ public sealed class GmpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
{
|
{
|
||||||
var ret = IdInput("##gmpPrimaryId"u8, unscaledWidth, identifier.SetId.Id, out var setId, 1, ExpandedEqpGmpBase.Count - 1,
|
var ret = IdInput("##gmpPrimaryId"u8, unscaledWidth, identifier.SetId.Id, out var setId, 1, ExpandedEqpGmpBase.Count - 1,
|
||||||
identifier.SetId.Id <= 1);
|
identifier.SetId.Id <= 1);
|
||||||
ImUtf8.HoverTooltip(
|
Im.Tooltip.OnHover(
|
||||||
"Model Set ID - You can usually find this as the 'e####' part of an item path.\nThis should generally not be left <= 1 unless you explicitly want that."u8);
|
"Model Set ID - You can usually find this as the 'e####' part of an item path.\nThis should generally not be left <= 1 unless you explicitly want that."u8);
|
||||||
if (ret)
|
if (ret)
|
||||||
identifier = new GmpIdentifier(setId);
|
identifier = new GmpIdentifier(setId);
|
||||||
|
|
|
||||||
|
|
@ -1,302 +1,304 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
using Newtonsoft.Json.Linq;
|
using ImSharp;
|
||||||
using OtterGui.Raii;
|
using Newtonsoft.Json.Linq;
|
||||||
using OtterGui.Text;
|
using OtterGui.Raii;
|
||||||
using Penumbra.GameData.Enums;
|
using OtterGui.Text;
|
||||||
using Penumbra.GameData.Structs;
|
using Penumbra.GameData.Enums;
|
||||||
using Penumbra.Meta;
|
using Penumbra.GameData.Structs;
|
||||||
using Penumbra.Meta.Manipulations;
|
using Penumbra.Meta;
|
||||||
using Penumbra.Mods.Editor;
|
using Penumbra.Meta.Manipulations;
|
||||||
using Penumbra.UI.Classes;
|
using Penumbra.Mods.Editor;
|
||||||
|
using Penumbra.UI.Classes;
|
||||||
namespace Penumbra.UI.AdvancedWindow.Meta;
|
|
||||||
|
namespace Penumbra.UI.AdvancedWindow.Meta;
|
||||||
public sealed class ImcMetaDrawer(ModMetaEditor editor, MetaFileManager metaFiles)
|
|
||||||
: MetaDrawer<ImcIdentifier, ImcEntry>(editor, metaFiles)
|
public sealed class ImcMetaDrawer(ModMetaEditor editor, MetaFileManager metaFiles)
|
||||||
{
|
: MetaDrawer<ImcIdentifier, ImcEntry>(editor, metaFiles)
|
||||||
public override ReadOnlySpan<byte> Label
|
{
|
||||||
=> "Variant Edits (IMC)###IMC"u8;
|
public override ReadOnlySpan<byte> Label
|
||||||
|
=> "Variant Edits (IMC)###IMC"u8;
|
||||||
public override int NumColumns
|
|
||||||
=> 10;
|
public override int NumColumns
|
||||||
|
=> 10;
|
||||||
private bool _fileExists;
|
|
||||||
|
private bool _fileExists;
|
||||||
protected override void Initialize()
|
|
||||||
{
|
protected override void Initialize()
|
||||||
Identifier = ImcIdentifier.Default;
|
{
|
||||||
UpdateEntry();
|
Identifier = ImcIdentifier.Default;
|
||||||
}
|
UpdateEntry();
|
||||||
|
}
|
||||||
private void UpdateEntry()
|
|
||||||
=> (Entry, _fileExists, _) = ImcChecker.GetDefaultEntry(Identifier, true);
|
private void UpdateEntry()
|
||||||
|
=> (Entry, _fileExists, _) = ImcChecker.GetDefaultEntry(Identifier, true);
|
||||||
protected override void DrawNew()
|
|
||||||
{
|
protected override void DrawNew()
|
||||||
ImGui.TableNextColumn();
|
{
|
||||||
CopyToClipboardButton("Copy all current IMC manipulations to clipboard."u8,
|
ImGui.TableNextColumn();
|
||||||
new Lazy<JToken?>(() => MetaDictionary.SerializeTo([], Editor.Imc)));
|
CopyToClipboardButton("Copy all current IMC manipulations to clipboard."u8,
|
||||||
ImGui.TableNextColumn();
|
new Lazy<JToken?>(() => MetaDictionary.SerializeTo([], Editor.Imc)));
|
||||||
var canAdd = _fileExists && !Editor.Contains(Identifier);
|
ImGui.TableNextColumn();
|
||||||
var tt = canAdd ? "Stage this edit."u8 : !_fileExists ? "This IMC file does not exist."u8 : "This entry is already edited."u8;
|
var canAdd = _fileExists && !Editor.Contains(Identifier);
|
||||||
if (ImUtf8.IconButton(FontAwesomeIcon.Plus, tt, disabled: !canAdd))
|
var tt = canAdd ? "Stage this edit."u8 : !_fileExists ? "This IMC file does not exist."u8 : "This entry is already edited."u8;
|
||||||
Editor.Changes |= Editor.TryAdd(Identifier, Entry);
|
if (ImUtf8.IconButton(FontAwesomeIcon.Plus, tt, disabled: !canAdd))
|
||||||
|
Editor.Changes |= Editor.TryAdd(Identifier, Entry);
|
||||||
if (DrawIdentifierInput(ref Identifier))
|
|
||||||
UpdateEntry();
|
if (DrawIdentifierInput(ref Identifier))
|
||||||
|
UpdateEntry();
|
||||||
using var disabled = ImRaii.Disabled();
|
|
||||||
DrawEntry(Entry, ref Entry, false);
|
using var disabled = ImRaii.Disabled();
|
||||||
}
|
DrawEntry(Entry, ref Entry, false);
|
||||||
|
}
|
||||||
protected override void DrawEntry(ImcIdentifier identifier, ImcEntry entry)
|
|
||||||
{
|
protected override void DrawEntry(ImcIdentifier identifier, ImcEntry entry)
|
||||||
DrawMetaButtons(identifier, entry);
|
{
|
||||||
DrawIdentifier(identifier);
|
DrawMetaButtons(identifier, entry);
|
||||||
|
DrawIdentifier(identifier);
|
||||||
var defaultEntry = ImcChecker.GetDefaultEntry(identifier, true).Entry;
|
|
||||||
if (DrawEntry(defaultEntry, ref entry, true))
|
var defaultEntry = ImcChecker.GetDefaultEntry(identifier, true).Entry;
|
||||||
Editor.Changes |= Editor.Update(identifier, entry);
|
if (DrawEntry(defaultEntry, ref entry, true))
|
||||||
}
|
Editor.Changes |= Editor.Update(identifier, entry);
|
||||||
|
}
|
||||||
private static bool DrawIdentifierInput(ref ImcIdentifier identifier)
|
|
||||||
{
|
private static bool DrawIdentifierInput(ref ImcIdentifier identifier)
|
||||||
ImGui.TableNextColumn();
|
{
|
||||||
var change = DrawObjectType(ref identifier);
|
ImGui.TableNextColumn();
|
||||||
|
var change = DrawObjectType(ref identifier);
|
||||||
ImGui.TableNextColumn();
|
|
||||||
change |= DrawPrimaryId(ref identifier);
|
ImGui.TableNextColumn();
|
||||||
|
change |= DrawPrimaryId(ref identifier);
|
||||||
ImGui.TableNextColumn();
|
|
||||||
if (identifier.ObjectType is ObjectType.Equipment or ObjectType.Accessory)
|
ImGui.TableNextColumn();
|
||||||
change |= DrawSlot(ref identifier);
|
if (identifier.ObjectType is ObjectType.Equipment or ObjectType.Accessory)
|
||||||
else
|
change |= DrawSlot(ref identifier);
|
||||||
change |= DrawSecondaryId(ref identifier);
|
else
|
||||||
|
change |= DrawSecondaryId(ref identifier);
|
||||||
ImGui.TableNextColumn();
|
|
||||||
change |= DrawVariant(ref identifier);
|
ImGui.TableNextColumn();
|
||||||
|
change |= DrawVariant(ref identifier);
|
||||||
ImGui.TableNextColumn();
|
|
||||||
if (identifier.ObjectType is ObjectType.DemiHuman)
|
ImGui.TableNextColumn();
|
||||||
change |= DrawSlot(ref identifier, 70f);
|
if (identifier.ObjectType is ObjectType.DemiHuman)
|
||||||
else
|
change |= DrawSlot(ref identifier, 70f);
|
||||||
ImUtf8.ScaledDummy(70f);
|
else
|
||||||
return change;
|
ImUtf8.ScaledDummy(70f);
|
||||||
}
|
return change;
|
||||||
|
}
|
||||||
private static void DrawIdentifier(ImcIdentifier identifier)
|
|
||||||
{
|
private static void DrawIdentifier(ImcIdentifier identifier)
|
||||||
ImGui.TableNextColumn();
|
{
|
||||||
ImUtf8.TextFramed(identifier.ObjectType.ToName(), FrameColor);
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.HoverTooltip("Object Type"u8);
|
ImUtf8.TextFramed(identifier.ObjectType.ToName(), FrameColor);
|
||||||
|
Im.Tooltip.OnHover("Object Type"u8);
|
||||||
ImGui.TableNextColumn();
|
|
||||||
ImUtf8.TextFramed($"{identifier.PrimaryId.Id}", FrameColor);
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.HoverTooltip("Primary ID");
|
ImUtf8.TextFramed($"{identifier.PrimaryId.Id}", FrameColor);
|
||||||
|
Im.Tooltip.OnHover("Primary ID");
|
||||||
ImGui.TableNextColumn();
|
|
||||||
if (identifier.ObjectType is ObjectType.Equipment or ObjectType.Accessory)
|
ImGui.TableNextColumn();
|
||||||
{
|
if (identifier.ObjectType is ObjectType.Equipment or ObjectType.Accessory)
|
||||||
ImUtf8.TextFramed(identifier.EquipSlot.ToName(), FrameColor);
|
{
|
||||||
ImUtf8.HoverTooltip("Equip Slot"u8);
|
ImUtf8.TextFramed(identifier.EquipSlot.ToName(), FrameColor);
|
||||||
}
|
Im.Tooltip.OnHover("Equip Slot"u8);
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
ImUtf8.TextFramed($"{identifier.SecondaryId.Id}", FrameColor);
|
{
|
||||||
ImUtf8.HoverTooltip("Secondary ID"u8);
|
ImUtf8.TextFramed($"{identifier.SecondaryId.Id}", FrameColor);
|
||||||
}
|
Im.Tooltip.OnHover("Secondary ID"u8);
|
||||||
|
}
|
||||||
ImGui.TableNextColumn();
|
|
||||||
ImUtf8.TextFramed($"{identifier.Variant.Id}", FrameColor);
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.HoverTooltip("Variant"u8);
|
ImUtf8.TextFramed($"{identifier.Variant.Id}", FrameColor);
|
||||||
|
Im.Tooltip.OnHover("Variant"u8);
|
||||||
ImGui.TableNextColumn();
|
|
||||||
if (identifier.ObjectType is ObjectType.DemiHuman)
|
ImGui.TableNextColumn();
|
||||||
{
|
if (identifier.ObjectType is ObjectType.DemiHuman)
|
||||||
ImUtf8.TextFramed(identifier.EquipSlot.ToName(), FrameColor);
|
{
|
||||||
ImUtf8.HoverTooltip("Equip Slot"u8);
|
ImUtf8.TextFramed(identifier.EquipSlot.ToName(), FrameColor);
|
||||||
}
|
Im.Tooltip.OnHover("Equip Slot"u8);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
private static bool DrawEntry(ImcEntry defaultEntry, ref ImcEntry entry, bool addDefault)
|
|
||||||
{
|
private static bool DrawEntry(ImcEntry defaultEntry, ref ImcEntry entry, bool addDefault)
|
||||||
ImGui.TableNextColumn();
|
{
|
||||||
var change = DrawMaterialId(defaultEntry, ref entry, addDefault);
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.SameLineInner();
|
var change = DrawMaterialId(defaultEntry, ref entry, addDefault);
|
||||||
change |= DrawMaterialAnimationId(defaultEntry, ref entry, addDefault);
|
ImUtf8.SameLineInner();
|
||||||
|
change |= DrawMaterialAnimationId(defaultEntry, ref entry, addDefault);
|
||||||
ImGui.TableNextColumn();
|
|
||||||
change |= DrawDecalId(defaultEntry, ref entry, addDefault);
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.SameLineInner();
|
change |= DrawDecalId(defaultEntry, ref entry, addDefault);
|
||||||
change |= DrawVfxId(defaultEntry, ref entry, addDefault);
|
ImUtf8.SameLineInner();
|
||||||
ImUtf8.SameLineInner();
|
change |= DrawVfxId(defaultEntry, ref entry, addDefault);
|
||||||
change |= DrawSoundId(defaultEntry, ref entry, addDefault);
|
ImUtf8.SameLineInner();
|
||||||
|
change |= DrawSoundId(defaultEntry, ref entry, addDefault);
|
||||||
ImGui.TableNextColumn();
|
|
||||||
change |= DrawAttributes(defaultEntry, ref entry);
|
ImGui.TableNextColumn();
|
||||||
return change;
|
change |= DrawAttributes(defaultEntry, ref entry);
|
||||||
}
|
return change;
|
||||||
|
}
|
||||||
|
|
||||||
protected override IEnumerable<(ImcIdentifier, ImcEntry)> Enumerate()
|
|
||||||
=> Editor.Imc
|
protected override IEnumerable<(ImcIdentifier, ImcEntry)> Enumerate()
|
||||||
.OrderBy(kvp => kvp.Key.ObjectType)
|
=> Editor.Imc
|
||||||
.ThenBy(kvp => kvp.Key.PrimaryId.Id)
|
.OrderBy(kvp => kvp.Key.ObjectType)
|
||||||
.ThenBy(kvp => kvp.Key.EquipSlot)
|
.ThenBy(kvp => kvp.Key.PrimaryId.Id)
|
||||||
.ThenBy(kvp => kvp.Key.BodySlot)
|
.ThenBy(kvp => kvp.Key.EquipSlot)
|
||||||
.ThenBy(kvp => kvp.Key.SecondaryId.Id)
|
.ThenBy(kvp => kvp.Key.BodySlot)
|
||||||
.ThenBy(kvp => kvp.Key.Variant.Id)
|
.ThenBy(kvp => kvp.Key.SecondaryId.Id)
|
||||||
.Select(kvp => (kvp.Key, kvp.Value));
|
.ThenBy(kvp => kvp.Key.Variant.Id)
|
||||||
|
.Select(kvp => (kvp.Key, kvp.Value));
|
||||||
protected override int Count
|
|
||||||
=> Editor.Imc.Count;
|
protected override int Count
|
||||||
|
=> Editor.Imc.Count;
|
||||||
public static bool DrawObjectType(ref ImcIdentifier identifier, float width = 110)
|
|
||||||
{
|
public static bool DrawObjectType(ref ImcIdentifier identifier, float width = 110)
|
||||||
var ret = Combos.ImcType("##imcType", identifier.ObjectType, out var type, width);
|
{
|
||||||
ImUtf8.HoverTooltip("Object Type"u8);
|
var ret = Combos.ImcType("##imcType", identifier.ObjectType, out var type, width);
|
||||||
|
Im.Tooltip.OnHover("Object Type"u8);
|
||||||
if (ret)
|
|
||||||
{
|
if (ret)
|
||||||
var (equipSlot, secondaryId) = type switch
|
{
|
||||||
{
|
var (equipSlot, secondaryId) = type switch
|
||||||
ObjectType.Equipment => (identifier.EquipSlot.IsEquipment() ? identifier.EquipSlot : EquipSlot.Head, SecondaryId.Zero),
|
{
|
||||||
ObjectType.DemiHuman => (identifier.EquipSlot.IsEquipment() ? identifier.EquipSlot : EquipSlot.Head,
|
ObjectType.Equipment => (identifier.EquipSlot.IsEquipment() ? identifier.EquipSlot : EquipSlot.Head, SecondaryId.Zero),
|
||||||
identifier.SecondaryId == 0 ? (SecondaryId)1 : identifier.SecondaryId),
|
ObjectType.DemiHuman => (identifier.EquipSlot.IsEquipment() ? identifier.EquipSlot : EquipSlot.Head,
|
||||||
ObjectType.Accessory => (identifier.EquipSlot.IsAccessory() ? identifier.EquipSlot : EquipSlot.Ears, SecondaryId.Zero),
|
identifier.SecondaryId == 0 ? (SecondaryId)1 : identifier.SecondaryId),
|
||||||
_ => (EquipSlot.Unknown, identifier.SecondaryId == 0 ? (SecondaryId)1 : identifier.SecondaryId),
|
ObjectType.Accessory => (identifier.EquipSlot.IsAccessory() ? identifier.EquipSlot : EquipSlot.Ears, SecondaryId.Zero),
|
||||||
};
|
_ => (EquipSlot.Unknown, identifier.SecondaryId == 0 ? (SecondaryId)1 : identifier.SecondaryId),
|
||||||
identifier = identifier with
|
};
|
||||||
{
|
identifier = identifier with
|
||||||
ObjectType = type,
|
{
|
||||||
EquipSlot = equipSlot,
|
ObjectType = type,
|
||||||
SecondaryId = secondaryId,
|
EquipSlot = equipSlot,
|
||||||
};
|
SecondaryId = secondaryId,
|
||||||
}
|
};
|
||||||
|
}
|
||||||
return ret;
|
|
||||||
}
|
return ret;
|
||||||
|
}
|
||||||
public static bool DrawPrimaryId(ref ImcIdentifier identifier, float unscaledWidth = 80)
|
|
||||||
{
|
public static bool DrawPrimaryId(ref ImcIdentifier identifier, float unscaledWidth = 80)
|
||||||
var ret = IdInput("##imcPrimaryId"u8, unscaledWidth, identifier.PrimaryId.Id, out var newId, 0, ushort.MaxValue,
|
{
|
||||||
identifier.PrimaryId.Id <= 1);
|
var ret = IdInput("##imcPrimaryId"u8, unscaledWidth, identifier.PrimaryId.Id, out var newId, 0, ushort.MaxValue,
|
||||||
ImUtf8.HoverTooltip("Primary ID - You can usually find this as the 'x####' part of an item path.\n"u8
|
identifier.PrimaryId.Id <= 1);
|
||||||
+ "This should generally not be left <= 1 unless you explicitly want that."u8);
|
Im.Tooltip.OnHover("Primary ID - You can usually find this as the 'x####' part of an item path.\n"u8
|
||||||
if (ret)
|
+ "This should generally not be left <= 1 unless you explicitly want that."u8);
|
||||||
identifier = identifier with { PrimaryId = newId };
|
if (ret)
|
||||||
return ret;
|
identifier = identifier with { PrimaryId = newId };
|
||||||
}
|
return ret;
|
||||||
|
}
|
||||||
public static bool DrawSecondaryId(ref ImcIdentifier identifier, float unscaledWidth = 100)
|
|
||||||
{
|
public static bool DrawSecondaryId(ref ImcIdentifier identifier, float unscaledWidth = 100)
|
||||||
var ret = IdInput("##imcSecondaryId"u8, unscaledWidth, identifier.SecondaryId.Id, out var newId, 0, ushort.MaxValue, false);
|
{
|
||||||
ImUtf8.HoverTooltip("Secondary ID"u8);
|
var ret = IdInput("##imcSecondaryId"u8, unscaledWidth, identifier.SecondaryId.Id, out var newId, 0, ushort.MaxValue, false);
|
||||||
if (ret)
|
Im.Tooltip.OnHover("Secondary ID"u8);
|
||||||
identifier = identifier with { SecondaryId = newId };
|
if (ret)
|
||||||
return ret;
|
identifier = identifier with { SecondaryId = newId };
|
||||||
}
|
return ret;
|
||||||
|
}
|
||||||
public static bool DrawVariant(ref ImcIdentifier identifier, float unscaledWidth = 45)
|
|
||||||
{
|
public static bool DrawVariant(ref ImcIdentifier identifier, float unscaledWidth = 45)
|
||||||
var ret = IdInput("##imcVariant"u8, unscaledWidth, identifier.Variant.Id, out var newId, 0, byte.MaxValue, false);
|
{
|
||||||
ImUtf8.HoverTooltip("Variant ID"u8);
|
var ret = IdInput("##imcVariant"u8, unscaledWidth, identifier.Variant.Id, out var newId, 0, byte.MaxValue, false);
|
||||||
if (ret)
|
Im.Tooltip.OnHover("Variant ID"u8);
|
||||||
identifier = identifier with { Variant = (byte)newId };
|
if (ret)
|
||||||
return ret;
|
identifier = identifier with { Variant = (byte)newId };
|
||||||
}
|
return ret;
|
||||||
|
}
|
||||||
public static bool DrawSlot(ref ImcIdentifier identifier, float unscaledWidth = 100)
|
|
||||||
{
|
public static bool DrawSlot(ref ImcIdentifier identifier, float unscaledWidth = 100)
|
||||||
bool ret;
|
{
|
||||||
EquipSlot slot;
|
bool ret;
|
||||||
switch (identifier.ObjectType)
|
EquipSlot slot;
|
||||||
{
|
switch (identifier.ObjectType)
|
||||||
case ObjectType.Equipment:
|
{
|
||||||
case ObjectType.DemiHuman:
|
case ObjectType.Equipment:
|
||||||
ret = Combos.EqpEquipSlot("##slot", identifier.EquipSlot, out slot, unscaledWidth);
|
case ObjectType.DemiHuman:
|
||||||
break;
|
ret = Combos.EqpEquipSlot("##slot", identifier.EquipSlot, out slot, unscaledWidth);
|
||||||
case ObjectType.Accessory: ret = Combos.AccessorySlot("##slot", identifier.EquipSlot, out slot, unscaledWidth); break;
|
break;
|
||||||
default: return false;
|
case ObjectType.Accessory: ret = Combos.AccessorySlot("##slot", identifier.EquipSlot, out slot, unscaledWidth); break;
|
||||||
}
|
default: return false;
|
||||||
|
}
|
||||||
ImUtf8.HoverTooltip("Equip Slot"u8);
|
|
||||||
if (ret)
|
Im.Tooltip.OnHover("Equip Slot"u8);
|
||||||
identifier = identifier with { EquipSlot = slot };
|
if (ret)
|
||||||
return ret;
|
identifier = identifier with { EquipSlot = slot };
|
||||||
}
|
return ret;
|
||||||
|
}
|
||||||
public static bool DrawMaterialId(ImcEntry defaultEntry, ref ImcEntry entry, bool addDefault, float unscaledWidth = 45)
|
|
||||||
{
|
public static bool DrawMaterialId(ImcEntry defaultEntry, ref ImcEntry entry, bool addDefault, float unscaledWidth = 45)
|
||||||
if (!DragInput("##materialId"u8, "Material ID"u8, unscaledWidth * ImUtf8.GlobalScale, entry.MaterialId, defaultEntry.MaterialId,
|
{
|
||||||
out var newValue, (byte)1, byte.MaxValue, 0.01f, addDefault))
|
if (!DragInput("##materialId"u8, "Material ID"u8, unscaledWidth * Im.Style.GlobalScale, entry.MaterialId, defaultEntry.MaterialId,
|
||||||
return false;
|
out var newValue, (byte)1, byte.MaxValue, 0.01f, addDefault))
|
||||||
|
return false;
|
||||||
entry = entry with { MaterialId = newValue };
|
|
||||||
return true;
|
entry = entry with { MaterialId = newValue };
|
||||||
}
|
return true;
|
||||||
|
}
|
||||||
public static bool DrawMaterialAnimationId(ImcEntry defaultEntry, ref ImcEntry entry, bool addDefault, float unscaledWidth = 45)
|
|
||||||
{
|
public static bool DrawMaterialAnimationId(ImcEntry defaultEntry, ref ImcEntry entry, bool addDefault, float unscaledWidth = 45)
|
||||||
if (!DragInput("##mAnimId"u8, "Material Animation ID"u8, unscaledWidth * ImUtf8.GlobalScale, entry.MaterialAnimationId,
|
{
|
||||||
defaultEntry.MaterialAnimationId, out var newValue, (byte)0, byte.MaxValue, 0.01f, addDefault))
|
if (!DragInput("##mAnimId"u8, "Material Animation ID"u8, unscaledWidth * Im.Style.GlobalScale, entry.MaterialAnimationId,
|
||||||
return false;
|
defaultEntry.MaterialAnimationId, out var newValue, (byte)0, byte.MaxValue, 0.01f, addDefault))
|
||||||
|
return false;
|
||||||
entry = entry with { MaterialAnimationId = newValue };
|
|
||||||
return true;
|
entry = entry with { MaterialAnimationId = newValue };
|
||||||
}
|
return true;
|
||||||
|
}
|
||||||
public static bool DrawDecalId(ImcEntry defaultEntry, ref ImcEntry entry, bool addDefault, float unscaledWidth = 45)
|
|
||||||
{
|
public static bool DrawDecalId(ImcEntry defaultEntry, ref ImcEntry entry, bool addDefault, float unscaledWidth = 45)
|
||||||
if (!DragInput("##decalId"u8, "Decal ID"u8, unscaledWidth * ImUtf8.GlobalScale, entry.DecalId, defaultEntry.DecalId, out var newValue,
|
{
|
||||||
(byte)0, byte.MaxValue, 0.01f, addDefault))
|
if (!DragInput("##decalId"u8, "Decal ID"u8, unscaledWidth * Im.Style.GlobalScale, entry.DecalId, defaultEntry.DecalId, out var newValue,
|
||||||
return false;
|
(byte)0, byte.MaxValue, 0.01f, addDefault))
|
||||||
|
return false;
|
||||||
entry = entry with { DecalId = newValue };
|
|
||||||
return true;
|
entry = entry with { DecalId = newValue };
|
||||||
}
|
return true;
|
||||||
|
}
|
||||||
public static bool DrawVfxId(ImcEntry defaultEntry, ref ImcEntry entry, bool addDefault, float unscaledWidth = 45)
|
|
||||||
{
|
public static bool DrawVfxId(ImcEntry defaultEntry, ref ImcEntry entry, bool addDefault, float unscaledWidth = 45)
|
||||||
if (!DragInput("##vfxId"u8, "VFX ID"u8, unscaledWidth * ImUtf8.GlobalScale, entry.VfxId, defaultEntry.VfxId, out var newValue, (byte)0,
|
{
|
||||||
byte.MaxValue, 0.01f, addDefault))
|
if (!DragInput("##vfxId"u8, "VFX ID"u8, unscaledWidth * Im.Style.GlobalScale, entry.VfxId, defaultEntry.VfxId, out var newValue,
|
||||||
return false;
|
(byte)0,
|
||||||
|
byte.MaxValue, 0.01f, addDefault))
|
||||||
entry = entry with { VfxId = newValue };
|
return false;
|
||||||
return true;
|
|
||||||
}
|
entry = entry with { VfxId = newValue };
|
||||||
|
return true;
|
||||||
public static bool DrawSoundId(ImcEntry defaultEntry, ref ImcEntry entry, bool addDefault, float unscaledWidth = 45)
|
}
|
||||||
{
|
|
||||||
if (!DragInput("##soundId"u8, "Sound ID"u8, unscaledWidth * ImUtf8.GlobalScale, entry.SoundId, defaultEntry.SoundId, out var newValue,
|
public static bool DrawSoundId(ImcEntry defaultEntry, ref ImcEntry entry, bool addDefault, float unscaledWidth = 45)
|
||||||
(byte)0, byte.MaxValue, 0.01f, addDefault))
|
{
|
||||||
return false;
|
if (!DragInput("##soundId"u8, "Sound ID"u8, unscaledWidth * Im.Style.GlobalScale, entry.SoundId, defaultEntry.SoundId, out var newValue,
|
||||||
|
(byte)0, byte.MaxValue, 0.01f, addDefault))
|
||||||
entry = entry with { SoundId = newValue };
|
return false;
|
||||||
return true;
|
|
||||||
}
|
entry = entry with { SoundId = newValue };
|
||||||
|
return true;
|
||||||
private static bool DrawAttributes(ImcEntry defaultEntry, ref ImcEntry entry)
|
}
|
||||||
{
|
|
||||||
var changes = false;
|
private static bool DrawAttributes(ImcEntry defaultEntry, ref ImcEntry entry)
|
||||||
for (var i = 0; i < ImcEntry.NumAttributes; ++i)
|
{
|
||||||
{
|
var changes = false;
|
||||||
using var id = ImRaii.PushId(i);
|
for (var i = 0; i < ImcEntry.NumAttributes; ++i)
|
||||||
var flag = 1 << i;
|
{
|
||||||
var value = (entry.AttributeMask & flag) != 0;
|
using var id = ImRaii.PushId(i);
|
||||||
var def = (defaultEntry.AttributeMask & flag) != 0;
|
var flag = 1 << i;
|
||||||
if (Checkmark("##attribute"u8, "ABCDEFGHIJ"u8.Slice(i, 1), value, def, out var newValue))
|
var value = (entry.AttributeMask & flag) != 0;
|
||||||
{
|
var def = (defaultEntry.AttributeMask & flag) != 0;
|
||||||
var newMask = (ushort)(newValue ? entry.AttributeMask | flag : entry.AttributeMask & ~flag);
|
if (Checkmark("##attribute"u8, "ABCDEFGHIJ"u8.Slice(i, 1), value, def, out var newValue))
|
||||||
entry = entry with { AttributeMask = newMask };
|
{
|
||||||
changes = true;
|
var newMask = (ushort)(newValue ? entry.AttributeMask | flag : entry.AttributeMask & ~flag);
|
||||||
}
|
entry = entry with { AttributeMask = newMask };
|
||||||
|
changes = true;
|
||||||
if (i < ImcEntry.NumAttributes - 1)
|
}
|
||||||
ImUtf8.SameLineInner();
|
|
||||||
}
|
if (i < ImcEntry.NumAttributes - 1)
|
||||||
|
ImUtf8.SameLineInner();
|
||||||
return changes;
|
}
|
||||||
}
|
|
||||||
}
|
return changes;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ public abstract class MetaDrawer<TIdentifier, TEntry>(ModMetaEditor editor, Meta
|
||||||
bool border)
|
bool border)
|
||||||
{
|
{
|
||||||
int tmp = currentId;
|
int tmp = currentId;
|
||||||
ImGui.SetNextItemWidth(unscaledWidth * ImUtf8.GlobalScale);
|
ImGui.SetNextItemWidth(unscaledWidth * Im.Style.GlobalScale);
|
||||||
using var style = ImStyleBorder.Frame.Push(Colors.RegexWarningBorder, Im.Style.GlobalScale, border);
|
using var style = ImStyleBorder.Frame.Push(Colors.RegexWarningBorder, Im.Style.GlobalScale, border);
|
||||||
if (ImUtf8.InputScalar(label, ref tmp))
|
if (ImUtf8.InputScalar(label, ref tmp))
|
||||||
tmp = Math.Clamp(tmp, minId, maxId);
|
tmp = Math.Clamp(tmp, minId, maxId);
|
||||||
|
|
@ -103,9 +103,9 @@ public abstract class MetaDrawer<TIdentifier, TEntry>(ModMetaEditor editor, Meta
|
||||||
newValue = newValue <= minValue ? minValue : newValue >= maxValue ? maxValue : newValue;
|
newValue = newValue <= minValue ? minValue : newValue >= maxValue ? maxValue : newValue;
|
||||||
|
|
||||||
if (addDefault)
|
if (addDefault)
|
||||||
ImUtf8.HoverTooltip($"{tooltip}\nDefault Value: {defaultValue}");
|
Im.Tooltip.OnHover($"{tooltip}\nDefault Value: {defaultValue}");
|
||||||
else
|
else
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, tooltip);
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, tooltip);
|
||||||
|
|
||||||
return newValue != currentValue;
|
return newValue != currentValue;
|
||||||
}
|
}
|
||||||
|
|
@ -121,7 +121,7 @@ public abstract class MetaDrawer<TIdentifier, TEntry>(ModMetaEditor editor, Meta
|
||||||
using var color = ImGuiColor.FrameBackground.Push(c, defaultValue != currentValue);
|
using var color = ImGuiColor.FrameBackground.Push(c, defaultValue != currentValue);
|
||||||
newValue = currentValue;
|
newValue = currentValue;
|
||||||
ImUtf8.Checkbox(label, ref newValue);
|
ImUtf8.Checkbox(label, ref newValue);
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, tooltip);
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, tooltip);
|
||||||
return newValue != currentValue;
|
return newValue != currentValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -136,7 +136,7 @@ public abstract class MetaDrawer<TIdentifier, TEntry>(ModMetaEditor editor, Meta
|
||||||
using var color = ImGuiColor.FrameBackground.Push(c, defaultValue != currentValue);
|
using var color = ImGuiColor.FrameBackground.Push(c, defaultValue != currentValue);
|
||||||
newValue = currentValue;
|
newValue = currentValue;
|
||||||
ImUtf8.Checkbox(label, ref newValue);
|
ImUtf8.Checkbox(label, ref newValue);
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, tooltip);
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, tooltip);
|
||||||
return newValue != currentValue;
|
return newValue != currentValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using Penumbra.GameData.Enums;
|
using Penumbra.GameData.Enums;
|
||||||
|
|
@ -33,7 +34,8 @@ public sealed class RspMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
protected override void DrawNew()
|
protected override void DrawNew()
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
CopyToClipboardButton("Copy all current RSP manipulations to clipboard."u8, new Lazy<JToken?>(() => MetaDictionary.SerializeTo([], Editor.Rsp)));
|
CopyToClipboardButton("Copy all current RSP manipulations to clipboard."u8,
|
||||||
|
new Lazy<JToken?>(() => MetaDictionary.SerializeTo([], Editor.Rsp)));
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
var canAdd = !Editor.Contains(Identifier);
|
var canAdd = !Editor.Contains(Identifier);
|
||||||
|
|
@ -80,19 +82,19 @@ public sealed class RspMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.TextFramed(identifier.SubRace.ToName(), FrameColor);
|
ImUtf8.TextFramed(identifier.SubRace.ToName(), FrameColor);
|
||||||
ImUtf8.HoverTooltip("Model Set ID"u8);
|
Im.Tooltip.OnHover("Model Set ID"u8);
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.TextFramed(identifier.Attribute.ToFullString(), FrameColor);
|
ImUtf8.TextFramed(identifier.Attribute.ToFullString(), FrameColor);
|
||||||
ImUtf8.HoverTooltip("Equip Slot"u8);
|
Im.Tooltip.OnHover("Equip Slot"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool DrawEntry(RspEntry defaultEntry, ref RspEntry entry, bool disabled)
|
private static bool DrawEntry(RspEntry defaultEntry, ref RspEntry entry, bool disabled)
|
||||||
{
|
{
|
||||||
using var dis = ImRaii.Disabled(disabled);
|
using var dis = ImRaii.Disabled(disabled);
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
var ret = DragInput("##rspValue"u8, [], ImUtf8.GlobalScale * 150, entry.Value, defaultEntry.Value, out var newValue,
|
var ret = DragInput("##rspValue"u8, [], Im.Style.GlobalScale * 150, entry.Value, defaultEntry.Value, out var newValue,
|
||||||
RspEntry.MinValue, RspEntry.MaxValue, 0.001f, !disabled);
|
RspEntry.MinValue, RspEntry.MaxValue, 0.001f, !disabled);
|
||||||
if (ret)
|
if (ret)
|
||||||
entry = new RspEntry(newValue);
|
entry = new RspEntry(newValue);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -101,7 +103,7 @@ public sealed class RspMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
public static bool DrawSubRace(ref RspIdentifier identifier, float unscaledWidth = 150)
|
public static bool DrawSubRace(ref RspIdentifier identifier, float unscaledWidth = 150)
|
||||||
{
|
{
|
||||||
var ret = Combos.SubRace("##rspSubRace", identifier.SubRace, out var subRace, unscaledWidth);
|
var ret = Combos.SubRace("##rspSubRace", identifier.SubRace, out var subRace, unscaledWidth);
|
||||||
ImUtf8.HoverTooltip("Racial Clan"u8);
|
Im.Tooltip.OnHover("Racial Clan"u8);
|
||||||
if (ret)
|
if (ret)
|
||||||
identifier = identifier with { SubRace = subRace };
|
identifier = identifier with { SubRace = subRace };
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -110,7 +112,7 @@ public sealed class RspMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
public static bool DrawAttribute(ref RspIdentifier identifier, float unscaledWidth = 200)
|
public static bool DrawAttribute(ref RspIdentifier identifier, float unscaledWidth = 200)
|
||||||
{
|
{
|
||||||
var ret = Combos.RspAttribute("##rspAttribute", identifier.Attribute, out var attribute, unscaledWidth);
|
var ret = Combos.RspAttribute("##rspAttribute", identifier.Attribute, out var attribute, unscaledWidth);
|
||||||
ImUtf8.HoverTooltip("Scaling Attribute"u8);
|
Im.Tooltip.OnHover("Scaling Attribute"u8);
|
||||||
if (ret)
|
if (ret)
|
||||||
identifier = identifier with { Attribute = attribute };
|
identifier = identifier with { Attribute = attribute };
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
|
|
@ -99,13 +99,13 @@ public sealed class ShpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
|
|
||||||
ImUtf8.TextFramed(SlotName(identifier.Slot), FrameColor);
|
ImUtf8.TextFramed(SlotName(identifier.Slot), FrameColor);
|
||||||
ImUtf8.HoverTooltip("Model Slot"u8);
|
Im.Tooltip.OnHover("Model Slot"u8);
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
if (identifier.GenderRaceCondition is not GenderRace.Unknown)
|
if (identifier.GenderRaceCondition is not GenderRace.Unknown)
|
||||||
{
|
{
|
||||||
ImUtf8.TextFramed($"{identifier.GenderRaceCondition.ToName()} ({identifier.GenderRaceCondition.ToRaceCode()})", FrameColor);
|
ImUtf8.TextFramed($"{identifier.GenderRaceCondition.ToName()} ({identifier.GenderRaceCondition.ToRaceCode()})", FrameColor);
|
||||||
ImUtf8.HoverTooltip("Gender & Race Code for this shape key to be set.");
|
Im.Tooltip.OnHover("Gender & Race Code for this shape key to be set.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -117,7 +117,7 @@ public sealed class ShpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
ImUtf8.TextFramed($"{identifier.Id.Value.Id}", FrameColor);
|
ImUtf8.TextFramed($"{identifier.Id.Value.Id}", FrameColor);
|
||||||
else
|
else
|
||||||
ImUtf8.TextFramed("All IDs"u8, FrameColor);
|
ImUtf8.TextFramed("All IDs"u8, FrameColor);
|
||||||
ImUtf8.HoverTooltip("Primary ID"u8);
|
Im.Tooltip.OnHover("Primary ID"u8);
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.TextFramed(identifier.Shape.AsSpan, FrameColor);
|
ImUtf8.TextFramed(identifier.Shape.AsSpan, FrameColor);
|
||||||
|
|
@ -126,7 +126,7 @@ public sealed class ShpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
if (identifier.ConnectorCondition is not ShapeConnectorCondition.None)
|
if (identifier.ConnectorCondition is not ShapeConnectorCondition.None)
|
||||||
{
|
{
|
||||||
ImUtf8.TextFramed($"{identifier.ConnectorCondition}", FrameColor);
|
ImUtf8.TextFramed($"{identifier.ConnectorCondition}", FrameColor);
|
||||||
ImUtf8.HoverTooltip("Connector condition for this shape to be activated.");
|
Im.Tooltip.OnHover("Connector condition for this shape to be activated.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -138,7 +138,7 @@ public sealed class ShpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
var changes = ImUtf8.Checkbox("##shpEntry"u8, ref value);
|
var changes = ImUtf8.Checkbox("##shpEntry"u8, ref value);
|
||||||
if (changes)
|
if (changes)
|
||||||
entry = new ShpEntry(value);
|
entry = new ShpEntry(value);
|
||||||
ImUtf8.HoverTooltip("Whether to enable or disable this shape key for the selected items.");
|
Im.Tooltip.OnHover("Whether to enable or disable this shape key for the selected items.");
|
||||||
return changes;
|
return changes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -156,7 +156,7 @@ public sealed class ShpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip(allSlots ? "When using all slots, you also need to use all IDs."u8 : "Enable this shape key for all model IDs."u8);
|
Im.Tooltip.OnHover(allSlots ? "When using all slots, you also need to use all IDs."u8 : "Enable this shape key for all model IDs."u8);
|
||||||
|
|
||||||
ImGui.SameLine(0, ImGui.GetStyle().ItemInnerSpacing.X);
|
ImGui.SameLine(0, ImGui.GetStyle().ItemInnerSpacing.X);
|
||||||
if (all)
|
if (all)
|
||||||
|
|
@ -175,7 +175,7 @@ public sealed class ShpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip("Primary ID - You can usually find this as the 'e####' part of an item path or similar for customizations."u8);
|
Im.Tooltip.OnHover("Primary ID - You can usually find this as the 'e####' part of an item path or similar for customizations."u8);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
@ -183,7 +183,7 @@ public sealed class ShpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
public bool DrawHumanSlot(ref ShpIdentifier identifier, float unscaledWidth = 170)
|
public bool DrawHumanSlot(ref ShpIdentifier identifier, float unscaledWidth = 170)
|
||||||
{
|
{
|
||||||
var ret = false;
|
var ret = false;
|
||||||
ImGui.SetNextItemWidth(unscaledWidth * ImUtf8.GlobalScale);
|
ImGui.SetNextItemWidth(unscaledWidth * Im.Style.GlobalScale);
|
||||||
using (var combo = ImUtf8.Combo("##shpSlot"u8, SlotName(identifier.Slot)))
|
using (var combo = ImUtf8.Combo("##shpSlot"u8, SlotName(identifier.Slot)))
|
||||||
{
|
{
|
||||||
if (combo)
|
if (combo)
|
||||||
|
|
@ -223,7 +223,7 @@ public sealed class ShpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip("Model Slot"u8);
|
Im.Tooltip.OnHover("Model Slot"u8);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -235,7 +235,7 @@ public sealed class ShpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
var span = new Span<byte>(ptr, ShapeAttributeString.MaxLength + 1);
|
var span = new Span<byte>(ptr, ShapeAttributeString.MaxLength + 1);
|
||||||
using (ImStyleBorder.Frame.Push(Colors.RegexWarningBorder, Im.Style.GlobalScale, !valid))
|
using (ImStyleBorder.Frame.Push(Colors.RegexWarningBorder, Im.Style.GlobalScale, !valid))
|
||||||
{
|
{
|
||||||
ImGui.SetNextItemWidth(unscaledWidth * ImUtf8.GlobalScale);
|
ImGui.SetNextItemWidth(unscaledWidth * Im.Style.GlobalScale);
|
||||||
if (ImUtf8.InputText("##shpShape"u8, span, out int newLength, "Shape Key..."u8))
|
if (ImUtf8.InputText("##shpShape"u8, span, out int newLength, "Shape Key..."u8))
|
||||||
{
|
{
|
||||||
buffer.ForceLength((byte)newLength);
|
buffer.ForceLength((byte)newLength);
|
||||||
|
|
@ -246,14 +246,14 @@ public sealed class ShpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip("Supported shape keys need to have the format `shpx_*` and a maximum length of 30 characters."u8);
|
Im.Tooltip.OnHover("Supported shape keys need to have the format `shpx_*` and a maximum length of 30 characters."u8);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool DrawConnectorConditionInput(ref ShpIdentifier identifier, float unscaledWidth = 80)
|
private static bool DrawConnectorConditionInput(ref ShpIdentifier identifier, float unscaledWidth = 80)
|
||||||
{
|
{
|
||||||
var ret = false;
|
var ret = false;
|
||||||
ImGui.SetNextItemWidth(unscaledWidth * ImUtf8.GlobalScale);
|
ImGui.SetNextItemWidth(unscaledWidth * Im.Style.GlobalScale);
|
||||||
var (showWrists, showWaist, showAnkles, disable) = identifier.Slot switch
|
var (showWrists, showWaist, showAnkles, disable) = identifier.Slot switch
|
||||||
{
|
{
|
||||||
HumanSlot.Unknown => (true, true, true, false),
|
HumanSlot.Unknown => (true, true, true, false),
|
||||||
|
|
@ -282,7 +282,7 @@ public sealed class ShpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip(
|
Im.Tooltip.OnHover(
|
||||||
"Only activate this shape key if any custom connector shape keys (shpx_[wr|wa|an]_*) are also enabled through matching attributes."u8);
|
"Only activate this shape key if any custom connector shape keys (shpx_[wr|wa|an]_*) are also enabled through matching attributes."u8);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
@ -290,7 +290,7 @@ public sealed class ShpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
private static bool DrawGenderRaceConditionInput(ref ShpIdentifier identifier, float unscaledWidth = 250)
|
private static bool DrawGenderRaceConditionInput(ref ShpIdentifier identifier, float unscaledWidth = 250)
|
||||||
{
|
{
|
||||||
var ret = false;
|
var ret = false;
|
||||||
ImGui.SetNextItemWidth(unscaledWidth * ImUtf8.GlobalScale);
|
ImGui.SetNextItemWidth(unscaledWidth * Im.Style.GlobalScale);
|
||||||
|
|
||||||
using (var combo = ImUtf8.Combo("##shpGenderRace"u8, identifier.GenderRaceCondition is GenderRace.Unknown
|
using (var combo = ImUtf8.Combo("##shpGenderRace"u8, identifier.GenderRaceCondition is GenderRace.Unknown
|
||||||
? "Any Gender & Race"
|
? "Any Gender & Race"
|
||||||
|
|
@ -317,7 +317,7 @@ public sealed class ShpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip(
|
Im.Tooltip.OnHover(
|
||||||
"Only activate this shape key for this gender & race code."u8);
|
"Only activate this shape key for this gender & race code."u8);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ public partial class ModEditWindow
|
||||||
private void DrawBoneSelector()
|
private void DrawBoneSelector()
|
||||||
{
|
{
|
||||||
using var group = ImUtf8.Group();
|
using var group = ImUtf8.Group();
|
||||||
var width = 200 * ImUtf8.GlobalScale;
|
var width = 200 * Im.Style.GlobalScale;
|
||||||
using (ImRaii.PushStyle(ImGuiStyleVar.FrameRounding, 0)
|
using (ImRaii.PushStyle(ImGuiStyleVar.FrameRounding, 0)
|
||||||
.Push(ImGuiStyleVar.ItemSpacing, Vector2.Zero))
|
.Push(ImGuiStyleVar.ItemSpacing, Vector2.Zero))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -62,16 +62,16 @@ public partial class ModEditWindow
|
||||||
var height = Im.Style.TextHeightWithSpacing + 2 * ImGui.GetStyle().CellPadding.Y;
|
var height = Im.Style.TextHeightWithSpacing + 2 * ImGui.GetStyle().CellPadding.Y;
|
||||||
var skips = ImGuiClip.GetNecessarySkips(height);
|
var skips = ImGuiClip.GetNecessarySkips(height);
|
||||||
|
|
||||||
using var list = ImRaii.Table("##table", 3, ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInnerV, -Vector2.One);
|
using var table = Im.Table.Begin("##table"u8, 3, TableFlags.RowBackground | TableFlags.BordersInnerVertical, -Vector2.One);
|
||||||
|
|
||||||
if (!list)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var width = Im.ContentRegion.Available.X / 8;
|
var width = Im.ContentRegion.Available.X / 8;
|
||||||
|
|
||||||
ImGui.TableSetupColumn("##file", ImGuiTableColumnFlags.WidthFixed, width * 3);
|
table.SetupColumn("##file"u8, TableColumnFlags.WidthFixed, width * 3);
|
||||||
ImGui.TableSetupColumn("##path", ImGuiTableColumnFlags.WidthFixed, width * 3 + ImGui.GetStyle().FrameBorderSize);
|
table.SetupColumn("##path"u8, TableColumnFlags.WidthFixed, width * 3 + ImGui.GetStyle().FrameBorderSize);
|
||||||
ImGui.TableSetupColumn("##option", ImGuiTableColumnFlags.WidthFixed, width * 2);
|
table.SetupColumn("##option"u8, TableColumnFlags.WidthFixed, width * 2);
|
||||||
|
|
||||||
var idx = 0;
|
var idx = 0;
|
||||||
|
|
||||||
|
|
@ -115,7 +115,7 @@ public partial class ModEditWindow
|
||||||
|
|
||||||
private void DrawFilesNormalMode()
|
private void DrawFilesNormalMode()
|
||||||
{
|
{
|
||||||
using var list = ImRaii.Table("##table", 1);
|
using var list = Im.Table.Begin("##table"u8, 1);
|
||||||
|
|
||||||
if (!list)
|
if (!list)
|
||||||
return;
|
return;
|
||||||
|
|
@ -154,7 +154,7 @@ public partial class ModEditWindow
|
||||||
_ => (null, 0),
|
_ => (null, 0),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (text != null && ImGui.IsItemHovered())
|
if (text != null && Im.Item.Hovered())
|
||||||
{
|
{
|
||||||
using var tt = ImUtf8.Tooltip();
|
using var tt = ImUtf8.Tooltip();
|
||||||
using var c = ImRaii.DefaultColors();
|
using var c = ImRaii.DefaultColors();
|
||||||
|
|
@ -295,7 +295,7 @@ public partial class ModEditWindow
|
||||||
ImGuiUtil.TextColored(0xFF00B0B0, FontAwesomeIcon.ExclamationCircle.ToIconString());
|
ImGuiUtil.TextColored(0xFF00B0B0, FontAwesomeIcon.ExclamationCircle.ToIconString());
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip("The game path and the file do not have the same extension."u8);
|
Im.Tooltip.OnHover("The game path and the file do not have the same extension."u8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -338,7 +338,7 @@ public partial class ModEditWindow
|
||||||
ImGuiUtil.TextColored(0xFF00B0B0, FontAwesomeIcon.ExclamationCircle.ToIconString());
|
ImGuiUtil.TextColored(0xFF00B0B0, FontAwesomeIcon.ExclamationCircle.ToIconString());
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip("The game path and the file do not have the same extension."u8);
|
Im.Tooltip.OnHover("The game path and the file do not have the same extension."u8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ public partial class ModEditWindow
|
||||||
if (!child)
|
if (!child)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var table = ImUtf8.Table("##files"u8, 4, ImGuiTableFlags.RowBg | ImGuiTableFlags.SizingFixedFit, -Vector2.One);
|
using var table = Im.Table.Begin("##files"u8, 4, TableFlags.RowBackground | TableFlags.SizingFixedFit, -Vector2.One);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ public partial class ModEditWindow
|
||||||
|
|
||||||
if (!hasAtch)
|
if (!hasAtch)
|
||||||
{
|
{
|
||||||
ImGui.CloseCurrentPopup();
|
Im.Popup.CloseCurrent();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -125,8 +125,8 @@ public partial class ModEditWindow
|
||||||
|
|
||||||
private static void DrawTable(IMetaDrawer drawer)
|
private static void DrawTable(IMetaDrawer drawer)
|
||||||
{
|
{
|
||||||
const ImGuiTableFlags flags = ImGuiTableFlags.RowBg | ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.BordersInnerV;
|
const TableFlags flags = TableFlags.RowBackground | TableFlags.SizingFixedFit | TableFlags.BordersInnerVertical;
|
||||||
using var table = ImUtf8.Table(drawer.Label, drawer.NumColumns, flags);
|
using var table = Im.Table.Begin(drawer.Label, drawer.NumColumns, flags);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -144,7 +144,7 @@ public partial class ModEditWindow
|
||||||
var size = ImGui.CalcTextSize(text).X;
|
var size = ImGui.CalcTextSize(text).X;
|
||||||
ImGui.SetCursorPos(new Vector2(Im.ContentRegion.Available.X - size, oldPos + ImGui.GetStyle().FramePadding.Y));
|
ImGui.SetCursorPos(new Vector2(Im.ContentRegion.Available.X - size, oldPos + ImGui.GetStyle().FramePadding.Y));
|
||||||
Im.Text(text, ColorId.RedundantAssignment.Value().FullAlpha());
|
Im.Text(text, ColorId.RedundantAssignment.Value().FullAlpha());
|
||||||
if (ImGui.IsItemHovered())
|
if (Im.Item.Hovered())
|
||||||
{
|
{
|
||||||
using var tt = ImUtf8.Tooltip();
|
using var tt = ImUtf8.Tooltip();
|
||||||
foreach (var name in otherOptionData)
|
foreach (var name in otherOptionData)
|
||||||
|
|
@ -177,7 +177,7 @@ public partial class ModEditWindow
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip(
|
Im.Tooltip.OnHover(
|
||||||
"Try to add meta manipulations currently stored in the clipboard to the current manipulations.\nOverwrites already existing manipulations."u8);
|
"Try to add meta manipulations currently stored in the clipboard to the current manipulations.\nOverwrites already existing manipulations."u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -193,7 +193,7 @@ public partial class ModEditWindow
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip(
|
Im.Tooltip.OnHover(
|
||||||
"Try to set the current meta manipulations to the set currently stored in the clipboard.\nRemoves all other manipulations."u8);
|
"Try to set the current meta manipulations to the set currently stored in the clipboard.\nRemoves all other manipulations."u8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -299,7 +299,7 @@ public partial class ModEditWindow
|
||||||
|
|
||||||
if (Im.Item.RightClicked())
|
if (Im.Item.RightClicked())
|
||||||
ImGui.SetClipboardText(preview);
|
ImGui.SetClipboardText(preview);
|
||||||
ImGuiUtil.HoverTooltip("Right-Click to copy to clipboard.", ImGuiHoveredFlags.AllowWhenDisabled);
|
Im.Tooltip.OnHover("Right-Click to copy to clipboard."u8, HoveredFlags.AllowWhenDisabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawDocumentationLink(string address)
|
private void DrawDocumentationLink(string address)
|
||||||
|
|
@ -339,19 +339,19 @@ public partial class ModEditWindow
|
||||||
if (!header)
|
if (!header)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
using var table = ImRaii.Table(string.Empty, disabled ? 2 : 4, ImGuiTableFlags.SizingFixedFit);
|
using var table = Im.Table.Begin(StringU8.Empty, disabled ? 2 : 4, TableFlags.SizingFixedFit);
|
||||||
if (!table)
|
if (!table)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var ret = false;
|
var ret = false;
|
||||||
var materials = tab.Mdl.Materials;
|
var materials = tab.Mdl.Materials;
|
||||||
|
|
||||||
ImGui.TableSetupColumn("index", ImGuiTableColumnFlags.WidthFixed, 80 * Im.Style.GlobalScale);
|
table.SetupColumn("index"u8, TableColumnFlags.WidthFixed, 80 * Im.Style.GlobalScale);
|
||||||
ImGui.TableSetupColumn("path", ImGuiTableColumnFlags.WidthStretch, 1);
|
table.SetupColumn("path"u8, TableColumnFlags.WidthStretch, 1);
|
||||||
if (!disabled)
|
if (!disabled)
|
||||||
{
|
{
|
||||||
ImGui.TableSetupColumn("actions", ImGuiTableColumnFlags.WidthFixed, UiHelpers.IconButtonSize.X);
|
table.SetupColumn("actions"u8, TableColumnFlags.WidthFixed, UiHelpers.IconButtonSize.X);
|
||||||
ImGui.TableSetupColumn("help", ImGuiTableColumnFlags.WidthFixed, UiHelpers.IconButtonSize.X);
|
table.SetupColumn("help"u8, TableColumnFlags.WidthFixed, UiHelpers.IconButtonSize.X);
|
||||||
}
|
}
|
||||||
|
|
||||||
var inputFlags = disabled ? ImGuiInputTextFlags.ReadOnly : ImGuiInputTextFlags.None;
|
var inputFlags = disabled ? ImGuiInputTextFlags.ReadOnly : ImGuiInputTextFlags.None;
|
||||||
|
|
@ -464,12 +464,12 @@ public partial class ModEditWindow
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
using var id = ImRaii.PushId(meshIndex);
|
using var id = ImRaii.PushId(meshIndex);
|
||||||
using var table = ImRaii.Table(string.Empty, 2, ImGuiTableFlags.SizingFixedFit);
|
using var table = Im.Table.Begin(StringU8.Empty, 2, TableFlags.SizingFixedFit);
|
||||||
if (!table)
|
if (!table)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ImGui.TableSetupColumn("name", ImGuiTableColumnFlags.WidthFixed, 100 * Im.Style.GlobalScale);
|
table.SetupColumn("name"u8, TableColumnFlags.WidthFixed, 100 * Im.Style.GlobalScale);
|
||||||
ImGui.TableSetupColumn("field", ImGuiTableColumnFlags.WidthStretch, 1);
|
table.SetupColumn("field"u8, TableColumnFlags.WidthStretch, 1);
|
||||||
|
|
||||||
var file = tab.Mdl;
|
var file = tab.Mdl;
|
||||||
var mesh = file.Meshes[meshIndex];
|
var mesh = file.Meshes[meshIndex];
|
||||||
|
|
@ -503,18 +503,18 @@ public partial class ModEditWindow
|
||||||
if (!node)
|
if (!node)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var flags = ImGuiTableFlags.SizingFixedFit
|
var flags = TableFlags.SizingFixedFit
|
||||||
| ImGuiTableFlags.RowBg
|
| TableFlags.RowBackground
|
||||||
| ImGuiTableFlags.Borders
|
| TableFlags.Borders
|
||||||
| ImGuiTableFlags.NoHostExtendX;
|
| TableFlags.NoHostExtendX;
|
||||||
using var table = ImRaii.Table(string.Empty, 4, flags);
|
using var table = Im.Table.Begin(StringU8.Empty, 4, flags);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.TableSetupColumn("Usage");
|
table.SetupColumn("Usage"u8);
|
||||||
ImGui.TableSetupColumn("Type");
|
table.SetupColumn("Type"u8);
|
||||||
ImGui.TableSetupColumn("Stream");
|
table.SetupColumn("Stream"u8);
|
||||||
ImGui.TableSetupColumn("Offset");
|
table.SetupColumn("Offset"u8);
|
||||||
|
|
||||||
ImGui.TableHeadersRow();
|
ImGui.TableHeadersRow();
|
||||||
|
|
||||||
|
|
@ -595,7 +595,7 @@ public partial class ModEditWindow
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var ret = false;
|
var ret = false;
|
||||||
using (var table = ImRaii.Table("##data", 2, ImGuiTableFlags.SizingFixedFit))
|
using (var table = Im.Table.Begin("##data"u8, 2, TableFlags.SizingFixedFit))
|
||||||
{
|
{
|
||||||
if (table)
|
if (table)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -391,16 +391,16 @@ public partial class ModEditWindow
|
||||||
? "Parameter positions (continuations are grayed out, globally unused values are red, unused values within filters are yellow):"
|
? "Parameter positions (continuations are grayed out, globally unused values are red, unused values within filters are yellow):"
|
||||||
: "Parameter positions (continuations are grayed out):");
|
: "Parameter positions (continuations are grayed out):");
|
||||||
|
|
||||||
using var table = ImRaii.Table("##MaterialParamLayout", 5,
|
using var table = Im.Table.Begin("##MaterialParamLayout"u8, 5,
|
||||||
ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.RowBg);
|
TableFlags.SizingFixedFit | TableFlags.RowBackground);
|
||||||
if (!table)
|
if (!table)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ImGui.TableSetupColumn(string.Empty, ImGuiTableColumnFlags.WidthFixed, 40 * Im.Style.GlobalScale);
|
table.SetupColumn(StringU8.Empty, TableColumnFlags.WidthFixed, 40 * Im.Style.GlobalScale);
|
||||||
ImGui.TableSetupColumn("x", ImGuiTableColumnFlags.WidthFixed, 250 * Im.Style.GlobalScale);
|
table.SetupColumn("x"u8, TableColumnFlags.WidthFixed, 250 * Im.Style.GlobalScale);
|
||||||
ImGui.TableSetupColumn("y", ImGuiTableColumnFlags.WidthFixed, 250 * Im.Style.GlobalScale);
|
table.SetupColumn("y"u8, TableColumnFlags.WidthFixed, 250 * Im.Style.GlobalScale);
|
||||||
ImGui.TableSetupColumn("z", ImGuiTableColumnFlags.WidthFixed, 250 * Im.Style.GlobalScale);
|
table.SetupColumn("z"u8, TableColumnFlags.WidthFixed, 250 * Im.Style.GlobalScale);
|
||||||
ImGui.TableSetupColumn("w", ImGuiTableColumnFlags.WidthFixed, 250 * Im.Style.GlobalScale);
|
table.SetupColumn("w"u8, TableColumnFlags.WidthFixed, 250 * Im.Style.GlobalScale);
|
||||||
ImGui.TableHeadersRow();
|
ImGui.TableHeadersRow();
|
||||||
|
|
||||||
var textColorStart = ImGuiColor.Text.Get().Color;
|
var textColorStart = ImGuiColor.Text.Get().Color;
|
||||||
|
|
@ -436,11 +436,11 @@ public partial class ModEditWindow
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip(tooltip);
|
Im.Tooltip.OnHover(tooltip);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (deletable)
|
if (deletable)
|
||||||
ImUtf8.HoverTooltip("\nControl + Right-Click to remove."u8);
|
Im.Tooltip.OnHover("\nControl + Right-Click to remove."u8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -280,7 +280,7 @@ public partial class ModEditWindow
|
||||||
|
|
||||||
private Vector2 GetChildWidth()
|
private Vector2 GetChildWidth()
|
||||||
{
|
{
|
||||||
var windowWidth = ImGui.GetWindowContentRegionMax().X - ImGui.GetWindowContentRegionMin().X - Im.Style.TextHeight;
|
var windowWidth = Im.Window.MaximumContentRegion.X - Im.Window.MinimumContentRegion.X - Im.Style.TextHeight;
|
||||||
if (_overlayCollapsed)
|
if (_overlayCollapsed)
|
||||||
{
|
{
|
||||||
var width = windowWidth - ImGui.GetStyle().FramePadding.X * 3;
|
var width = windowWidth - ImGui.GetStyle().FramePadding.X * 3;
|
||||||
|
|
|
||||||
|
|
@ -199,8 +199,8 @@ public partial class ModEditWindow : IndexedWindow, IDisposable
|
||||||
|
|
||||||
if (IsLoading)
|
if (IsLoading)
|
||||||
{
|
{
|
||||||
var radius = 100 * ImUtf8.GlobalScale;
|
var radius = 100 * Im.Style.GlobalScale;
|
||||||
var thickness = (int)(20 * ImUtf8.GlobalScale);
|
var thickness = (int)(20 * Im.Style.GlobalScale);
|
||||||
var offsetX = Im.ContentRegion.Available.X / 2 - radius;
|
var offsetX = Im.ContentRegion.Available.X / 2 - radius;
|
||||||
var offsetY = Im.ContentRegion.Available.Y / 2 - radius;
|
var offsetY = Im.ContentRegion.Available.Y / 2 - radius;
|
||||||
ImGui.SetCursorPos(ImGui.GetCursorPos() + new Vector2(offsetX, offsetY));
|
ImGui.SetCursorPos(ImGui.GetCursorPos() + new Vector2(offsetX, offsetY));
|
||||||
|
|
@ -327,7 +327,7 @@ public partial class ModEditWindow : IndexedWindow, IDisposable
|
||||||
if (!child)
|
if (!child)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var table = ImRaii.Table("##missingFiles", 1, ImGuiTableFlags.RowBg, -Vector2.One);
|
using var table = Im.Table.Begin("##missingFiles"u8, 1, TableFlags.RowBackground, -Vector2.One);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -401,14 +401,14 @@ public partial class ModEditWindow : IndexedWindow, IDisposable
|
||||||
if (!child)
|
if (!child)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var table = ImRaii.Table("##duplicates", 3, ImGuiTableFlags.RowBg | ImGuiTableFlags.SizingFixedFit, -Vector2.One);
|
using var table = Im.Table.Begin("##duplicates"u8, 3, TableFlags.RowBackground | TableFlags.SizingFixedFit, -Vector2.One);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var width = ImGui.CalcTextSize("NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN ").X;
|
var width = ImGui.CalcTextSize("NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN ").X;
|
||||||
ImGui.TableSetupColumn("file", ImGuiTableColumnFlags.WidthStretch);
|
table.SetupColumn("file"u8, TableColumnFlags.WidthStretch);
|
||||||
ImGui.TableSetupColumn("size", ImGuiTableColumnFlags.WidthFixed, ImGui.CalcTextSize("NNN.NNN ").X);
|
table.SetupColumn("size", TableColumnFlags.WidthFixed, ImGui.CalcTextSize("NNN.NNN "u8).X);
|
||||||
ImGui.TableSetupColumn("hash", ImGuiTableColumnFlags.WidthFixed,
|
table.SetupColumn("hash"u8, TableColumnFlags.WidthFixed,
|
||||||
ImGui.GetWindowWidth() > 2 * width ? width : ImGui.CalcTextSize("NNNNNNNN... ").X);
|
ImGui.GetWindowWidth() > 2 * width ? width : ImGui.CalcTextSize("NNNNNNNN... ").X);
|
||||||
foreach (var (set, size, hash) in _editor.Duplicates.Duplicates.Where(s => s.Paths.Length > 1))
|
foreach (var (set, size, hash) in _editor.Duplicates.Duplicates.Where(s => s.Paths.Length > 1))
|
||||||
{
|
{
|
||||||
|
|
@ -507,16 +507,16 @@ public partial class ModEditWindow : IndexedWindow, IDisposable
|
||||||
if (!child)
|
if (!child)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var list = ImRaii.Table("##table", 3, ImGuiTableFlags.RowBg, -Vector2.One);
|
using var table = Im.Table.Begin("##table"u8, 3, TableFlags.RowBackground, -Vector2.One);
|
||||||
if (!list)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var idx = 0;
|
var idx = 0;
|
||||||
var iconSize = Im.Style.FrameHeight * Vector2.One;
|
var iconSize = Im.Style.FrameHeight * Vector2.One;
|
||||||
var pathSize = Im.ContentRegion.Available.X / 2 - iconSize.X;
|
var pathSize = Im.ContentRegion.Available.X / 2 - iconSize.X;
|
||||||
ImGui.TableSetupColumn("button", ImGuiTableColumnFlags.WidthFixed, iconSize.X);
|
table.SetupColumn("button"u8, TableColumnFlags.WidthFixed, iconSize.X);
|
||||||
ImGui.TableSetupColumn("source", ImGuiTableColumnFlags.WidthFixed, pathSize);
|
table.SetupColumn("source"u8, TableColumnFlags.WidthFixed, pathSize);
|
||||||
ImGui.TableSetupColumn("value", ImGuiTableColumnFlags.WidthFixed, pathSize);
|
table.SetupColumn("value"u8, TableColumnFlags.WidthFixed, pathSize);
|
||||||
|
|
||||||
foreach (var (gamePath, file) in _editor.SwapEditor.Swaps.ToList())
|
foreach (var (gamePath, file) in _editor.SwapEditor.Swaps.ToList())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ public class ModMergeTab(ModMerger modMerger, ModComboWithoutCurrent combo) : Lu
|
||||||
if (size - textSize < minComboSize)
|
if (size - textSize < minComboSize)
|
||||||
{
|
{
|
||||||
Im.Text("selected mod"u8, ColorId.FolderLine.Value());
|
Im.Text("selected mod"u8, ColorId.FolderLine.Value());
|
||||||
ImUtf8.HoverTooltip(modMerger.MergeFromMod!.Name);
|
Im.Tooltip.OnHover(modMerger.MergeFromMod!.Name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -104,8 +104,8 @@ public class ModMergeTab(ModMerger modMerger, ModComboWithoutCurrent combo) : Lu
|
||||||
}
|
}
|
||||||
|
|
||||||
if (modMerger.MergeFromMod.HasOptions)
|
if (modMerger.MergeFromMod.HasOptions)
|
||||||
ImGuiUtil.HoverTooltip("You can only specify a target option if the source mod has no true options itself.",
|
Im.Tooltip.OnHover("You can only specify a target option if the source mod has no true options itself."u8,
|
||||||
ImGuiHoveredFlags.AllowWhenDisabled);
|
HoveredFlags.AllowWhenDisabled);
|
||||||
|
|
||||||
if (ImGuiUtil.DrawDisabledButton("Merge", new Vector2(size, 0),
|
if (ImGuiUtil.DrawDisabledButton("Merge", new Vector2(size, 0),
|
||||||
modMerger.CanMerge ? string.Empty : "Please select a target mod different from the current mod.", !modMerger.CanMerge))
|
modMerger.CanMerge ? string.Empty : "Please select a target mod different from the current mod.", !modMerger.CanMerge))
|
||||||
|
|
@ -171,22 +171,22 @@ public class ModMergeTab(ModMerger modMerger, ModComboWithoutCurrent combo) : Lu
|
||||||
: 8 * Im.Style.FrameHeightWithSpacing;
|
: 8 * Im.Style.FrameHeightWithSpacing;
|
||||||
height = Math.Min(height, (options.Count + 1) * Im.Style.FrameHeightWithSpacing);
|
height = Math.Min(height, (options.Count + 1) * Im.Style.FrameHeightWithSpacing);
|
||||||
var tableSize = new Vector2(size, height);
|
var tableSize = new Vector2(size, height);
|
||||||
using var table = ImRaii.Table("##options", 6,
|
using var table = Im.Table.Begin("##options"u8, 6,
|
||||||
ImGuiTableFlags.RowBg
|
TableFlags.RowBackground
|
||||||
| ImGuiTableFlags.SizingFixedFit
|
| TableFlags.SizingFixedFit
|
||||||
| ImGuiTableFlags.ScrollY
|
| TableFlags.ScrollY
|
||||||
| ImGuiTableFlags.BordersOuterV
|
| TableFlags.BordersOuterVertical
|
||||||
| ImGuiTableFlags.BordersOuterH,
|
| TableFlags.BordersOuterHorizontal,
|
||||||
tableSize);
|
tableSize);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.TableSetupColumn("##Selected", ImGuiTableColumnFlags.WidthFixed, Im.Style.FrameHeight);
|
table.SetupColumn("##Selected"u8, TableColumnFlags.WidthFixed, Im.Style.FrameHeight);
|
||||||
ImGui.TableSetupColumn("Option", ImGuiTableColumnFlags.WidthStretch);
|
table.SetupColumn("Option"u8, TableColumnFlags.WidthStretch);
|
||||||
ImGui.TableSetupColumn("Option Group", ImGuiTableColumnFlags.WidthFixed, 120 * Im.Style.GlobalScale);
|
table.SetupColumn("Option Group"u8, TableColumnFlags.WidthFixed, 120 * Im.Style.GlobalScale);
|
||||||
ImGui.TableSetupColumn("#Files", ImGuiTableColumnFlags.WidthFixed, 50 * Im.Style.GlobalScale);
|
table.SetupColumn("#Files"u8, TableColumnFlags.WidthFixed, 50 * Im.Style.GlobalScale);
|
||||||
ImGui.TableSetupColumn("#Swaps", ImGuiTableColumnFlags.WidthFixed, 50 * Im.Style.GlobalScale);
|
table.SetupColumn("#Swaps"u8, TableColumnFlags.WidthFixed, 50 * Im.Style.GlobalScale);
|
||||||
ImGui.TableSetupColumn("#Manips", ImGuiTableColumnFlags.WidthFixed, 50 * Im.Style.GlobalScale);
|
table.SetupColumn("#Manips"u8, TableColumnFlags.WidthFixed, 50 * Im.Style.GlobalScale);
|
||||||
ImGui.TableHeadersRow();
|
ImGui.TableHeadersRow();
|
||||||
foreach (var (idx, option) in options.Index())
|
foreach (var (idx, option) in options.Index())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -142,15 +142,15 @@ public class ResourceTreeViewer(
|
||||||
ImUtf8.InputText("##note"u8, ref _note, "Export note..."u8);
|
ImUtf8.InputText("##note"u8, ref _note, "Export note..."u8);
|
||||||
|
|
||||||
|
|
||||||
using var table = ImRaii.Table("##ResourceTree", 4,
|
using var table = Im.Table.Begin("##ResourceTree"u8, 4,
|
||||||
ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.RowBg);
|
TableFlags.SizingFixedFit | TableFlags.RowBackground);
|
||||||
if (!table)
|
if (!table)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ImGui.TableSetupColumn(string.Empty, ImGuiTableColumnFlags.WidthStretch, 0.2f);
|
table.SetupColumn(StringU8.Empty, TableColumnFlags.WidthStretch, 0.2f);
|
||||||
ImGui.TableSetupColumn("Game Path", ImGuiTableColumnFlags.WidthStretch, 0.3f);
|
table.SetupColumn("Game Path"u8, TableColumnFlags.WidthStretch, 0.3f);
|
||||||
ImGui.TableSetupColumn("Actual Path", ImGuiTableColumnFlags.WidthStretch, 0.5f);
|
table.SetupColumn("Actual Path"u8, TableColumnFlags.WidthStretch, 0.5f);
|
||||||
ImGui.TableSetupColumn(string.Empty, ImGuiTableColumnFlags.WidthFixed,
|
table.SetupColumn(StringU8.Empty, TableColumnFlags.WidthFixed,
|
||||||
actionCapacity * 3 * Im.Style.GlobalScale + (actionCapacity + 1) * Im.Style.FrameHeight);
|
actionCapacity * 3 * Im.Style.GlobalScale + (actionCapacity + 1) * Im.Style.FrameHeight);
|
||||||
ImGui.TableHeadersRow();
|
ImGui.TableHeadersRow();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,114 +1,105 @@
|
||||||
using Dalamud.Interface.Utility;
|
using ImSharp;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Penumbra.Mods;
|
||||||
using ImSharp;
|
using Penumbra.Mods.Groups;
|
||||||
using OtterGui.Text;
|
using Penumbra.Mods.Manager;
|
||||||
using Penumbra.Mods;
|
using Penumbra.Mods.SubMods;
|
||||||
using Penumbra.Mods.Groups;
|
|
||||||
using Penumbra.Mods.Manager;
|
namespace Penumbra.UI.ModsTab;
|
||||||
using Penumbra.Mods.SubMods;
|
|
||||||
|
public class DescriptionEditPopup(ModManager modManager) : Luna.IUiService
|
||||||
namespace Penumbra.UI.ModsTab;
|
{
|
||||||
|
private static ReadOnlySpan<byte> PopupId
|
||||||
public class DescriptionEditPopup(ModManager modManager) : Luna.IUiService
|
=> "EditDesc"u8;
|
||||||
{
|
|
||||||
private static ReadOnlySpan<byte> PopupId
|
private bool _hasBeenEdited;
|
||||||
=> "PenumbraEditDescription"u8;
|
private string _description = string.Empty;
|
||||||
|
|
||||||
private bool _hasBeenEdited;
|
private object? _current;
|
||||||
private string _description = string.Empty;
|
private bool _opened;
|
||||||
|
|
||||||
private object? _current;
|
public void Open(Mod mod)
|
||||||
private bool _opened;
|
{
|
||||||
|
_current = mod;
|
||||||
public void Open(Mod mod)
|
_opened = true;
|
||||||
{
|
_hasBeenEdited = false;
|
||||||
_current = mod;
|
_description = mod.Description;
|
||||||
_opened = true;
|
}
|
||||||
_hasBeenEdited = false;
|
|
||||||
_description = mod.Description;
|
public void Open(IModGroup group)
|
||||||
}
|
{
|
||||||
|
_current = group;
|
||||||
public void Open(IModGroup group)
|
_opened = true;
|
||||||
{
|
_hasBeenEdited = false;
|
||||||
_current = group;
|
_description = group.Description;
|
||||||
_opened = true;
|
}
|
||||||
_hasBeenEdited = false;
|
|
||||||
_description = group.Description;
|
public void Open(IModOption option)
|
||||||
}
|
{
|
||||||
|
_current = option;
|
||||||
public void Open(IModOption option)
|
_opened = true;
|
||||||
{
|
_hasBeenEdited = false;
|
||||||
_current = option;
|
_description = option.Description;
|
||||||
_opened = true;
|
}
|
||||||
_hasBeenEdited = false;
|
|
||||||
_description = option.Description;
|
public void Draw()
|
||||||
}
|
{
|
||||||
|
if (_current == null)
|
||||||
public void Draw()
|
return;
|
||||||
{
|
|
||||||
if (_current == null)
|
if (_opened)
|
||||||
return;
|
{
|
||||||
|
_opened = false;
|
||||||
if (_opened)
|
Im.Popup.Open(PopupId);
|
||||||
{
|
}
|
||||||
_opened = false;
|
|
||||||
ImUtf8.OpenPopup(PopupId);
|
var inputSize = ImEx.ScaledVector(800);
|
||||||
}
|
using var popup = Im.Popup.Begin(PopupId);
|
||||||
|
if (!popup)
|
||||||
var inputSize = ImEx.ScaledVector(800);
|
return;
|
||||||
using var popup = ImUtf8.Popup(PopupId);
|
|
||||||
if (!popup)
|
if (Im.Window.Appearing)
|
||||||
return;
|
Im.Keyboard.SetFocusHere();
|
||||||
|
|
||||||
if (ImGui.IsWindowAppearing())
|
ImEx.InputOnDeactivation.MultiLine("##editDescription"u8, _description, out _description, inputSize);
|
||||||
ImGui.SetKeyboardFocusHere();
|
_hasBeenEdited |= Im.Item.Edited;
|
||||||
|
UiHelpers.DefaultLineSpace();
|
||||||
ImUtf8.InputMultiLineOnDeactivated("##editDescription"u8, ref _description, inputSize);
|
|
||||||
_hasBeenEdited |= ImGui.IsItemEdited();
|
var buttonSize = new Vector2(Im.Style.GlobalScale * 100, 0);
|
||||||
UiHelpers.DefaultLineSpace();
|
|
||||||
|
var width = 2 * buttonSize.X
|
||||||
var buttonSize = new Vector2(ImUtf8.GlobalScale * 100, 0);
|
+ 4 * Im.Style.FramePadding.X
|
||||||
|
+ Im.Style.ItemSpacing.X;
|
||||||
var width = 2 * buttonSize.X
|
|
||||||
+ 4 * ImUtf8.FramePadding.X
|
Im.Cursor.X = (inputSize.X - width) / 2;
|
||||||
+ ImUtf8.ItemSpacing.X;
|
DrawSaveButton(buttonSize);
|
||||||
|
Im.Line.Same();
|
||||||
ImGui.SetCursorPosX((inputSize.X - width) / 2);
|
DrawCancelButton(buttonSize);
|
||||||
DrawSaveButton(buttonSize);
|
}
|
||||||
Im.Line.Same();
|
|
||||||
DrawCancelButton(buttonSize);
|
private void DrawSaveButton(Vector2 buttonSize)
|
||||||
}
|
{
|
||||||
|
if (!ImEx.Button("Save"u8, buttonSize, _hasBeenEdited ? StringU8.Empty : "No changes made yet."u8, !_hasBeenEdited))
|
||||||
private void DrawSaveButton(Vector2 buttonSize)
|
return;
|
||||||
{
|
|
||||||
if (!ImUtf8.ButtonEx("Save"u8, _hasBeenEdited ? [] : "No changes made yet."u8, buttonSize, !_hasBeenEdited))
|
switch (_current)
|
||||||
return;
|
{
|
||||||
|
case Mod mod: modManager.DataEditor.ChangeModDescription(mod, _description); break;
|
||||||
switch (_current)
|
case IModGroup group: modManager.OptionEditor.ChangeGroupDescription(group, _description); break;
|
||||||
{
|
case IModOption option: modManager.OptionEditor.ChangeOptionDescription(option, _description); break;
|
||||||
case Mod mod:
|
}
|
||||||
modManager.DataEditor.ChangeModDescription(mod, _description);
|
|
||||||
break;
|
_description = string.Empty;
|
||||||
case IModGroup group:
|
_hasBeenEdited = false;
|
||||||
modManager.OptionEditor.ChangeGroupDescription(group, _description);
|
Im.Popup.CloseCurrent();
|
||||||
break;
|
}
|
||||||
case IModOption option:
|
|
||||||
modManager.OptionEditor.ChangeOptionDescription(option, _description);
|
private void DrawCancelButton(Vector2 buttonSize)
|
||||||
break;
|
{
|
||||||
}
|
if (!Im.Button("Cancel"u8, buttonSize) && !Im.Keyboard.IsPressed(Key.Escape))
|
||||||
|
return;
|
||||||
_description = string.Empty;
|
|
||||||
_hasBeenEdited = false;
|
_description = string.Empty;
|
||||||
ImGui.CloseCurrentPopup();
|
_hasBeenEdited = false;
|
||||||
}
|
Im.Popup.CloseCurrent();
|
||||||
|
}
|
||||||
private void DrawCancelButton(Vector2 buttonSize)
|
}
|
||||||
{
|
|
||||||
if (!ImUtf8.Button("Cancel"u8, buttonSize) && !ImGui.IsKeyPressed(ImGuiKey.Escape))
|
|
||||||
return;
|
|
||||||
|
|
||||||
_description = string.Empty;
|
|
||||||
_hasBeenEdited = false;
|
|
||||||
ImGui.CloseCurrentPopup();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,158 +1,160 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
using OtterGui.Text;
|
using ImSharp;
|
||||||
using Penumbra.Api.Enums;
|
using OtterGui.Text;
|
||||||
using Penumbra.GameData.Enums;
|
using Penumbra.Api.Enums;
|
||||||
using Penumbra.GameData.Structs;
|
using Penumbra.GameData.Enums;
|
||||||
using Penumbra.Meta;
|
using Penumbra.GameData.Structs;
|
||||||
using Penumbra.Meta.Manipulations;
|
using Penumbra.Meta;
|
||||||
using Penumbra.Mods;
|
using Penumbra.Meta.Manipulations;
|
||||||
using Penumbra.Mods.Manager;
|
using Penumbra.Mods;
|
||||||
using Penumbra.Mods.Manager.OptionEditor;
|
using Penumbra.Mods.Manager;
|
||||||
using Penumbra.UI.AdvancedWindow.Meta;
|
using Penumbra.Mods.Manager.OptionEditor;
|
||||||
using Penumbra.UI.Classes;
|
using Penumbra.UI.AdvancedWindow.Meta;
|
||||||
|
using Penumbra.UI.Classes;
|
||||||
namespace Penumbra.UI.ModsTab.Groups;
|
|
||||||
|
namespace Penumbra.UI.ModsTab.Groups;
|
||||||
public class AddGroupDrawer : Luna.IUiService
|
|
||||||
{
|
public class AddGroupDrawer : Luna.IUiService
|
||||||
private string _groupName = string.Empty;
|
{
|
||||||
private bool _groupNameValid;
|
private string _groupName = string.Empty;
|
||||||
|
private bool _groupNameValid;
|
||||||
private ImcIdentifier _imcIdentifier = ImcIdentifier.Default;
|
|
||||||
private ImcEntry _defaultEntry;
|
private ImcIdentifier _imcIdentifier = ImcIdentifier.Default;
|
||||||
private bool _imcFileExists;
|
private ImcEntry _defaultEntry;
|
||||||
private bool _entryExists;
|
private bool _imcFileExists;
|
||||||
private bool _entryInvalid;
|
private bool _entryExists;
|
||||||
private readonly ModManager _modManager;
|
private bool _entryInvalid;
|
||||||
|
private readonly ModManager _modManager;
|
||||||
public AddGroupDrawer(ModManager modManager)
|
|
||||||
{
|
public AddGroupDrawer(ModManager modManager)
|
||||||
_modManager = modManager;
|
{
|
||||||
UpdateEntry();
|
_modManager = modManager;
|
||||||
}
|
UpdateEntry();
|
||||||
|
}
|
||||||
public void Draw(Mod mod, float width)
|
|
||||||
{
|
public void Draw(Mod mod, float width)
|
||||||
var buttonWidth = new Vector2((width - ImUtf8.ItemInnerSpacing.X) / 2, 0);
|
{
|
||||||
DrawBasicGroups(mod, width, buttonWidth);
|
var buttonWidth = new Vector2((width - ImUtf8.ItemInnerSpacing.X) / 2, 0);
|
||||||
DrawImcData(mod, buttonWidth);
|
DrawBasicGroups(mod, width, buttonWidth);
|
||||||
}
|
DrawImcData(mod, buttonWidth);
|
||||||
|
}
|
||||||
private void DrawBasicGroups(Mod mod, float width, Vector2 buttonWidth)
|
|
||||||
{
|
private void DrawBasicGroups(Mod mod, float width, Vector2 buttonWidth)
|
||||||
ImGui.SetNextItemWidth(width);
|
{
|
||||||
if (ImUtf8.InputText("##name"u8, ref _groupName, "Enter New Name..."u8))
|
ImGui.SetNextItemWidth(width);
|
||||||
_groupNameValid = ModGroupEditor.VerifyFileName(mod, null, _groupName, false);
|
if (ImUtf8.InputText("##name"u8, ref _groupName, "Enter New Name..."u8))
|
||||||
|
_groupNameValid = ModGroupEditor.VerifyFileName(mod, null, _groupName, false);
|
||||||
DrawSingleGroupButton(mod, buttonWidth);
|
|
||||||
ImUtf8.SameLineInner();
|
DrawSingleGroupButton(mod, buttonWidth);
|
||||||
DrawMultiGroupButton(mod, buttonWidth);
|
ImUtf8.SameLineInner();
|
||||||
DrawCombiningGroupButton(mod, buttonWidth);
|
DrawMultiGroupButton(mod, buttonWidth);
|
||||||
}
|
DrawCombiningGroupButton(mod, buttonWidth);
|
||||||
|
}
|
||||||
private void DrawSingleGroupButton(Mod mod, Vector2 width)
|
|
||||||
{
|
private void DrawSingleGroupButton(Mod mod, Vector2 width)
|
||||||
if (!ImUtf8.ButtonEx("Add Single Group"u8, _groupNameValid
|
{
|
||||||
? "Add a new single selection option group to this mod."u8
|
if (!ImUtf8.ButtonEx("Add Single Group"u8, _groupNameValid
|
||||||
: "Can not add a new group of this name."u8,
|
? "Add a new single selection option group to this mod."u8
|
||||||
width, !_groupNameValid))
|
: "Can not add a new group of this name."u8,
|
||||||
return;
|
width, !_groupNameValid))
|
||||||
|
return;
|
||||||
_modManager.OptionEditor.AddModGroup(mod, GroupType.Single, _groupName);
|
|
||||||
_groupName = string.Empty;
|
_modManager.OptionEditor.AddModGroup(mod, GroupType.Single, _groupName);
|
||||||
_groupNameValid = false;
|
_groupName = string.Empty;
|
||||||
}
|
_groupNameValid = false;
|
||||||
|
}
|
||||||
private void DrawMultiGroupButton(Mod mod, Vector2 width)
|
|
||||||
{
|
private void DrawMultiGroupButton(Mod mod, Vector2 width)
|
||||||
if (!ImUtf8.ButtonEx("Add Multi Group"u8, _groupNameValid
|
{
|
||||||
? "Add a new multi selection option group to this mod."u8
|
if (!ImUtf8.ButtonEx("Add Multi Group"u8, _groupNameValid
|
||||||
: "Can not add a new group of this name."u8,
|
? "Add a new multi selection option group to this mod."u8
|
||||||
width, !_groupNameValid))
|
: "Can not add a new group of this name."u8,
|
||||||
return;
|
width, !_groupNameValid))
|
||||||
|
return;
|
||||||
_modManager.OptionEditor.AddModGroup(mod, GroupType.Multi, _groupName);
|
|
||||||
_groupName = string.Empty;
|
_modManager.OptionEditor.AddModGroup(mod, GroupType.Multi, _groupName);
|
||||||
_groupNameValid = false;
|
_groupName = string.Empty;
|
||||||
}
|
_groupNameValid = false;
|
||||||
|
}
|
||||||
private void DrawCombiningGroupButton(Mod mod, Vector2 width)
|
|
||||||
{
|
private void DrawCombiningGroupButton(Mod mod, Vector2 width)
|
||||||
if (!ImUtf8.ButtonEx("Add Combining Group"u8, _groupNameValid
|
{
|
||||||
? "Add a new combining option group to this mod."u8
|
if (!ImUtf8.ButtonEx("Add Combining Group"u8, _groupNameValid
|
||||||
: "Can not add a new group of this name."u8,
|
? "Add a new combining option group to this mod."u8
|
||||||
width, !_groupNameValid))
|
: "Can not add a new group of this name."u8,
|
||||||
return;
|
width, !_groupNameValid))
|
||||||
|
return;
|
||||||
_modManager.OptionEditor.AddModGroup(mod, GroupType.Combining, _groupName);
|
|
||||||
_groupName = string.Empty;
|
_modManager.OptionEditor.AddModGroup(mod, GroupType.Combining, _groupName);
|
||||||
_groupNameValid = false;
|
_groupName = string.Empty;
|
||||||
}
|
_groupNameValid = false;
|
||||||
private void DrawImcInput(float width)
|
}
|
||||||
{
|
|
||||||
var change = ImcMetaDrawer.DrawObjectType(ref _imcIdentifier, width);
|
private void DrawImcInput(float width)
|
||||||
ImUtf8.SameLineInner();
|
{
|
||||||
change |= ImcMetaDrawer.DrawPrimaryId(ref _imcIdentifier, width);
|
var change = ImcMetaDrawer.DrawObjectType(ref _imcIdentifier, width);
|
||||||
if (_imcIdentifier.ObjectType is ObjectType.Weapon or ObjectType.Monster)
|
ImUtf8.SameLineInner();
|
||||||
{
|
change |= ImcMetaDrawer.DrawPrimaryId(ref _imcIdentifier, width);
|
||||||
change |= ImcMetaDrawer.DrawSecondaryId(ref _imcIdentifier, width);
|
if (_imcIdentifier.ObjectType is ObjectType.Weapon or ObjectType.Monster)
|
||||||
ImUtf8.SameLineInner();
|
{
|
||||||
change |= ImcMetaDrawer.DrawVariant(ref _imcIdentifier, width);
|
change |= ImcMetaDrawer.DrawSecondaryId(ref _imcIdentifier, width);
|
||||||
}
|
ImUtf8.SameLineInner();
|
||||||
else if (_imcIdentifier.ObjectType is ObjectType.DemiHuman)
|
change |= ImcMetaDrawer.DrawVariant(ref _imcIdentifier, width);
|
||||||
{
|
}
|
||||||
var quarterWidth = (width - ImUtf8.ItemInnerSpacing.X / ImUtf8.GlobalScale) / 2;
|
else if (_imcIdentifier.ObjectType is ObjectType.DemiHuman)
|
||||||
change |= ImcMetaDrawer.DrawSecondaryId(ref _imcIdentifier, width);
|
{
|
||||||
ImUtf8.SameLineInner();
|
var quarterWidth = (width - ImUtf8.ItemInnerSpacing.X / Im.Style.GlobalScale) / 2;
|
||||||
change |= ImcMetaDrawer.DrawSlot(ref _imcIdentifier, quarterWidth);
|
change |= ImcMetaDrawer.DrawSecondaryId(ref _imcIdentifier, width);
|
||||||
ImUtf8.SameLineInner();
|
ImUtf8.SameLineInner();
|
||||||
change |= ImcMetaDrawer.DrawVariant(ref _imcIdentifier, quarterWidth);
|
change |= ImcMetaDrawer.DrawSlot(ref _imcIdentifier, quarterWidth);
|
||||||
}
|
ImUtf8.SameLineInner();
|
||||||
else
|
change |= ImcMetaDrawer.DrawVariant(ref _imcIdentifier, quarterWidth);
|
||||||
{
|
}
|
||||||
change |= ImcMetaDrawer.DrawSlot(ref _imcIdentifier, width);
|
else
|
||||||
ImUtf8.SameLineInner();
|
{
|
||||||
change |= ImcMetaDrawer.DrawVariant(ref _imcIdentifier, width);
|
change |= ImcMetaDrawer.DrawSlot(ref _imcIdentifier, width);
|
||||||
}
|
ImUtf8.SameLineInner();
|
||||||
|
change |= ImcMetaDrawer.DrawVariant(ref _imcIdentifier, width);
|
||||||
if (change)
|
}
|
||||||
UpdateEntry();
|
|
||||||
}
|
if (change)
|
||||||
|
UpdateEntry();
|
||||||
private void DrawImcData(Mod mod, Vector2 width)
|
}
|
||||||
{
|
|
||||||
var halfWidth = width.X / ImUtf8.GlobalScale;
|
private void DrawImcData(Mod mod, Vector2 width)
|
||||||
DrawImcInput(halfWidth);
|
{
|
||||||
DrawImcButton(mod, width);
|
var halfWidth = width.X / Im.Style.GlobalScale;
|
||||||
}
|
DrawImcInput(halfWidth);
|
||||||
|
DrawImcButton(mod, width);
|
||||||
private void DrawImcButton(Mod mod, Vector2 width)
|
}
|
||||||
{
|
|
||||||
if (ImUtf8.ButtonEx("Add IMC Group"u8, !_groupNameValid
|
private void DrawImcButton(Mod mod, Vector2 width)
|
||||||
? "Can not add a new group of this name."u8
|
{
|
||||||
: _entryInvalid
|
if (ImUtf8.ButtonEx("Add IMC Group"u8, !_groupNameValid
|
||||||
? "The associated IMC entry is invalid."u8
|
? "Can not add a new group of this name."u8
|
||||||
: "Add a new multi selection option group to this mod."u8,
|
: _entryInvalid
|
||||||
width, !_groupNameValid || _entryInvalid))
|
? "The associated IMC entry is invalid."u8
|
||||||
{
|
: "Add a new multi selection option group to this mod."u8,
|
||||||
_modManager.OptionEditor.ImcEditor.AddModGroup(mod, _groupName, _imcIdentifier, _defaultEntry);
|
width, !_groupNameValid || _entryInvalid))
|
||||||
_groupName = string.Empty;
|
{
|
||||||
_groupNameValid = false;
|
_modManager.OptionEditor.ImcEditor.AddModGroup(mod, _groupName, _imcIdentifier, _defaultEntry);
|
||||||
}
|
_groupName = string.Empty;
|
||||||
|
_groupNameValid = false;
|
||||||
if (_entryInvalid)
|
}
|
||||||
{
|
|
||||||
ImUtf8.SameLineInner();
|
if (_entryInvalid)
|
||||||
var text = _imcFileExists
|
{
|
||||||
? "IMC Entry Does Not Exist"u8
|
ImUtf8.SameLineInner();
|
||||||
: "IMC File Does Not Exist"u8;
|
var text = _imcFileExists
|
||||||
ImUtf8.TextFramed(text, Colors.PressEnterWarningBg, width);
|
? "IMC Entry Does Not Exist"u8
|
||||||
}
|
: "IMC File Does Not Exist"u8;
|
||||||
}
|
ImUtf8.TextFramed(text, Colors.PressEnterWarningBg, width);
|
||||||
|
}
|
||||||
private void UpdateEntry()
|
}
|
||||||
{
|
|
||||||
(_defaultEntry, _imcFileExists, _entryExists) = ImcChecker.GetDefaultEntry(_imcIdentifier, false);
|
private void UpdateEntry()
|
||||||
_entryInvalid = !_imcIdentifier.Validate() || _defaultEntry.MaterialId == 0 || !_entryExists;
|
{
|
||||||
}
|
(_defaultEntry, _imcFileExists, _entryExists) = ImcChecker.GetDefaultEntry(_imcIdentifier, false);
|
||||||
}
|
_entryInvalid = !_imcIdentifier.Validate() || _defaultEntry.MaterialId == 0 || !_entryExists;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,11 +57,11 @@ public readonly struct CombiningModGroupEditDrawer(ModGroupEditDrawer editor, Co
|
||||||
{
|
{
|
||||||
if (ImUtf8.ButtonEx("Edit Container Names"u8,
|
if (ImUtf8.ButtonEx("Edit Container Names"u8,
|
||||||
"Add optional names to separate data containers of the combining group.\nThose are just for easier identification while editing the mod, and are not generally displayed to the user."u8,
|
"Add optional names to separate data containers of the combining group.\nThose are just for easier identification while editing the mod, and are not generally displayed to the user."u8,
|
||||||
new Vector2(400 * ImUtf8.GlobalScale, 0)))
|
new Vector2(400 * Im.Style.GlobalScale, 0)))
|
||||||
ImUtf8.OpenPopup("DataContainerNames"u8);
|
ImUtf8.OpenPopup("DataContainerNames"u8);
|
||||||
|
|
||||||
var sizeX = group.OptionData.Count * (ImGui.GetStyle().ItemInnerSpacing.X + Im.Style.FrameHeight) + 300 * ImUtf8.GlobalScale;
|
var sizeX = group.OptionData.Count * (ImGui.GetStyle().ItemInnerSpacing.X + Im.Style.FrameHeight) + 300 * Im.Style.GlobalScale;
|
||||||
ImGui.SetNextWindowSize(new Vector2(sizeX, Im.Style.FrameHeightWithSpacing * Math.Min(16, group.Data.Count) + 200 * ImUtf8.GlobalScale));
|
ImGui.SetNextWindowSize(new Vector2(sizeX, Im.Style.FrameHeightWithSpacing * Math.Min(16, group.Data.Count) + 200 * Im.Style.GlobalScale));
|
||||||
using var popup = ImUtf8.Popup("DataContainerNames"u8);
|
using var popup = ImUtf8.Popup("DataContainerNames"u8);
|
||||||
if (!popup)
|
if (!popup)
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -22,20 +22,20 @@ public readonly struct ImcModGroupEditDrawer(ModGroupEditDrawer editor, ImcModGr
|
||||||
var entry = group.DefaultEntry;
|
var entry = group.DefaultEntry;
|
||||||
var changes = false;
|
var changes = false;
|
||||||
|
|
||||||
var width = editor.AvailableWidth.X - 3 * ImUtf8.ItemInnerSpacing.X - ImUtf8.ItemSpacing.X - ImUtf8.CalcTextSize("All Variants"u8).X - ImUtf8.CalcTextSize("Only Attributes"u8).X - 2 * ImUtf8.FrameHeight;
|
var width = editor.AvailableWidth.X - 3 * ImUtf8.ItemInnerSpacing.X - Im.Style.ItemSpacing.X - ImUtf8.CalcTextSize("All Variants"u8).X - ImUtf8.CalcTextSize("Only Attributes"u8).X - 2 * ImUtf8.FrameHeight;
|
||||||
ImEx.TextFramed(identifier.ToString(), new Vector2(width, 0), Rgba32.Transparent);
|
ImEx.TextFramed(identifier.ToString(), new Vector2(width, 0), Rgba32.Transparent);
|
||||||
|
|
||||||
ImUtf8.SameLineInner();
|
ImUtf8.SameLineInner();
|
||||||
var allVariants = group.AllVariants;
|
var allVariants = group.AllVariants;
|
||||||
if (ImUtf8.Checkbox("All Variants"u8, ref allVariants))
|
if (ImUtf8.Checkbox("All Variants"u8, ref allVariants))
|
||||||
editor.ModManager.OptionEditor.ImcEditor.ChangeAllVariants(group, allVariants);
|
editor.ModManager.OptionEditor.ImcEditor.ChangeAllVariants(group, allVariants);
|
||||||
ImUtf8.HoverTooltip("Make this group overwrite all corresponding variants for this identifier, not just the one specified."u8);
|
Im.Tooltip.OnHover("Make this group overwrite all corresponding variants for this identifier, not just the one specified."u8);
|
||||||
|
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
var onlyAttributes = group.OnlyAttributes;
|
var onlyAttributes = group.OnlyAttributes;
|
||||||
if (ImUtf8.Checkbox("Only Attributes"u8, ref onlyAttributes))
|
if (ImUtf8.Checkbox("Only Attributes"u8, ref onlyAttributes))
|
||||||
editor.ModManager.OptionEditor.ImcEditor.ChangeOnlyAttributes(group, onlyAttributes);
|
editor.ModManager.OptionEditor.ImcEditor.ChangeOnlyAttributes(group, onlyAttributes);
|
||||||
ImUtf8.HoverTooltip("Only overwrite the attribute flags and take all the other values from the game's default entry instead of the one configured here.\n\nMainly useful if used with All Variants to keep the material IDs for each variant."u8);
|
Im.Tooltip.OnHover("Only overwrite the attribute flags and take all the other values from the game's default entry instead of the one configured here.\n\nMainly useful if used with All Variants to keep the material IDs for each variant."u8);
|
||||||
|
|
||||||
using (ImUtf8.Group())
|
using (ImUtf8.Group())
|
||||||
{
|
{
|
||||||
|
|
@ -162,7 +162,7 @@ public readonly struct ImcModGroupEditDrawer(ModGroupEditDrawer editor, ImcModGr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, "ABCDEFGHIJ"u8.Slice(i, 1));
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, "ABCDEFGHIJ"u8.Slice(i, 1));
|
||||||
if (i != 9)
|
if (i != 9)
|
||||||
ImUtf8.SameLineInner();
|
ImUtf8.SameLineInner();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ public sealed class ModGroupEditDrawer(
|
||||||
var tt = _isGroupNameValid
|
var tt = _isGroupNameValid
|
||||||
? "Change the Group name."u8
|
? "Change the Group name."u8
|
||||||
: "Current name can not be used for this group."u8;
|
: "Current name can not be used for this group."u8;
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, tt);
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, tt);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawGroupDelete(IModGroup group)
|
private void DrawGroupDelete(IModGroup group)
|
||||||
|
|
@ -129,9 +129,9 @@ public sealed class ModGroupEditDrawer(
|
||||||
ActionQueue.Enqueue(() => ModManager.OptionEditor.DeleteModGroup(group));
|
ActionQueue.Enqueue(() => ModManager.OptionEditor.DeleteModGroup(group));
|
||||||
|
|
||||||
if (_deleteEnabled)
|
if (_deleteEnabled)
|
||||||
ImUtf8.HoverTooltip("Delete this option group."u8);
|
Im.Tooltip.OnHover("Delete this option group."u8);
|
||||||
else
|
else
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled,
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled,
|
||||||
$"Delete this option group.\nHold {config.DeleteModModifier} while clicking to delete.");
|
$"Delete this option group.\nHold {config.DeleteModModifier} while clicking to delete.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -172,9 +172,9 @@ public sealed class ModGroupEditDrawer(
|
||||||
ActionQueue.Enqueue(() => ModManager.OptionEditor.MoveModGroup(group, idx - 1));
|
ActionQueue.Enqueue(() => ModManager.OptionEditor.MoveModGroup(group, idx - 1));
|
||||||
|
|
||||||
if (isFirst)
|
if (isFirst)
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, "Can not move this group further upwards."u8);
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, "Can not move this group further upwards."u8);
|
||||||
else
|
else
|
||||||
ImUtf8.HoverTooltip($"Move this group up to group {idx}.");
|
Im.Tooltip.OnHover($"Move this group up to group {idx}.");
|
||||||
|
|
||||||
|
|
||||||
ImUtf8.SameLineInner();
|
ImUtf8.SameLineInner();
|
||||||
|
|
@ -183,9 +183,9 @@ public sealed class ModGroupEditDrawer(
|
||||||
ActionQueue.Enqueue(() => ModManager.OptionEditor.MoveModGroup(group, idx + 1));
|
ActionQueue.Enqueue(() => ModManager.OptionEditor.MoveModGroup(group, idx + 1));
|
||||||
|
|
||||||
if (isLast)
|
if (isLast)
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, "Can not move this group further downwards."u8);
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, "Can not move this group further downwards."u8);
|
||||||
else
|
else
|
||||||
ImUtf8.HoverTooltip($"Move this group down to group {idx + 2}.");
|
Im.Tooltip.OnHover($"Move this group down to group {idx + 2}.");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawGroupOpenFile(IModGroup group, int idx)
|
private void DrawGroupOpenFile(IModGroup group, int idx)
|
||||||
|
|
@ -203,9 +203,9 @@ public sealed class ModGroupEditDrawer(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fileExists)
|
if (fileExists)
|
||||||
ImUtf8.HoverTooltip($"Open the {group.Name} json file in the text editor of your choice.");
|
Im.Tooltip.OnHover($"Open the {group.Name} json file in the text editor of your choice.");
|
||||||
else
|
else
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, $"The {group.Name} json file does not exist.");
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, $"The {group.Name} json file does not exist.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -224,7 +224,7 @@ public sealed class ModGroupEditDrawer(
|
||||||
var isDefaultOption = group.DefaultSettings.AsIndex == optionIdx;
|
var isDefaultOption = group.DefaultSettings.AsIndex == optionIdx;
|
||||||
if (ImUtf8.RadioButton("##default"u8, isDefaultOption))
|
if (ImUtf8.RadioButton("##default"u8, isDefaultOption))
|
||||||
ModManager.OptionEditor.ChangeModGroupDefaultOption(group, Setting.Single(optionIdx));
|
ModManager.OptionEditor.ChangeModGroupDefaultOption(group, Setting.Single(optionIdx));
|
||||||
ImUtf8.HoverTooltip($"Set {option.Name} as the default choice for this group.");
|
Im.Tooltip.OnHover($"Set {option.Name} as the default choice for this group.");
|
||||||
}
|
}
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
|
@ -233,7 +233,7 @@ public sealed class ModGroupEditDrawer(
|
||||||
var isDefaultOption = group.DefaultSettings.HasFlag(optionIdx);
|
var isDefaultOption = group.DefaultSettings.HasFlag(optionIdx);
|
||||||
if (ImUtf8.Checkbox("##default"u8, ref isDefaultOption))
|
if (ImUtf8.Checkbox("##default"u8, ref isDefaultOption))
|
||||||
ModManager.OptionEditor.ChangeModGroupDefaultOption(group, group.DefaultSettings.SetBit(optionIdx, isDefaultOption));
|
ModManager.OptionEditor.ChangeModGroupDefaultOption(group, group.DefaultSettings.SetBit(optionIdx, isDefaultOption));
|
||||||
ImUtf8.HoverTooltip($"{(isDefaultOption ? "Disable"u8 : "Enable"u8)} {option.Name} per default in this group.");
|
Im.Tooltip.OnHover($"{(isDefaultOption ? "Disable"u8 : "Enable"u8)} {option.Name} per default in this group.");
|
||||||
}
|
}
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
|
@ -250,7 +250,7 @@ public sealed class ModGroupEditDrawer(
|
||||||
ImGui.SetNextItemWidth(PriorityWidth);
|
ImGui.SetNextItemWidth(PriorityWidth);
|
||||||
if (ImUtf8.InputScalarOnDeactivated("##Priority"u8, ref priority))
|
if (ImUtf8.InputScalarOnDeactivated("##Priority"u8, ref priority))
|
||||||
ModManager.OptionEditor.MultiEditor.ChangeOptionPriority(option, new ModPriority(priority));
|
ModManager.OptionEditor.MultiEditor.ChangeOptionPriority(option, new ModPriority(priority));
|
||||||
ImUtf8.HoverTooltip("Option priority inside the mod."u8);
|
Im.Tooltip.OnHover("Option priority inside the mod."u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
|
@ -269,9 +269,9 @@ public sealed class ModGroupEditDrawer(
|
||||||
ActionQueue.Enqueue(() => ModManager.OptionEditor.DeleteOption(option));
|
ActionQueue.Enqueue(() => ModManager.OptionEditor.DeleteOption(option));
|
||||||
|
|
||||||
if (_deleteEnabled)
|
if (_deleteEnabled)
|
||||||
ImUtf8.HoverTooltip("Delete this option."u8);
|
Im.Tooltip.OnHover("Delete this option."u8);
|
||||||
else
|
else
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled,
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled,
|
||||||
$"Delete this option.\nHold {config.DeleteModModifier} while clicking to delete.");
|
$"Delete this option.\nHold {config.DeleteModModifier} while clicking to delete.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -357,9 +357,9 @@ public sealed class ModGroupEditDrawer(
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
private void PrepareStyle()
|
private void PrepareStyle()
|
||||||
{
|
{
|
||||||
var totalWidth = 400f * ImUtf8.GlobalScale;
|
var totalWidth = 400f * Im.Style.GlobalScale;
|
||||||
_buttonSize = new Vector2(ImUtf8.FrameHeight);
|
_buttonSize = new Vector2(ImUtf8.FrameHeight);
|
||||||
PriorityWidth = 50 * ImUtf8.GlobalScale;
|
PriorityWidth = 50 * Im.Style.GlobalScale;
|
||||||
AvailableWidth = new Vector2(totalWidth + 3 * _spacing + 2 * _buttonSize.X + PriorityWidth, 0);
|
AvailableWidth = new Vector2(totalWidth + 3 * _spacing + 2 * _buttonSize.X + PriorityWidth, 0);
|
||||||
_groupNameWidth = totalWidth - 3 * (_buttonSize.X + _spacing);
|
_groupNameWidth = totalWidth - 3 * (_buttonSize.X + _spacing);
|
||||||
_spacing = ImGui.GetStyle().ItemInnerSpacing.X;
|
_spacing = ImGui.GetStyle().ItemInnerSpacing.X;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using Penumbra.Mods.Groups;
|
using Penumbra.Mods.Groups;
|
||||||
|
|
@ -43,7 +44,7 @@ public readonly struct SingleModGroupEditDrawer(ModGroupEditDrawer editor, Singl
|
||||||
if (ImUtf8.ButtonEx("Convert to Multi Group", editor.AvailableWidth, !convertible))
|
if (ImUtf8.ButtonEx("Convert to Multi Group", editor.AvailableWidth, !convertible))
|
||||||
editor.ActionQueue.Enqueue(() => e.ChangeToMulti(g));
|
editor.ActionQueue.Enqueue(() => e.ChangeToMulti(g));
|
||||||
if (!convertible)
|
if (!convertible)
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled,
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled,
|
||||||
"Can not convert to multi group since maximum number of options is exceeded."u8);
|
"Can not convert to multi group since maximum number of options is exceeded."u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -144,10 +144,10 @@ public sealed class ModFileSystemSelector : FileSystemSelector<Mod, ModFileSyste
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override float CurrentWidth
|
protected override float CurrentWidth
|
||||||
=> _config.Ephemeral.CurrentModSelectorWidth * ImUtf8.GlobalScale;
|
=> _config.Ephemeral.CurrentModSelectorWidth * Im.Style.GlobalScale;
|
||||||
|
|
||||||
protected override float MinimumAbsoluteRemainder
|
protected override float MinimumAbsoluteRemainder
|
||||||
=> 550 * ImUtf8.GlobalScale;
|
=> 550 * Im.Style.GlobalScale;
|
||||||
|
|
||||||
protected override float MinimumScaling
|
protected override float MinimumScaling
|
||||||
=> _config.Ephemeral.ModSelectorMinimumScale;
|
=> _config.Ephemeral.ModSelectorMinimumScale;
|
||||||
|
|
@ -158,7 +158,7 @@ public sealed class ModFileSystemSelector : FileSystemSelector<Mod, ModFileSyste
|
||||||
protected override void SetSize(Vector2 size)
|
protected override void SetSize(Vector2 size)
|
||||||
{
|
{
|
||||||
base.SetSize(size);
|
base.SetSize(size);
|
||||||
var adaptedSize = MathF.Round(size.X / ImUtf8.GlobalScale);
|
var adaptedSize = MathF.Round(size.X / Im.Style.GlobalScale);
|
||||||
if (adaptedSize == _config.Ephemeral.CurrentModSelectorWidth)
|
if (adaptedSize == _config.Ephemeral.CurrentModSelectorWidth)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -257,7 +257,7 @@ public sealed class ModFileSystemSelector : FileSystemSelector<Mod, ModFileSyste
|
||||||
{
|
{
|
||||||
var line = ImGui.GetItemRectMin().Y;
|
var line = ImGui.GetItemRectMin().Y;
|
||||||
var itemPos = ImGui.GetItemRectMax().X;
|
var itemPos = ImGui.GetItemRectMax().X;
|
||||||
var maxWidth = ImGui.GetWindowPos().X + ImGui.GetWindowContentRegionMax().X;
|
var maxWidth = ImGui.GetWindowPos().X + Im.Window.MaximumContentRegion.X;
|
||||||
var priorityString = $"[{state.Priority}]";
|
var priorityString = $"[{state.Priority}]";
|
||||||
var size = ImGui.CalcTextSize(priorityString).X;
|
var size = ImGui.CalcTextSize(priorityString).X;
|
||||||
var remainingSpace = maxWidth - itemPos;
|
var remainingSpace = maxWidth - itemPos;
|
||||||
|
|
@ -405,10 +405,10 @@ public sealed class ModFileSystemSelector : FileSystemSelector<Mod, ModFileSyste
|
||||||
if (ImUtf8.InputText("##RenameMod"u8, ref currentName, flags: ImGuiInputTextFlags.EnterReturnsTrue))
|
if (ImUtf8.InputText("##RenameMod"u8, ref currentName, flags: ImGuiInputTextFlags.EnterReturnsTrue))
|
||||||
{
|
{
|
||||||
_modManager.DataEditor.ChangeModName(leaf.Value, currentName);
|
_modManager.DataEditor.ChangeModName(leaf.Value, currentName);
|
||||||
ImGui.CloseCurrentPopup();
|
Im.Popup.CloseCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip("Enter a new name here to rename the changed mod."u8);
|
Im.Tooltip.OnHover("Enter a new name here to rename the changed mod."u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DeleteModButton(Vector2 size)
|
private void DeleteModButton(Vector2 size)
|
||||||
|
|
@ -845,7 +845,7 @@ public sealed class ModFileSystemSelector : FileSystemSelector<Mod, ModFileSyste
|
||||||
SetFilterDirty();
|
SetFilterDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip("Filter mods for their activation status.\nRight-Click to clear all filters."u8);
|
Im.Tooltip.OnHover("Filter mods for their activation status.\nRight-Click to clear all filters."u8);
|
||||||
ImGui.SetCursorPos(pos);
|
ImGui.SetCursorPos(pos);
|
||||||
return (remainingWidth, rightClick);
|
return (remainingWidth, rightClick);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
using Dalamud.Interface.Utility.Raii;
|
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using ImSharp;
|
using ImSharp;
|
||||||
using Penumbra.Mods;
|
using Penumbra.Mods;
|
||||||
|
|
@ -37,13 +35,13 @@ public class ModPanel : IDisposable, Luna.IUiService
|
||||||
if (_resetCursor)
|
if (_resetCursor)
|
||||||
{
|
{
|
||||||
_resetCursor = false;
|
_resetCursor = false;
|
||||||
ImGui.SetScrollX(0);
|
Im.Scroll.X = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
_header.Draw();
|
_header.Draw();
|
||||||
ImGui.SetCursorPosX(ImGui.GetScrollX() + ImGui.GetCursorPosX());
|
Im.Cursor.X += Im.Scroll.X;
|
||||||
using var child = ImRaii.Child("Tabs",
|
using var child = Im.Child.Begin("Tabs"u8,
|
||||||
Im.ContentRegion.Available with { X = ImGui.GetWindowContentRegionMax().X - ImGui.GetWindowContentRegionMin().X });
|
Im.ContentRegion.Available with { X = Im.Window.MaximumContentRegion.X - Im.Window.MinimumContentRegion.X });
|
||||||
if (child)
|
if (child)
|
||||||
_tabs.Draw(_mod);
|
_tabs.Draw(_mod);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -236,7 +236,7 @@ public class ModPanelChangedItemsTab(
|
||||||
.Push(ImGuiColor.ButtonActive, Rgba32.Transparent)
|
.Push(ImGuiColor.ButtonActive, Rgba32.Transparent)
|
||||||
.Push(ImGuiColor.ButtonHovered, Rgba32.Transparent);
|
.Push(ImGuiColor.ButtonHovered, Rgba32.Transparent);
|
||||||
|
|
||||||
using var table = ImUtf8.Table("##changedItems"u8, cache.AnyExpandable ? 2 : 1, ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollY,
|
using var table = Im.Table.Begin("##changedItems"u8, cache.AnyExpandable ? 2 : 1, TableFlags.RowBackground | TableFlags.ScrollY,
|
||||||
new Vector2(Im.ContentRegion.Available.X, -1));
|
new Vector2(Im.ContentRegion.Available.X, -1));
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
@ -244,8 +244,8 @@ public class ModPanelChangedItemsTab(
|
||||||
_starColor = ColorId.ChangedItemPreferenceStar.Value();
|
_starColor = ColorId.ChangedItemPreferenceStar.Value();
|
||||||
if (cache.AnyExpandable)
|
if (cache.AnyExpandable)
|
||||||
{
|
{
|
||||||
ImUtf8.TableSetupColumn("##exp"u8, ImGuiTableColumnFlags.WidthFixed, _buttonSize.Y);
|
table.SetupColumn("##exp"u8, TableColumnFlags.WidthFixed, _buttonSize.Y);
|
||||||
ImUtf8.TableSetupColumn("##text"u8, ImGuiTableColumnFlags.WidthStretch);
|
table.SetupColumn("##text"u8, TableColumnFlags.WidthStretch);
|
||||||
ImGuiClip.ClippedDraw(cache.Data, DrawContainerExpandable, _buttonSize.Y);
|
ImGuiClip.ClippedDraw(cache.Data, DrawContainerExpandable, _buttonSize.Y);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -41,15 +41,15 @@ public class ModPanelCollectionsTab(CollectionManager manager, ModFileSystemSele
|
||||||
Im.Line.New();
|
Im.Line.New();
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
Im.Line.New();
|
Im.Line.New();
|
||||||
using var table = ImUtf8.Table("##modCollections"u8, 3, ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.RowBg);
|
using var table = Im.Table.Begin("##modCollections"u8, 3, TableFlags.SizingFixedFit | TableFlags.RowBackground);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var size = ImUtf8.CalcTextSize(ToText(ModState.Unconfigured)).X + 20 * Im.Style.GlobalScale;
|
var size = ImUtf8.CalcTextSize(ToText(ModState.Unconfigured)).X + 20 * Im.Style.GlobalScale;
|
||||||
var collectionSize = 200 * Im.Style.GlobalScale;
|
var collectionSize = 200 * Im.Style.GlobalScale;
|
||||||
ImGui.TableSetupColumn("Collection", ImGuiTableColumnFlags.WidthFixed, collectionSize);
|
table.SetupColumn("Collection"u8, TableColumnFlags.WidthFixed, collectionSize);
|
||||||
ImGui.TableSetupColumn("State", ImGuiTableColumnFlags.WidthFixed, size);
|
table.SetupColumn("State"u8, TableColumnFlags.WidthFixed, size);
|
||||||
ImGui.TableSetupColumn("Inherited From", ImGuiTableColumnFlags.WidthFixed, collectionSize);
|
table.SetupColumn("Inherited From"u8, TableColumnFlags.WidthFixed, collectionSize);
|
||||||
|
|
||||||
ImGui.TableHeadersRow();
|
ImGui.TableHeadersRow();
|
||||||
foreach (var (idx, (collection, parent, color, state)) in _cache.Index())
|
foreach (var (idx, (collection, parent, color, state)) in _cache.Index())
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,6 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Utility;
|
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
using ImSharp;
|
using ImSharp;
|
||||||
using OtterGui;
|
using Luna;
|
||||||
using OtterGui.Raii;
|
|
||||||
using OtterGui.Text;
|
|
||||||
using OtterGui.Widgets;
|
using OtterGui.Widgets;
|
||||||
using Penumbra.Collections.Cache;
|
using Penumbra.Collections.Cache;
|
||||||
using Penumbra.Collections.Manager;
|
using Penumbra.Collections.Manager;
|
||||||
|
|
@ -17,10 +13,8 @@ using Penumbra.UI.Classes;
|
||||||
|
|
||||||
namespace Penumbra.UI.ModsTab;
|
namespace Penumbra.UI.ModsTab;
|
||||||
|
|
||||||
public class ModPanelConflictsTab(CollectionManager collectionManager, ModFileSystemSelector selector) : ITab, Luna.IUiService
|
public class ModPanelConflictsTab(CollectionManager collectionManager, ModFileSystemSelector selector) : ITab, IUiService
|
||||||
{
|
{
|
||||||
private int? _currentPriority;
|
|
||||||
|
|
||||||
public ReadOnlySpan<byte> Label
|
public ReadOnlySpan<byte> Label
|
||||||
=> "Conflicts"u8;
|
=> "Conflicts"u8;
|
||||||
|
|
||||||
|
|
@ -39,22 +33,22 @@ public class ModPanelConflictsTab(CollectionManager collectionManager, ModFileSy
|
||||||
|
|
||||||
public void DrawContent()
|
public void DrawContent()
|
||||||
{
|
{
|
||||||
using var table = ImRaii.Table("conflicts", 3, ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollY, Im.ContentRegion.Available);
|
using var table = Im.Table.Begin("conflicts"u8, 3, TableFlags.RowBackground | TableFlags.ScrollY, Im.ContentRegion.Available);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var buttonSize = new Vector2(Im.Style.FrameHeight);
|
var buttonSize = new Vector2(Im.Style.FrameHeight);
|
||||||
var spacing = ImGui.GetStyle().ItemInnerSpacing with { Y = ImGui.GetStyle().ItemSpacing.Y };
|
var spacing = Im.Style.ItemInnerSpacing with { Y = Im.Style.ItemSpacing.Y };
|
||||||
var priorityRowWidth = ImGui.CalcTextSize("Priority").X + 20 * Im.Style.GlobalScale + 2 * buttonSize.X;
|
var priorityRowWidth = Im.Font.CalculateSize("Priority"u8).X + 20 * Im.Style.GlobalScale + 2 * buttonSize.X;
|
||||||
var priorityWidth = priorityRowWidth - 2 * (buttonSize.X + spacing.X);
|
var priorityWidth = priorityRowWidth - 2 * (buttonSize.X + spacing.X);
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, spacing);
|
using var style = ImStyleDouble.ItemSpacing.Push(spacing);
|
||||||
ImGui.TableSetupColumn("Conflicting Mod", ImGuiTableColumnFlags.WidthStretch);
|
table.SetupColumn("Conflicting Mod"u8, TableColumnFlags.WidthStretch);
|
||||||
ImGui.TableSetupColumn("Priority", ImGuiTableColumnFlags.WidthFixed, priorityRowWidth);
|
table.SetupColumn("Priority"u8, TableColumnFlags.WidthFixed, priorityRowWidth);
|
||||||
ImGui.TableSetupColumn("Files", ImGuiTableColumnFlags.WidthFixed, ImGui.CalcTextSize("Files").X + spacing.X);
|
table.SetupColumn("Files"u8, TableColumnFlags.WidthFixed, Im.Font.CalculateSize("Files"u8).X + spacing.X);
|
||||||
|
|
||||||
ImGui.TableSetupScrollFreeze(2, 2);
|
table.SetupScrollFreeze(2, 2);
|
||||||
ImGui.TableHeadersRow();
|
table.HeaderRow();
|
||||||
DrawCurrentRow(priorityWidth);
|
DrawCurrentRow(table, priorityWidth);
|
||||||
|
|
||||||
// Can not be null because otherwise the tab bar is never drawn.
|
// Can not be null because otherwise the tab bar is never drawn.
|
||||||
var mod = selector.Selected!;
|
var mod = selector.Selected!;
|
||||||
|
|
@ -62,56 +56,42 @@ public class ModPanelConflictsTab(CollectionManager collectionManager, ModFileSy
|
||||||
.OrderByDescending(GetPriority)
|
.OrderByDescending(GetPriority)
|
||||||
.ThenBy(c => c.Mod2.Name, StringComparer.OrdinalIgnoreCase).Index())
|
.ThenBy(c => c.Mod2.Name, StringComparer.OrdinalIgnoreCase).Index())
|
||||||
{
|
{
|
||||||
using var id = ImRaii.PushId(index);
|
using var id = Im.Id.Push(index);
|
||||||
DrawConflictRow(conflict, priorityWidth, buttonSize);
|
DrawConflictRow(table, conflict, priorityWidth, buttonSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawCurrentRow(float priorityWidth)
|
private void DrawCurrentRow(in Im.TableDisposable table, float priorityWidth)
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
|
||||||
using var c = ImGuiColor.Text.Push(ColorId.FolderLine.Value());
|
using var c = ImGuiColor.Text.Push(ColorId.FolderLine.Value());
|
||||||
ImGui.AlignTextToFramePadding();
|
table.DrawFrameColumn(selector.Selected!.Name);
|
||||||
ImGui.TextUnformatted(selector.Selected!.Name);
|
table.NextColumn();
|
||||||
ImGui.TableNextColumn();
|
|
||||||
var actualSettings = collectionManager.Active.Current.GetActualSettings(selector.Selected!.Index).Settings!;
|
var actualSettings = collectionManager.Active.Current.GetActualSettings(selector.Selected!.Index).Settings!;
|
||||||
var priority = actualSettings.Priority.Value;
|
var priority = actualSettings.Priority.Value;
|
||||||
// TODO
|
// TODO
|
||||||
using (ImRaii.Disabled(actualSettings is TemporaryModSettings))
|
using (Im.Disabled(actualSettings is TemporaryModSettings))
|
||||||
{
|
{
|
||||||
ImGui.SetNextItemWidth(priorityWidth);
|
if (ImEx.InputOnDeactivation.Scalar("##priority"u8, ref priority))
|
||||||
if (ImGui.InputInt("##priority", ref priority, 0, 0, flags: ImGuiInputTextFlags.EnterReturnsTrue))
|
if (priority != actualSettings.Priority.Value)
|
||||||
_currentPriority = priority;
|
|
||||||
|
|
||||||
if (ImGui.IsItemDeactivatedAfterEdit() && _currentPriority.HasValue)
|
|
||||||
{
|
|
||||||
if (_currentPriority != actualSettings.Priority.Value)
|
|
||||||
collectionManager.Editor.SetModPriority(collectionManager.Active.Current, selector.Selected!,
|
collectionManager.Editor.SetModPriority(collectionManager.Active.Current, selector.Selected!,
|
||||||
new ModPriority(_currentPriority.Value));
|
new ModPriority(priority));
|
||||||
|
|
||||||
_currentPriority = null;
|
|
||||||
}
|
|
||||||
else if (ImGui.IsItemDeactivated())
|
|
||||||
{
|
|
||||||
_currentPriority = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
table.NextColumn();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawConflictSelectable(ModConflicts conflict)
|
private void DrawConflictSelectable(ModConflicts conflict)
|
||||||
{
|
{
|
||||||
ImGui.AlignTextToFramePadding();
|
Im.Cursor.FrameAlign();
|
||||||
if (ImGui.Selectable(conflict.Mod2.Name) && conflict.Mod2 is Mod otherMod)
|
if (Im.Selectable(conflict.Mod2.Name) && conflict.Mod2 is Mod otherMod)
|
||||||
selector.SelectByValue(otherMod);
|
selector.SelectByValue(otherMod);
|
||||||
var hovered = ImGui.IsItemHovered();
|
var hovered = Im.Item.Hovered();
|
||||||
var rightClicked = Im.Item.RightClicked();
|
var rightClicked = Im.Item.RightClicked();
|
||||||
if (conflict.Mod2 is Mod otherMod2)
|
if (conflict.Mod2 is Mod otherMod2)
|
||||||
{
|
{
|
||||||
if (hovered)
|
if (hovered)
|
||||||
ImGui.SetTooltip("Click to jump to mod, Control + Right-Click to disable mod.");
|
Im.Tooltip.Set("Click to jump to mod, Control + Right-Click to disable mod."u8);
|
||||||
if (rightClicked && ImGui.GetIO().KeyCtrl)
|
if (rightClicked && Im.Io.KeyControl)
|
||||||
collectionManager.Editor.SetModState(collectionManager.Active.Current, otherMod2, false);
|
collectionManager.Editor.SetModState(collectionManager.Active.Current, otherMod2, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -121,13 +101,13 @@ public class ModPanelConflictsTab(CollectionManager collectionManager, ModFileSy
|
||||||
if (!_expandedMods.TryGetValue(conflict.Mod2, out _))
|
if (!_expandedMods.TryGetValue(conflict.Mod2, out _))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
using var indent = ImRaii.PushIndent(30f);
|
using var indent = Im.Indent(30f);
|
||||||
foreach (var data in conflict.Conflicts)
|
foreach (var data in conflict.Conflicts)
|
||||||
{
|
{
|
||||||
_ = data switch
|
_ = data switch
|
||||||
{
|
{
|
||||||
Utf8GamePath p => ImUtf8.Selectable(p.Path.Span, false),
|
Utf8GamePath p => Im.Selectable(p.Path.Span),
|
||||||
IMetaIdentifier m => ImUtf8.Selectable(m.ToString(), false),
|
IMetaIdentifier m => Im.Selectable($"{m}"),
|
||||||
_ => false,
|
_ => false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -135,26 +115,26 @@ public class ModPanelConflictsTab(CollectionManager collectionManager, ModFileSy
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawConflictRow(ModConflicts conflict, float priorityWidth, Vector2 buttonSize)
|
private void DrawConflictRow(in Im.TableDisposable table, ModConflicts conflict, float priorityWidth, Vector2 buttonSize)
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
table.NextColumn();
|
||||||
DrawConflictSelectable(conflict);
|
DrawConflictSelectable(conflict);
|
||||||
var expanded = DrawExpandedFiles(conflict);
|
var expanded = DrawExpandedFiles(conflict);
|
||||||
ImGui.TableNextColumn();
|
table.NextColumn();
|
||||||
var conflictPriority = DrawPriorityInput(conflict, priorityWidth);
|
var conflictPriority = DrawPriorityInput(conflict, priorityWidth);
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
var selectedPriority = collectionManager.Active.Current.GetActualSettings(selector.Selected!.Index).Settings!.Priority.Value;
|
var selectedPriority = collectionManager.Active.Current.GetActualSettings(selector.Selected!.Index).Settings!.Priority.Value;
|
||||||
DrawPriorityButtons(conflict.Mod2 as Mod, conflictPriority, selectedPriority, buttonSize);
|
DrawPriorityButtons(conflict.Mod2 as Mod, conflictPriority, selectedPriority, buttonSize);
|
||||||
ImGui.TableNextColumn();
|
table.NextColumn();
|
||||||
DrawExpandButton(conflict.Mod2, expanded, buttonSize);
|
DrawExpandButton(conflict.Mod2, expanded, buttonSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawExpandButton(IMod mod, bool expanded, Vector2 buttonSize)
|
private void DrawExpandButton(IMod mod, bool expanded, Vector2 buttonSize)
|
||||||
{
|
{
|
||||||
var (icon, tt) = expanded
|
var (icon, tt) = expanded
|
||||||
? (FontAwesomeIcon.CaretUp.ToIconString(), "Hide the conflicting files for this mod.")
|
? RefTuple.Create(LunaStyle.CollapseUpIcon, "Hide the conflicting files for this mod."u8)
|
||||||
: (FontAwesomeIcon.CaretDown.ToIconString(), "Show the conflicting files for this mod.");
|
: RefTuple.Create(LunaStyle.ExpandDownIcon, "Show the conflicting files for this mod."u8);
|
||||||
if (ImGuiUtil.DrawDisabledButton(icon, buttonSize, tt, false, true))
|
if (ImEx.Icon.Button(icon, tt, buttonSize))
|
||||||
{
|
{
|
||||||
if (expanded)
|
if (expanded)
|
||||||
_expandedMods.Remove(mod);
|
_expandedMods.Remove(mod);
|
||||||
|
|
@ -165,41 +145,29 @@ public class ModPanelConflictsTab(CollectionManager collectionManager, ModFileSy
|
||||||
|
|
||||||
private int DrawPriorityInput(ModConflicts conflict, float priorityWidth)
|
private int DrawPriorityInput(ModConflicts conflict, float priorityWidth)
|
||||||
{
|
{
|
||||||
using var color = ImGuiColor.Text.Push(conflict.HasPriority ? ColorId.HandledConflictMod.Value() : ColorId.ConflictingMod.Value());
|
using var color = ImGuiColor.Text.Push(conflict.HasPriority ? ColorId.HandledConflictMod.Value() : ColorId.ConflictingMod.Value());
|
||||||
using var disabled = ImRaii.Disabled(conflict.Mod2.Index < 0);
|
using var disabled = Im.Disabled(conflict.Mod2.Index < 0);
|
||||||
var priority = _currentPriority ?? GetPriority(conflict).Value;
|
var priority = GetPriority(conflict).Value;
|
||||||
|
var originalPriority = priority;
|
||||||
ImGui.SetNextItemWidth(priorityWidth);
|
|
||||||
if (ImGui.InputInt("##priority", ref priority, 0, 0, flags: ImGuiInputTextFlags.EnterReturnsTrue))
|
|
||||||
_currentPriority = priority;
|
|
||||||
|
|
||||||
if (ImGui.IsItemDeactivatedAfterEdit() && _currentPriority.HasValue)
|
|
||||||
{
|
|
||||||
if (_currentPriority != GetPriority(conflict).Value)
|
|
||||||
collectionManager.Editor.SetModPriority(collectionManager.Active.Current, (Mod)conflict.Mod2,
|
|
||||||
new ModPriority(_currentPriority.Value));
|
|
||||||
|
|
||||||
_currentPriority = null;
|
|
||||||
}
|
|
||||||
else if (ImGui.IsItemDeactivated())
|
|
||||||
{
|
|
||||||
_currentPriority = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
Im.Item.SetNextWidth(priorityWidth);
|
||||||
|
if (ImEx.InputOnDeactivation.Scalar("##priority"u8, ref priority) && priority != originalPriority)
|
||||||
|
collectionManager.Editor.SetModPriority(collectionManager.Active.Current, (Mod)conflict.Mod2,
|
||||||
|
new ModPriority(priority));
|
||||||
return priority;
|
return priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawPriorityButtons(Mod? conflict, int conflictPriority, int selectedPriority, Vector2 buttonSize)
|
private void DrawPriorityButtons(Mod? conflict, int conflictPriority, int selectedPriority, Vector2 buttonSize)
|
||||||
{
|
{
|
||||||
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.SortNumericUpAlt.ToIconString(), buttonSize,
|
if (ImEx.Icon.Button(FontAwesomeIcon.SortNumericUpAlt.Icon(),
|
||||||
$"Set the priority of the currently selected mod to this mods priority plus one. ({selectedPriority} -> {conflictPriority + 1})",
|
$"Set the priority of the currently selected mod to this mods priority plus one. ({selectedPriority} -> {conflictPriority + 1})",
|
||||||
selectedPriority > conflictPriority, true))
|
selectedPriority > conflictPriority, buttonSize))
|
||||||
collectionManager.Editor.SetModPriority(collectionManager.Active.Current, selector.Selected!,
|
collectionManager.Editor.SetModPriority(collectionManager.Active.Current, selector.Selected!,
|
||||||
new ModPriority(conflictPriority + 1));
|
new ModPriority(conflictPriority + 1));
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.SortNumericDownAlt.ToIconString(), buttonSize,
|
if (ImEx.Icon.Button(FontAwesomeIcon.SortNumericDownAlt.Icon(),
|
||||||
$"Set the priority of this mod to the currently selected mods priority minus one. ({conflictPriority} -> {selectedPriority - 1})",
|
$"Set the priority of this mod to the currently selected mods priority minus one. ({conflictPriority} -> {selectedPriority - 1})",
|
||||||
selectedPriority > conflictPriority || conflict == null, true))
|
selectedPriority > conflictPriority || conflict == null, buttonSize))
|
||||||
collectionManager.Editor.SetModPriority(collectionManager.Active.Current, conflict!, new ModPriority(selectedPriority - 1));
|
collectionManager.Editor.SetModPriority(collectionManager.Active.Current, conflict!, new ModPriority(selectedPriority - 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@ public class ModPanelEditTab(
|
||||||
ImUtf8.Text(FontAwesomeIcon.CheckCircle.ToIconString());
|
ImUtf8.Text(FontAwesomeIcon.CheckCircle.ToIconString());
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip($"Export exists in \"{backup.Name}\".");
|
Im.Tooltip.OnHover($"Export exists in \"{backup.Name}\".");
|
||||||
}
|
}
|
||||||
|
|
||||||
using var context = ImUtf8.Popup("context"u8);
|
using var context = ImUtf8.Popup("context"u8);
|
||||||
|
|
@ -210,7 +210,7 @@ public class ModPanelEditTab(
|
||||||
{
|
{
|
||||||
ImEx.TextFramed($"{DateTimeOffset.FromUnixTimeMilliseconds(_mod.ImportDate).ToLocalTime():yyyy/MM/dd HH:mm}",
|
ImEx.TextFramed($"{DateTimeOffset.FromUnixTimeMilliseconds(_mod.ImportDate).ToLocalTime():yyyy/MM/dd HH:mm}",
|
||||||
new Vector2(UiHelpers.InputTextMinusButton3, 0), ImGuiColor.FrameBackground.Get(0.5f));
|
new Vector2(UiHelpers.InputTextMinusButton3, 0), ImGuiColor.FrameBackground.Get(0.5f));
|
||||||
ImGui.SameLine(0, 3 * ImUtf8.GlobalScale);
|
ImGui.SameLine(0, 3 * Im.Style.GlobalScale);
|
||||||
|
|
||||||
var canRefresh = config.DeleteModModifier.IsActive();
|
var canRefresh = config.DeleteModModifier.IsActive();
|
||||||
var tt = canRefresh
|
var tt = canRefresh
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ public class ModPanelSettingsTab(
|
||||||
|
|
||||||
public void DrawContent()
|
public void DrawContent()
|
||||||
{
|
{
|
||||||
using var table = ImUtf8.Table("##settings"u8, 1, ImGuiTableFlags.ScrollY, Im.ContentRegion.Available);
|
using var table = Im.Table.Begin("##settings"u8, 1, TableFlags.ScrollY, Im.ContentRegion.Available);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -82,7 +82,7 @@ public class ModPanelSettingsTab(
|
||||||
_locked))
|
_locked))
|
||||||
collectionManager.Editor.SetTemporarySettings(collectionManager.Active.Current, selection.Mod!, null);
|
collectionManager.Editor.SetTemporarySettings(collectionManager.Active.Current, selection.Mod!, null);
|
||||||
|
|
||||||
ImUtf8.HoverTooltip("Changing settings in temporary settings will not save them across sessions.\n"u8
|
Im.Tooltip.OnHover("Changing settings in temporary settings will not save them across sessions.\n"u8
|
||||||
+ "You can click this button to remove the temporary settings and return to your normal settings."u8);
|
+ "You can click this button to remove the temporary settings and return to your normal settings."u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -107,7 +107,7 @@ public class ModPanelSettingsTab(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip("You can click this button to copy the current settings to the current selection.\n"u8
|
Im.Tooltip.OnHover("You can click this button to copy the current settings to the current selection.\n"u8
|
||||||
+ "You can also just change any setting, which will copy the settings with the single setting changed to the current selection."u8);
|
+ "You can also just change any setting, which will copy the settings with the single setting changed to the current selection."u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -147,7 +147,7 @@ public class ModPanelSettingsTab(
|
||||||
if (ImUtf8.InputScalar("##Priority"u8, ref priority))
|
if (ImUtf8.InputScalar("##Priority"u8, ref priority))
|
||||||
_currentPriority = priority;
|
_currentPriority = priority;
|
||||||
if (new ModPriority(priority).IsHidden)
|
if (new ModPriority(priority).IsHidden)
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled,
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled,
|
||||||
$"This priority is special-cased to hide this mod in conflict tabs ({ModPriority.HiddenMin}, {ModPriority.HiddenMax}).");
|
$"This priority is special-cased to hide this mod in conflict tabs ({ModPriority.HiddenMin}, {ModPriority.HiddenMax}).");
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ public class ModPanelTabBar : IUiService
|
||||||
if (ImEx.Icon.Button(LunaStyle.FavoriteIcon))
|
if (ImEx.Icon.Button(LunaStyle.FavoriteIcon))
|
||||||
_modManager.DataEditor.ChangeModFavorite(mod, !mod.Favorite);
|
_modManager.DataEditor.ChangeModFavorite(mod, !mod.Favorite);
|
||||||
|
|
||||||
var hovered = ImGui.IsItemHovered();
|
var hovered = Im.Item.Hovered();
|
||||||
_tutorial.OpenTutorial(BasicTutorialSteps.Favorites);
|
_tutorial.OpenTutorial(BasicTutorialSteps.Favorites);
|
||||||
|
|
||||||
if (hovered)
|
if (hovered)
|
||||||
|
|
|
||||||
|
|
@ -56,14 +56,14 @@ public class MultiModPanel(ModFileSystemSelector selector, ModDataEditor editor,
|
||||||
var sizeFolders = availableSizePercent * 65;
|
var sizeFolders = availableSizePercent * 65;
|
||||||
|
|
||||||
var leaves = 0;
|
var leaves = 0;
|
||||||
using (var table = ImUtf8.Table("mods"u8, 3, ImGuiTableFlags.RowBg))
|
using (var table = Im.Table.Begin("mods"u8, 3, TableFlags.RowBackground))
|
||||||
{
|
{
|
||||||
if (!table)
|
if (!table)
|
||||||
return selector.SelectedPaths.Count(l => l is ModFileSystem.Leaf);
|
return selector.SelectedPaths.Count(l => l is ModFileSystem.Leaf);
|
||||||
|
|
||||||
ImUtf8.TableSetupColumn("type"u8, ImGuiTableColumnFlags.WidthFixed, sizeType.X);
|
table.SetupColumn("type"u8, TableColumnFlags.WidthFixed, sizeType.X);
|
||||||
ImUtf8.TableSetupColumn("mod"u8, ImGuiTableColumnFlags.WidthFixed, sizeMods);
|
table.SetupColumn("mod"u8, TableColumnFlags.WidthFixed, sizeMods);
|
||||||
ImUtf8.TableSetupColumn("path"u8, ImGuiTableColumnFlags.WidthFixed, sizeFolders);
|
table.SetupColumn("path"u8, TableColumnFlags.WidthFixed, sizeFolders);
|
||||||
|
|
||||||
var i = 0;
|
var i = 0;
|
||||||
foreach (var (fullName, path) in selector.SelectedPaths.Select(p => (p.FullName(), p))
|
foreach (var (fullName, path) in selector.SelectedPaths.Select(p => (p.FullName(), p))
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,7 @@ public sealed class ResourceWatcher : IDisposable, ITab, Luna.IUiService
|
||||||
}
|
}
|
||||||
|
|
||||||
var maxEntries = _config.MaxResourceWatcherRecords;
|
var maxEntries = _config.MaxResourceWatcherRecords;
|
||||||
if (maxEntries != DefaultMaxEntries && ImGui.IsItemHovered())
|
if (maxEntries != DefaultMaxEntries && Im.Item.Hovered())
|
||||||
ImGui.SetTooltip($"CTRL + Right-Click to reset to default {DefaultMaxEntries}.");
|
ImGui.SetTooltip($"CTRL + Right-Click to reset to default {DefaultMaxEntries}.");
|
||||||
|
|
||||||
if (!change)
|
if (!change)
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ internal sealed class ResourceWatcherTable : Table<Record>
|
||||||
clicked |= ImUtf8.Selectable(shortPath.Span, false, ImGuiSelectableFlags.AllowItemOverlap);
|
clicked |= ImUtf8.Selectable(shortPath.Span, false, ImGuiSelectableFlags.AllowItemOverlap);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip(path.Span);
|
Im.Tooltip.OnHover(path.Span);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clicked)
|
if (clicked)
|
||||||
|
|
|
||||||
|
|
@ -45,14 +45,14 @@ public class ChangedItemsTab(
|
||||||
.Push(ImGuiStyleVar.SelectableTextAlign, new Vector2(0.01f, 0.5f));
|
.Push(ImGuiStyleVar.SelectableTextAlign, new Vector2(0.01f, 0.5f));
|
||||||
|
|
||||||
var skips = ImGuiClip.GetNecessarySkips(_buttonSize.Y);
|
var skips = ImGuiClip.GetNecessarySkips(_buttonSize.Y);
|
||||||
using var list = ImUtf8.Table("##changedItems"u8, 3, ImGuiTableFlags.RowBg, -Vector2.One);
|
using var table = Im.Table.Begin("##changedItems"u8, 3, TableFlags.RowBackground, -Vector2.One);
|
||||||
if (!list)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ImGuiTableColumnFlags flags = ImGuiTableColumnFlags.NoResize | ImGuiTableColumnFlags.WidthFixed;
|
const TableColumnFlags flags = TableColumnFlags.NoResize | TableColumnFlags.WidthFixed;
|
||||||
ImUtf8.TableSetupColumn("items"u8, flags, 450 * Im.Style.GlobalScale);
|
table.SetupColumn("items"u8, flags, 450 * Im.Style.GlobalScale);
|
||||||
ImUtf8.TableSetupColumn("mods"u8, flags, varWidth - 140 * Im.Style.GlobalScale);
|
table.SetupColumn("mods"u8, flags, varWidth - 140 * Im.Style.GlobalScale);
|
||||||
ImUtf8.TableSetupColumn("id"u8, flags, 140 * Im.Style.GlobalScale);
|
table.SetupColumn("id"u8, flags, 140 * Im.Style.GlobalScale);
|
||||||
|
|
||||||
var items = collectionManager.Active.Current.ChangedItems;
|
var items = collectionManager.Active.Current.ChangedItems;
|
||||||
var rest = ImGuiClip.FilteredClippedDraw(items, skips, FilterChangedItem, DrawChangedItemColumn);
|
var rest = ImGuiClip.FilteredClippedDraw(items, skips, FilterChangedItem, DrawChangedItemColumn);
|
||||||
|
|
@ -106,7 +106,7 @@ public class ChangedItemsTab(
|
||||||
&& first is Mod mod)
|
&& first is Mod mod)
|
||||||
communicator.SelectTab.Invoke(new SelectTab.Arguments(TabType.Mods, mod));
|
communicator.SelectTab.Invoke(new SelectTab.Arguments(TabType.Mods, mod));
|
||||||
|
|
||||||
if (!ImGui.IsItemHovered())
|
if (!Im.Item.Hovered())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var _ = ImRaii.Tooltip();
|
using var _ = ImRaii.Tooltip();
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,8 @@ public static class CrashDataExtensions
|
||||||
if (!tree)
|
if (!tree)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var table = ImRaii.Table("##characterTable", 6,
|
using var table = Im.Table.Begin("##characterTable"u8, 6,
|
||||||
ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInner);
|
TableFlags.SizingFixedFit | TableFlags.RowBackground | TableFlags.BordersInner);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -68,8 +68,8 @@ public static class CrashDataExtensions
|
||||||
if (!tree)
|
if (!tree)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var table = ImRaii.Table("##filesTable", 8,
|
using var table = Im.Table.Begin("##filesTable"u8, 8,
|
||||||
ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInner);
|
TableFlags.SizingFixedFit | TableFlags.RowBackground | TableFlags.BordersInner);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -92,8 +92,8 @@ public static class CrashDataExtensions
|
||||||
if (!tree)
|
if (!tree)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var table = ImRaii.Table("##vfxTable", 7,
|
using var table = Im.Table.Begin("##vfxTable"u8, 7,
|
||||||
ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInner);
|
TableFlags.SizingFixedFit | TableFlags.RowBackground | TableFlags.BordersInner);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ public class CrashHandlerPanel(CrashHandlerService service, Configuration config
|
||||||
|
|
||||||
private void DrawMainData()
|
private void DrawMainData()
|
||||||
{
|
{
|
||||||
using var table = ImRaii.Table("##CrashHandlerTable", 2, ImGuiTableFlags.SizingFixedFit);
|
using var table = Im.Table.Begin("##CrashHandlerTable"u8, 2, TableFlags.SizingFixedFit);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ public class Diagnostics(ServiceManager provider) : IUiService
|
||||||
if (!ImGui.CollapsingHeader("Diagnostics"))
|
if (!ImGui.CollapsingHeader("Diagnostics"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var table = ImRaii.Table("##data", 4, ImGuiTableFlags.RowBg);
|
using var table = Im.Table.Begin("##data"u8, 4, TableFlags.RowBackground);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -230,8 +230,8 @@ public class DebugTab : Window, ITab
|
||||||
{
|
{
|
||||||
if (inheritanceNode)
|
if (inheritanceNode)
|
||||||
{
|
{
|
||||||
using var table = ImUtf8.Table("table"u8, 3,
|
using var table = Im.Table.Begin("table"u8, 3,
|
||||||
ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInnerV);
|
TableFlags.SizingFixedFit | TableFlags.RowBackground | TableFlags.BordersInnerVertical);
|
||||||
if (table)
|
if (table)
|
||||||
{
|
{
|
||||||
var max = Math.Max(
|
var max = Math.Max(
|
||||||
|
|
@ -243,17 +243,17 @@ public class DebugTab : Window, ITab
|
||||||
if (i < collection.Inheritance.DirectlyInheritsFrom.Count)
|
if (i < collection.Inheritance.DirectlyInheritsFrom.Count)
|
||||||
ImUtf8.Text(collection.Inheritance.DirectlyInheritsFrom[i].Identity.Name);
|
ImUtf8.Text(collection.Inheritance.DirectlyInheritsFrom[i].Identity.Name);
|
||||||
else
|
else
|
||||||
ImGui.Dummy(new Vector2(200 * ImUtf8.GlobalScale, Im.Style.TextHeight));
|
ImGui.Dummy(new Vector2(200 * Im.Style.GlobalScale, Im.Style.TextHeight));
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
if (i < collection.Inheritance.DirectlyInheritedBy.Count)
|
if (i < collection.Inheritance.DirectlyInheritedBy.Count)
|
||||||
ImUtf8.Text(collection.Inheritance.DirectlyInheritedBy[i].Identity.Name);
|
ImUtf8.Text(collection.Inheritance.DirectlyInheritedBy[i].Identity.Name);
|
||||||
else
|
else
|
||||||
ImGui.Dummy(new Vector2(200 * ImUtf8.GlobalScale, Im.Style.TextHeight));
|
ImGui.Dummy(new Vector2(200 * Im.Style.GlobalScale, Im.Style.TextHeight));
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
if (i < collection.Inheritance.FlatHierarchy.Count)
|
if (i < collection.Inheritance.FlatHierarchy.Count)
|
||||||
ImUtf8.Text(collection.Inheritance.FlatHierarchy[i].Identity.Name);
|
ImUtf8.Text(collection.Inheritance.FlatHierarchy[i].Identity.Name);
|
||||||
else
|
else
|
||||||
ImGui.Dummy(new Vector2(200 * ImUtf8.GlobalScale, Im.Style.TextHeight));
|
ImGui.Dummy(new Vector2(200 * Im.Style.GlobalScale, Im.Style.TextHeight));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -984,9 +984,9 @@ public class DebugTab : Window, ITab
|
||||||
|
|
||||||
var slowPathCallDeltas = _shaderReplacementFixer.GetAndResetSlowPathCallDeltas();
|
var slowPathCallDeltas = _shaderReplacementFixer.GetAndResetSlowPathCallDeltas();
|
||||||
|
|
||||||
ImGui.TableSetupColumn("Shader Package Name", ImGuiTableColumnFlags.WidthStretch, 0.6f);
|
table.SetupColumn("Shader Package Name"u8, TableColumnFlags.WidthStretch, 0.6f);
|
||||||
ImGui.TableSetupColumn("Materials with Modded ShPk", ImGuiTableColumnFlags.WidthStretch, 0.2f);
|
table.SetupColumn("Materials with Modded ShPk"u8, TableColumnFlags.WidthStretch, 0.2f);
|
||||||
ImGui.TableSetupColumn("\u0394 Slow-Path Calls", ImGuiTableColumnFlags.WidthStretch, 0.2f);
|
table.SetupColumn("\u0394 Slow-Path Calls"u8, TableColumnFlags.WidthStretch, 0.2f);
|
||||||
ImGui.TableHeadersRow();
|
ImGui.TableHeadersRow();
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
|
|
@ -1137,12 +1137,12 @@ public class DebugTab : Window, ITab
|
||||||
ImUtf8.Text($"CI CRC32: {_crcPath.InternalName.Crc32:X8}");
|
ImUtf8.Text($"CI CRC32: {_crcPath.InternalName.Crc32:X8}");
|
||||||
ImUtf8.Text($" CRC64: {_crcPath.Crc64:X16}");
|
ImUtf8.Text($" CRC64: {_crcPath.Crc64:X16}");
|
||||||
|
|
||||||
using var table = ImUtf8.Table("table"u8, 2);
|
using var table = Im.Table.Begin("table"u8, 2);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImUtf8.TableSetupColumn("Hash"u8, ImGuiTableColumnFlags.WidthFixed, 18 * UiBuilder.MonoFont.GetCharAdvance('0'));
|
table.SetupColumn("Hash"u8, TableColumnFlags.WidthFixed, 18 * UiBuilder.MonoFont.GetCharAdvance('0'));
|
||||||
ImUtf8.TableSetupColumn("Type"u8, ImGuiTableColumnFlags.WidthFixed, 5 * UiBuilder.MonoFont.GetCharAdvance('0'));
|
table.SetupColumn("Type"u8, TableColumnFlags.WidthFixed, 5 * UiBuilder.MonoFont.GetCharAdvance('0'));
|
||||||
ImGui.TableHeadersRow();
|
ImGui.TableHeadersRow();
|
||||||
|
|
||||||
foreach (var (hash, type) in _rsfService.CustomCache)
|
foreach (var (hash, type) in _rsfService.CustomCache)
|
||||||
|
|
@ -1166,13 +1166,13 @@ public class DebugTab : Window, ITab
|
||||||
if (ongoingLoadCount == 0)
|
if (ongoingLoadCount == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var table = ImUtf8.Table("ongoingLoadTable"u8, 3);
|
using var table = Im.Table.Begin("ongoingLoadTable"u8, 3);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImUtf8.TableSetupColumn("Resource Handle"u8, ImGuiTableColumnFlags.WidthStretch, 0.2f);
|
table.SetupColumn("Resource Handle"u8, TableColumnFlags.WidthStretch, 0.2f);
|
||||||
ImUtf8.TableSetupColumn("Actual Path"u8, ImGuiTableColumnFlags.WidthStretch, 0.4f);
|
table.SetupColumn("Actual Path"u8, TableColumnFlags.WidthStretch, 0.4f);
|
||||||
ImUtf8.TableSetupColumn("Original Path"u8, ImGuiTableColumnFlags.WidthStretch, 0.4f);
|
table.SetupColumn("Original Path"u8, TableColumnFlags.WidthStretch, 0.4f);
|
||||||
ImGui.TableHeadersRow();
|
ImGui.TableHeadersRow();
|
||||||
|
|
||||||
foreach (var (handle, original) in ongoingLoads)
|
foreach (var (handle, original) in ongoingLoads)
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ public unsafe class GlobalVariablesDrawer(
|
||||||
public void Draw()
|
public void Draw()
|
||||||
{
|
{
|
||||||
var header = ImUtf8.CollapsingHeader("Global Variables"u8);
|
var header = ImUtf8.CollapsingHeader("Global Variables"u8);
|
||||||
ImUtf8.HoverTooltip("Draw information about global variables. Can provide useful starting points for a memory viewer."u8);
|
Im.Tooltip.OnHover("Draw information about global variables. Can provide useful starting points for a memory viewer."u8);
|
||||||
if (!header)
|
if (!header)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -68,8 +68,7 @@ public unsafe class GlobalVariablesDrawer(
|
||||||
if (!tree)
|
if (!tree)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var table = ImUtf8.Table("##CharacterUtility"u8, 7, ImGuiTableFlags.RowBg | ImGuiTableFlags.SizingFixedFit,
|
using var table = Im.Table.Begin("##CharacterUtility"u8, 7, TableFlags.RowBackground | TableFlags.SizingFixedFit, -Vector2.UnitX);
|
||||||
-Vector2.UnitX);
|
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -115,7 +114,7 @@ public unsafe class GlobalVariablesDrawer(
|
||||||
if (residentResources.Address == null || residentResources.Address->NumResources == 0)
|
if (residentResources.Address == null || residentResources.Address->NumResources == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var table = ImUtf8.Table("##ResidentResources"u8, 5, ImGuiTableFlags.RowBg | ImGuiTableFlags.SizingFixedFit,
|
using var table = Im.Table.Begin("##ResidentResources"u8, 5, TableFlags.RowBackground | TableFlags.SizingFixedFit,
|
||||||
-Vector2.UnitX);
|
-Vector2.UnitX);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
@ -162,7 +161,7 @@ public unsafe class GlobalVariablesDrawer(
|
||||||
? t
|
? t
|
||||||
: CiByteString.Empty;
|
: CiByteString.Empty;
|
||||||
ImUtf8.Text($"{_shownResourcesMap} / {scheduler.Scheduler->Resources.LongCount}");
|
ImUtf8.Text($"{_shownResourcesMap} / {scheduler.Scheduler->Resources.LongCount}");
|
||||||
using var table = ImUtf8.Table("##SchedulerMapResources"u8, 10, ImGuiTableFlags.RowBg | ImGuiTableFlags.SizingFixedFit,
|
using var table = Im.Table.Begin("##SchedulerMapResources"u8, 10, TableFlags.RowBackground | TableFlags.SizingFixedFit,
|
||||||
-Vector2.UnitX);
|
-Vector2.UnitX);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
@ -213,7 +212,7 @@ public unsafe class GlobalVariablesDrawer(
|
||||||
? t
|
? t
|
||||||
: CiByteString.Empty;
|
: CiByteString.Empty;
|
||||||
ImUtf8.Text($"{_shownResourcesList} / {scheduler.Scheduler->Resources.LongCount}");
|
ImUtf8.Text($"{_shownResourcesList} / {scheduler.Scheduler->Resources.LongCount}");
|
||||||
using var table = ImUtf8.Table("##SchedulerListResources"u8, 10, ImGuiTableFlags.RowBg | ImGuiTableFlags.SizingFixedFit,
|
using var table = Im.Table.Begin("##SchedulerListResources"u8, 10, TableFlags.RowBackground | TableFlags.SizingFixedFit,
|
||||||
-Vector2.UnitX);
|
-Vector2.UnitX);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -63,15 +63,15 @@ public class RenderTargetDrawer(RenderTargetHdrEnabler renderTargetHdrEnabler, D
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
using var table = ImUtf8.Table("##RenderTargetTable"u8, 5, ImGuiTableFlags.RowBg | ImGuiTableFlags.SizingFixedFit);
|
using var table = Im.Table.Begin("##RenderTargetTable"u8, 5, TableFlags.RowBackground | TableFlags.SizingFixedFit);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImUtf8.TableSetupColumn("Offset"u8, ImGuiTableColumnFlags.WidthStretch, 0.15f);
|
table.SetupColumn("Offset"u8, TableColumnFlags.WidthStretch, 0.15f);
|
||||||
ImUtf8.TableSetupColumn("Creation Order"u8, ImGuiTableColumnFlags.WidthStretch, 0.15f);
|
table.SetupColumn("Creation Order"u8, TableColumnFlags.WidthStretch, 0.15f);
|
||||||
ImUtf8.TableSetupColumn("Original Texture Format"u8, ImGuiTableColumnFlags.WidthStretch, 0.2f);
|
table.SetupColumn("Original Texture Format"u8, TableColumnFlags.WidthStretch, 0.2f);
|
||||||
ImUtf8.TableSetupColumn("Current Texture Format"u8, ImGuiTableColumnFlags.WidthStretch, 0.2f);
|
table.SetupColumn("Current Texture Format"u8, TableColumnFlags.WidthStretch, 0.2f);
|
||||||
ImUtf8.TableSetupColumn("Comment"u8, ImGuiTableColumnFlags.WidthStretch, 0.3f);
|
table.SetupColumn("Comment"u8, TableColumnFlags.WidthStretch, 0.3f);
|
||||||
ImGui.TableHeadersRow();
|
ImGui.TableHeadersRow();
|
||||||
|
|
||||||
foreach (var record in report)
|
foreach (var record in report)
|
||||||
|
|
|
||||||
|
|
@ -46,12 +46,12 @@ public class ShapeInspector(ObjectManager objects, CollectionResolver resolver)
|
||||||
if (!treeNode1.Success || !data.ModCollection.HasCache)
|
if (!treeNode1.Success || !data.ModCollection.HasCache)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var table = ImUtf8.Table("##aCache"u8, 2, ImGuiTableFlags.RowBg);
|
using var table = Im.Table.Begin("##aCache"u8, 2, TableFlags.RowBackground);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImUtf8.TableSetupColumn("Attribute"u8, ImGuiTableColumnFlags.WidthFixed, 150 * ImUtf8.GlobalScale);
|
table.SetupColumn("Attribute"u8, TableColumnFlags.WidthFixed, 150 * Im.Style.GlobalScale);
|
||||||
ImUtf8.TableSetupColumn("State"u8, ImGuiTableColumnFlags.WidthStretch);
|
table.SetupColumn("State"u8, TableColumnFlags.WidthStretch);
|
||||||
|
|
||||||
ImGui.TableHeadersRow();
|
ImGui.TableHeadersRow();
|
||||||
foreach (var (attribute, set) in data.ModCollection.MetaCache!.Atr.Data.OrderBy(a => a.Key))
|
foreach (var (attribute, set) in data.ModCollection.MetaCache!.Atr.Data.OrderBy(a => a.Key))
|
||||||
|
|
@ -68,13 +68,13 @@ public class ShapeInspector(ObjectManager objects, CollectionResolver resolver)
|
||||||
if (!treeNode1.Success || !data.ModCollection.HasCache)
|
if (!treeNode1.Success || !data.ModCollection.HasCache)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var table = ImUtf8.Table("##sCache"u8, 3, ImGuiTableFlags.RowBg);
|
using var table = Im.Table.Begin("##sCache"u8, 3, TableFlags.RowBackground);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImUtf8.TableSetupColumn("Condition"u8, ImGuiTableColumnFlags.WidthFixed, 150 * ImUtf8.GlobalScale);
|
table.SetupColumn("Condition"u8, TableColumnFlags.WidthFixed, 150 * Im.Style.GlobalScale);
|
||||||
ImUtf8.TableSetupColumn("Shape"u8, ImGuiTableColumnFlags.WidthFixed, 150 * ImUtf8.GlobalScale);
|
table.SetupColumn("Shape"u8, TableColumnFlags.WidthFixed, 150 * Im.Style.GlobalScale);
|
||||||
ImUtf8.TableSetupColumn("State"u8, ImGuiTableColumnFlags.WidthStretch);
|
table.SetupColumn("State"u8, TableColumnFlags.WidthStretch);
|
||||||
|
|
||||||
ImGui.TableHeadersRow();
|
ImGui.TableHeadersRow();
|
||||||
foreach (var condition in Enum.GetValues<ShapeConnectorCondition>())
|
foreach (var condition in Enum.GetValues<ShapeConnectorCondition>())
|
||||||
|
|
@ -173,17 +173,17 @@ public class ShapeInspector(ObjectManager objects, CollectionResolver resolver)
|
||||||
if (!treeNode2)
|
if (!treeNode2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var table = ImUtf8.Table("##shapes"u8, 7, ImGuiTableFlags.RowBg);
|
using var table = Im.Table.Begin("##shapes"u8, 7, TableFlags.RowBackground);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImUtf8.TableSetupColumn("#"u8, ImGuiTableColumnFlags.WidthFixed, 25 * ImUtf8.GlobalScale);
|
table.SetupColumn("#"u8, TableColumnFlags.WidthFixed, 25 * Im.Style.GlobalScale);
|
||||||
ImUtf8.TableSetupColumn("Slot"u8, ImGuiTableColumnFlags.WidthFixed, 150 * ImUtf8.GlobalScale);
|
table.SetupColumn("Slot"u8, TableColumnFlags.WidthFixed, 150 * Im.Style.GlobalScale);
|
||||||
ImUtf8.TableSetupColumn("Address"u8, ImGuiTableColumnFlags.WidthFixed, UiBuilder.MonoFont.GetCharAdvance('0') * 14);
|
table.SetupColumn("Address"u8, TableColumnFlags.WidthFixed, UiBuilder.MonoFont.GetCharAdvance('0') * 14);
|
||||||
ImUtf8.TableSetupColumn("Mask"u8, ImGuiTableColumnFlags.WidthFixed, UiBuilder.MonoFont.GetCharAdvance('0') * 8);
|
table.SetupColumn("Mask"u8, TableColumnFlags.WidthFixed, UiBuilder.MonoFont.GetCharAdvance('0') * 8);
|
||||||
ImUtf8.TableSetupColumn("ID"u8, ImGuiTableColumnFlags.WidthFixed, UiBuilder.MonoFont.GetCharAdvance('0') * 4);
|
table.SetupColumn("ID"u8, TableColumnFlags.WidthFixed, UiBuilder.MonoFont.GetCharAdvance('0') * 4);
|
||||||
ImUtf8.TableSetupColumn("Count"u8, ImGuiTableColumnFlags.WidthFixed, 30 * ImUtf8.GlobalScale);
|
table.SetupColumn("Count"u8, TableColumnFlags.WidthFixed, 30 * Im.Style.GlobalScale);
|
||||||
ImUtf8.TableSetupColumn("Shapes"u8, ImGuiTableColumnFlags.WidthStretch);
|
table.SetupColumn("Shapes"u8, TableColumnFlags.WidthStretch);
|
||||||
|
|
||||||
ImGui.TableHeadersRow();
|
ImGui.TableHeadersRow();
|
||||||
|
|
||||||
|
|
@ -230,17 +230,17 @@ public class ShapeInspector(ObjectManager objects, CollectionResolver resolver)
|
||||||
if (!treeNode2)
|
if (!treeNode2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var table = ImUtf8.Table("##attributes"u8, 7, ImGuiTableFlags.RowBg);
|
using var table = Im.Table.Begin("##attributes"u8, 7, TableFlags.RowBackground);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImUtf8.TableSetupColumn("#"u8, ImGuiTableColumnFlags.WidthFixed, 25 * ImUtf8.GlobalScale);
|
table.SetupColumn("#"u8, TableColumnFlags.WidthFixed, 25 * Im.Style.GlobalScale);
|
||||||
ImUtf8.TableSetupColumn("Slot"u8, ImGuiTableColumnFlags.WidthFixed, 150 * ImUtf8.GlobalScale);
|
table.SetupColumn("Slot"u8, TableColumnFlags.WidthFixed, 150 * Im.Style.GlobalScale);
|
||||||
ImUtf8.TableSetupColumn("Address"u8, ImGuiTableColumnFlags.WidthFixed, UiBuilder.MonoFont.GetCharAdvance('0') * 14);
|
table.SetupColumn("Address"u8, TableColumnFlags.WidthFixed, UiBuilder.MonoFont.GetCharAdvance('0') * 14);
|
||||||
ImUtf8.TableSetupColumn("Mask"u8, ImGuiTableColumnFlags.WidthFixed, UiBuilder.MonoFont.GetCharAdvance('0') * 8);
|
table.SetupColumn("Mask"u8, TableColumnFlags.WidthFixed, UiBuilder.MonoFont.GetCharAdvance('0') * 8);
|
||||||
ImUtf8.TableSetupColumn("ID"u8, ImGuiTableColumnFlags.WidthFixed, UiBuilder.MonoFont.GetCharAdvance('0') * 4);
|
table.SetupColumn("ID"u8, TableColumnFlags.WidthFixed, UiBuilder.MonoFont.GetCharAdvance('0') * 4);
|
||||||
ImUtf8.TableSetupColumn("Count"u8, ImGuiTableColumnFlags.WidthFixed, 30 * ImUtf8.GlobalScale);
|
table.SetupColumn("Count"u8, TableColumnFlags.WidthFixed, 30 * Im.Style.GlobalScale);
|
||||||
ImUtf8.TableSetupColumn("Attributes"u8, ImGuiTableColumnFlags.WidthStretch);
|
table.SetupColumn("Attributes"u8, TableColumnFlags.WidthStretch);
|
||||||
|
|
||||||
ImGui.TableHeadersRow();
|
ImGui.TableHeadersRow();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ public class TexHeaderDrawer(IDragDropManager dragDrop) : Luna.IUiService
|
||||||
}
|
}
|
||||||
else if (_tex != null)
|
else if (_tex != null)
|
||||||
{
|
{
|
||||||
using var table = ImRaii.Table("table", 2, ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.RowBg);
|
using var table = Im.Table.Begin("table"u8, 2, TableFlags.SizingFixedFit | TableFlags.RowBackground);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,13 +32,13 @@ public class EffectiveTab(CollectionManager collectionManager, CollectionSelectH
|
||||||
|
|
||||||
var height = Im.Style.TextHeightWithSpacing + 2 * ImGui.GetStyle().CellPadding.Y;
|
var height = Im.Style.TextHeightWithSpacing + 2 * ImGui.GetStyle().CellPadding.Y;
|
||||||
var skips = ImGuiClip.GetNecessarySkips(height);
|
var skips = ImGuiClip.GetNecessarySkips(height);
|
||||||
using var table = ImRaii.Table("##EffectiveChangesTable", 3, ImGuiTableFlags.RowBg);
|
using var table = Im.Table.Begin("##EffectiveChangesTable"u8, 3, TableFlags.RowBackground);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.TableSetupColumn("##gamePath", ImGuiTableColumnFlags.WidthFixed, _effectiveLeftTextLength);
|
table.SetupColumn("##gamePath"u8, TableColumnFlags.WidthFixed, _effectiveLeftTextLength);
|
||||||
ImGui.TableSetupColumn(string.Empty, ImGuiTableColumnFlags.WidthFixed, _effectiveArrowLength);
|
table.SetupColumn(StringU8.Empty, TableColumnFlags.WidthFixed, _effectiveArrowLength);
|
||||||
ImGui.TableSetupColumn("##file", ImGuiTableColumnFlags.WidthFixed, _effectiveRightTextLength);
|
table.SetupColumn("##file"u8, TableColumnFlags.WidthFixed, _effectiveRightTextLength);
|
||||||
|
|
||||||
DrawEffectiveRows(collectionManager.Active.Current, skips, height,
|
DrawEffectiveRows(collectionManager.Active.Current, skips, height,
|
||||||
_effectiveFilePathFilter.Length > 0 || _effectiveGamePathFilter.Length > 0);
|
_effectiveFilePathFilter.Length > 0 || _effectiveGamePathFilter.Length > 0);
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ public class ModsTab(
|
||||||
ImGuiUtil.DrawTextButton("Redraw: ", frameHeight, frameColor);
|
ImGuiUtil.DrawTextButton("Redraw: ", frameHeight, frameColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hovered = ImGui.IsItemHovered();
|
var hovered = Im.Item.Hovered();
|
||||||
tutorial.OpenTutorial(BasicTutorialSteps.Redrawing);
|
tutorial.OpenTutorial(BasicTutorialSteps.Redrawing);
|
||||||
if (hovered)
|
if (hovered)
|
||||||
ImGui.SetTooltip($"The supported modifiers for '/penumbra redraw' are:\n{TutorialService.SupportedRedrawModifiers}");
|
ImGui.SetTooltip($"The supported modifiers for '/penumbra redraw' are:\n{TutorialService.SupportedRedrawModifiers}");
|
||||||
|
|
@ -155,9 +155,9 @@ public class ModsTab(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGuiUtil.HoverTooltip(lower.Length > 0
|
Im.Tooltip.OnHover(lower.Length > 0
|
||||||
? $"Execute '/penumbra redraw {lower}'.{additionalTooltip}"
|
? $"Execute '/penumbra redraw {lower}'.{additionalTooltip}"
|
||||||
: $"Execute '/penumbra redraw'.{additionalTooltip}", ImGuiHoveredFlags.AllowWhenDisabled);
|
: $"Execute '/penumbra redraw'.{additionalTooltip}", HoveredFlags.AllowWhenDisabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,14 +62,14 @@ public class ResourceTab(Configuration config, ResourceManagerService resourceMa
|
||||||
if (!tree || map->Count == 0)
|
if (!tree || map->Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var table = ImRaii.Table("##table", 4, ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.RowBg);
|
using var table = Im.Table.Begin("##table"u8, 4, TableFlags.SizingFixedFit | TableFlags.RowBackground);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.TableSetupColumn("Hash", ImGuiTableColumnFlags.WidthFixed, _hashColumnWidth);
|
table.SetupColumn("Hash"u8, TableColumnFlags.WidthFixed, _hashColumnWidth);
|
||||||
ImGui.TableSetupColumn("Ptr", ImGuiTableColumnFlags.WidthFixed, _hashColumnWidth);
|
table.SetupColumn("Ptr"u8, TableColumnFlags.WidthFixed, _hashColumnWidth);
|
||||||
ImGui.TableSetupColumn("Path", ImGuiTableColumnFlags.WidthFixed, _pathColumnWidth);
|
table.SetupColumn("Path"u8, TableColumnFlags.WidthFixed, _pathColumnWidth);
|
||||||
ImGui.TableSetupColumn("Refs", ImGuiTableColumnFlags.WidthFixed, _refsColumnWidth);
|
table.SetupColumn("Refs"u8, TableColumnFlags.WidthFixed, _refsColumnWidth);
|
||||||
ImGui.TableHeadersRow();
|
ImGui.TableHeadersRow();
|
||||||
|
|
||||||
resourceManager.IterateResourceMap(map, (hash, r) =>
|
resourceManager.IterateResourceMap(map, (hash, r) =>
|
||||||
|
|
@ -132,7 +132,7 @@ public class ResourceTab(Configuration config, ResourceManagerService resourceMa
|
||||||
private void SetTableWidths()
|
private void SetTableWidths()
|
||||||
{
|
{
|
||||||
_hashColumnWidth = 100 * Im.Style.GlobalScale;
|
_hashColumnWidth = 100 * Im.Style.GlobalScale;
|
||||||
_pathColumnWidth = ImGui.GetWindowContentRegionMax().X - ImGui.GetWindowContentRegionMin().X - 300 * Im.Style.GlobalScale;
|
_pathColumnWidth = Im.Window.MaximumContentRegion.X - Im.Window.MinimumContentRegion.X - 300 * Im.Style.GlobalScale;
|
||||||
_refsColumnWidth = 30 * Im.Style.GlobalScale;
|
_refsColumnWidth = 30 * Im.Style.GlobalScale;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -611,7 +611,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
_config.Save();
|
_config.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip(val.Description);
|
Im.Tooltip.OnHover(val.Description);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -699,14 +699,14 @@ public class SettingsTab : ITab, IUiService
|
||||||
if (ImUtf8.ButtonEx("Delete all PCP Mods"u8, "Deletes all mods tagged with 'PCP' from the mod list."u8, disabled: !active))
|
if (ImUtf8.ButtonEx("Delete all PCP Mods"u8, "Deletes all mods tagged with 'PCP' from the mod list."u8, disabled: !active))
|
||||||
_pcpService.CleanPcpMods();
|
_pcpService.CleanPcpMods();
|
||||||
if (!active)
|
if (!active)
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, $"Hold {_config.DeleteModModifier} while clicking.");
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, $"Hold {_config.DeleteModModifier} while clicking.");
|
||||||
|
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
if (ImUtf8.ButtonEx("Delete all PCP Collections"u8, "Deletes all collections whose name starts with 'PCP/' from the collection list."u8,
|
if (ImUtf8.ButtonEx("Delete all PCP Collections"u8, "Deletes all collections whose name starts with 'PCP/' from the collection list."u8,
|
||||||
disabled: !active))
|
disabled: !active))
|
||||||
_pcpService.CleanPcpCollections();
|
_pcpService.CleanPcpCollections();
|
||||||
if (!active)
|
if (!active)
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, $"Hold {_config.DeleteModModifier} while clicking.");
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, $"Hold {_config.DeleteModModifier} while clicking.");
|
||||||
|
|
||||||
Checkbox("Allow Other Plugins Access to PCP Handling",
|
Checkbox("Allow Other Plugins Access to PCP Handling",
|
||||||
"When creating or importing PCP files, other plugins can add and interpret their own data to the character.json file.",
|
"When creating or importing PCP files, other plugins can add and interpret their own data to the character.json file.",
|
||||||
|
|
@ -1176,7 +1176,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
var enabled = _config.DeleteModModifier.IsActive();
|
var enabled = _config.DeleteModModifier.IsActive();
|
||||||
if (_cleanupService.Progress is not 0.0 and not 1.0)
|
if (_cleanupService.Progress is not 0.0 and not 1.0)
|
||||||
{
|
{
|
||||||
ImUtf8.ProgressBar((float)_cleanupService.Progress, new Vector2(200 * ImUtf8.GlobalScale, Im.Style.FrameHeight),
|
ImUtf8.ProgressBar((float)_cleanupService.Progress, new Vector2(200 * Im.Style.GlobalScale, Im.Style.FrameHeight),
|
||||||
$"{_cleanupService.Progress * 100}%");
|
$"{_cleanupService.Progress * 100}%");
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
if (ImUtf8.Button("Cancel##FileCleanup"u8))
|
if (ImUtf8.Button("Cancel##FileCleanup"u8))
|
||||||
|
|
@ -1192,21 +1192,21 @@ public class SettingsTab : ITab, IUiService
|
||||||
!enabled || _cleanupService.IsRunning))
|
!enabled || _cleanupService.IsRunning))
|
||||||
_cleanupService.CleanUnusedLocalData();
|
_cleanupService.CleanUnusedLocalData();
|
||||||
if (!enabled)
|
if (!enabled)
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, $"Hold {_config.DeleteModModifier} while clicking to delete files.");
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, $"Hold {_config.DeleteModModifier} while clicking to delete files.");
|
||||||
|
|
||||||
if (ImUtf8.ButtonEx("Clear Backup Files"u8,
|
if (ImUtf8.ButtonEx("Clear Backup Files"u8,
|
||||||
"Delete all backups of .json configuration files in your configuration folder and all backups of mod group files in your mod directory."u8,
|
"Delete all backups of .json configuration files in your configuration folder and all backups of mod group files in your mod directory."u8,
|
||||||
default, !enabled || _cleanupService.IsRunning))
|
default, !enabled || _cleanupService.IsRunning))
|
||||||
_cleanupService.CleanBackupFiles();
|
_cleanupService.CleanBackupFiles();
|
||||||
if (!enabled)
|
if (!enabled)
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, $"Hold {_config.DeleteModModifier} while clicking to delete files.");
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, $"Hold {_config.DeleteModModifier} while clicking to delete files.");
|
||||||
|
|
||||||
if (ImUtf8.ButtonEx("Clear All Unused Settings"u8,
|
if (ImUtf8.ButtonEx("Clear All Unused Settings"u8,
|
||||||
"Remove all mod settings in all of your collections that do not correspond to currently installed mods."u8, default,
|
"Remove all mod settings in all of your collections that do not correspond to currently installed mods."u8, default,
|
||||||
!enabled || _cleanupService.IsRunning))
|
!enabled || _cleanupService.IsRunning))
|
||||||
_cleanupService.CleanupAllUnusedSettings();
|
_cleanupService.CleanupAllUnusedSettings();
|
||||||
if (!enabled)
|
if (!enabled)
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, $"Hold {_config.DeleteModModifier} while clicking to remove settings.");
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, $"Hold {_config.DeleteModModifier} while clicking to remove settings.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Draw a checkbox that toggles the dalamud setting to wait for plugins on open. </summary>
|
/// <summary> Draw a checkbox that toggles the dalamud setting to wait for plugins on open. </summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue