Skip to content

Commit c275d7f

Browse files
committed
Hide number input for mdf2 flags, add copy/paste context menu
1 parent 5389edd commit c275d7f

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

ContentEditor.App/Imgui/Common/CsharpEnumHandler.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public unsafe void OnIMGUI(UIContext context)
9696
ImguiHelpers.BeginRect();
9797
if (HideNumberInput) {
9898
ImGui.Text(context.label + ": ");
99+
AppImguiHelpers.ShowJsonCopyPopup<T>(value, context);
99100
} else if (ImGui.InputScalar(context.label, scalarType, &value)) {
100101
UndoRedo.RecordSet(context, value);
101102
}

ContentEditor.App/Imgui/Editors/MdfEditor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,8 @@ public void OnIMGUI(UIContext context)
312312
var tex = context.Get<MaterialHeader>();
313313
var ws = context.GetWorkspace();
314314
WindowHandlerFactory.SetupObjectUIContext(context, typeof(MaterialHeader), members: DisplayedFields);
315+
context.GetChildByValue<MaterialFlags1>()?.uiHandler = new CsharpFlagsEnumFieldHandler<MaterialFlags1, int>() { HideNumberInput = true };
316+
context.GetChildByValue<MaterialFlags2>()?.uiHandler = new CsharpFlagsEnumFieldHandler<MaterialFlags2, int>() { HideNumberInput = true };
315317
context.AddChildContextSetter<MaterialHeader, string>(
316318
"MMTR path",
317319
tex,

0 commit comments

Comments
 (0)