Texture processor cleanup, new asset properties config UI

This commit is contained in:
Simon Lübeß
2024-06-08 17:03:21 +02:00
parent 8972e607fd
commit 86afa234e7
16 changed files with 793 additions and 552 deletions
+39
View File
@@ -35,4 +35,43 @@ extension ImGui
{
return SetDragDropPayload(type.GetName(), data, sz, cond);
}
/// Starts a new row in the table and enters the first column.
public static bool BeginPropertyTable(char8* name, uint32 tableId)
{
return ImGui.BeginTableEx(name, tableId, 2, .SizingStretchSame | .BordersInner | .Resizable);
}
/// Starts a new row in the table and enters the first column.
public static void PropertyTableStartNewRow()
{
ImGui.TableNextRow();
ImGui.TableSetColumnIndex(0);
}
/// Starts a new property by creating a new table row, writing the name in the first column and entering the second column.
public static void PropertyTableStartNewProperty(StringView propertyName)
{
PropertyTableStartNewRow();
bool isFirstTableRow = ImGui.TableGetRowIndex() == 0;
if (isFirstTableRow)
ImGui.PushItemWidth(-1);
ImGui.TextUnformatted(propertyName);
ImGui.AttachTooltip(propertyName);
ImGui.TableSetColumnIndex(1);
if (isFirstTableRow)
ImGui.PushItemWidth(-1);
}
public static void PropertyTableStartNewProperty(StringView propertyName, StringView tooltip)
{
PropertyTableStartNewProperty(propertyName);
AttachTooltip(tooltip);
}
}