mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Clip meta changes.
This commit is contained in:
parent
4970e57131
commit
6d408ba695
8 changed files with 31 additions and 7 deletions
|
|
@ -66,6 +66,9 @@ public sealed class EqdpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFil
|
|||
.ThenBy(kvp => kvp.Key.Slot)
|
||||
.Select(kvp => (kvp.Key, kvp.Value));
|
||||
|
||||
protected override int Count
|
||||
=> Editor.Eqdp.Count;
|
||||
|
||||
private static bool DrawIdentifierInput(ref EqdpIdentifier identifier)
|
||||
{
|
||||
ImGui.TableNextColumn();
|
||||
|
|
|
|||
|
|
@ -64,6 +64,9 @@ public sealed class EqpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
|||
.ThenBy(kvp => kvp.Key.Slot)
|
||||
.Select(kvp => (kvp.Key, kvp.Value));
|
||||
|
||||
protected override int Count
|
||||
=> Editor.Eqp.Count;
|
||||
|
||||
private static bool DrawIdentifierInput(ref EqpIdentifier identifier)
|
||||
{
|
||||
ImGui.TableNextColumn();
|
||||
|
|
|
|||
|
|
@ -64,6 +64,9 @@ public sealed class EstMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
|||
.ThenBy(kvp => kvp.Key.Slot)
|
||||
.Select(kvp => (kvp.Key, kvp.Value));
|
||||
|
||||
protected override int Count
|
||||
=> Editor.Est.Count;
|
||||
|
||||
private static bool DrawIdentifierInput(ref EstIdentifier identifier)
|
||||
{
|
||||
ImGui.TableNextColumn();
|
||||
|
|
|
|||
|
|
@ -52,6 +52,9 @@ public sealed class GlobalEqpMetaDrawer(ModMetaEditor editor, MetaFileManager me
|
|||
.ThenBy(identifier => identifier.Condition.Id)
|
||||
.Select(identifier => (identifier, (byte)0));
|
||||
|
||||
protected override int Count
|
||||
=> Editor.GlobalEqp.Count;
|
||||
|
||||
private static void DrawIdentifierInput(ref GlobalEqpManipulation identifier)
|
||||
{
|
||||
ImGui.TableNextColumn();
|
||||
|
|
|
|||
|
|
@ -59,7 +59,10 @@ public sealed class GmpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
|||
protected override IEnumerable<(GmpIdentifier, GmpEntry)> Enumerate()
|
||||
=> Editor.Gmp
|
||||
.OrderBy(kvp => kvp.Key.SetId.Id)
|
||||
.Select(kvp => (kvp.Key, kvp.Value));
|
||||
.Select(kvp => (kvp.Key, kvp.Value));
|
||||
|
||||
protected override int Count
|
||||
=> Editor.Gmp.Count;
|
||||
|
||||
private static bool DrawIdentifierInput(ref GmpIdentifier identifier)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -149,6 +149,9 @@ public sealed class ImcMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
|||
.ThenBy(kvp => kvp.Key.Variant.Id)
|
||||
.Select(kvp => (kvp.Key, kvp.Value));
|
||||
|
||||
protected override int Count
|
||||
=> Editor.Imc.Count;
|
||||
|
||||
public static bool DrawObjectType(ref ImcIdentifier identifier, float width = 110)
|
||||
{
|
||||
var ret = Combos.ImcType("##imcType", identifier.ObjectType, out var type, width);
|
||||
|
|
|
|||
|
|
@ -41,12 +41,14 @@ public abstract class MetaDrawer<TIdentifier, TEntry>(ModMetaEditor editor, Meta
|
|||
|
||||
using var id = ImUtf8.PushId((int)Identifier.Type);
|
||||
DrawNew();
|
||||
foreach (var ((identifier, entry), idx) in Enumerate().WithIndex())
|
||||
{
|
||||
id.Push(idx);
|
||||
DrawEntry(identifier, entry);
|
||||
id.Pop();
|
||||
}
|
||||
|
||||
var height = ImUtf8.FrameHeightSpacing;
|
||||
var skips = ImGuiClip.GetNecessarySkipsAtPos(height, ImGui.GetCursorPosY());
|
||||
var remainder = ImGuiClip.ClippedTableDraw(Enumerate(), skips, DrawLine, Count);
|
||||
ImGuiClip.DrawEndDummy(remainder, height);
|
||||
|
||||
void DrawLine((TIdentifier Identifier, TEntry Value) pair)
|
||||
=> DrawEntry(pair.Identifier, pair.Value);
|
||||
}
|
||||
|
||||
public abstract ReadOnlySpan<byte> Label { get; }
|
||||
|
|
@ -57,6 +59,7 @@ public abstract class MetaDrawer<TIdentifier, TEntry>(ModMetaEditor editor, Meta
|
|||
protected abstract void DrawEntry(TIdentifier identifier, TEntry entry);
|
||||
|
||||
protected abstract IEnumerable<(TIdentifier, TEntry)> Enumerate();
|
||||
protected abstract int Count { get; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -63,6 +63,9 @@ public sealed class RspMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
|||
.ThenBy(kvp => kvp.Key.Attribute)
|
||||
.Select(kvp => (kvp.Key, kvp.Value));
|
||||
|
||||
protected override int Count
|
||||
=> Editor.Rsp.Count;
|
||||
|
||||
private static bool DrawIdentifierInput(ref RspIdentifier identifier)
|
||||
{
|
||||
ImGui.TableNextColumn();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue