From 641428e84acaa5ffa25679dc6671aca4561b06f3 Mon Sep 17 00:00:00 2001 From: Bastian Blokland Date: Fri, 20 Sep 2024 21:13:02 +0300 Subject: [PATCH] debug: Support changing attachment joint from the inspector --- libs/debug/src/inspector.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libs/debug/src/inspector.c b/libs/debug/src/inspector.c index 8bb51353e..10119b43b 100644 --- a/libs/debug/src/inspector.c +++ b/libs/debug/src/inspector.c @@ -827,8 +827,21 @@ static void inspector_panel_draw_attachment( if (attach) { inspector_panel_next(canvas, panelComp, table); if (inspector_panel_section(canvas, string_lit("Attachment"))) { + + DynString jointName = dynstring_create(g_allocScratch, 64); + if (attach->jointName) { + dynstring_append(&jointName, stringtable_lookup(g_stringtable, attach->jointName)); + } + inspector_panel_next(canvas, panelComp, table); + ui_label(canvas, string_lit("Joint")); + ui_table_next_column(canvas, table); + if (ui_textbox(canvas, &jointName, .maxTextLength = 64)) { + attach->jointIndex = sentinel_u32; + attach->jointName = string_maybe_hash(dynstring_view(&jointName)); + } + inspector_panel_next(canvas, panelComp, table); ui_label(canvas, string_lit("Offset")); ui_table_next_column(canvas, table); debug_widget_editor_vec3(canvas, &attach->offset, UiWidget_Default);