improve flow around multi-target debugging: prefer one-target-only in default path; only enable command line specified target if present; explicit commands for enabling/disabling targets, as well as mutually-exclusive selection of targets; make default clicking path in UI go through mutually exclusive selection, whereas ctrl+clicks will do multi-target selection

This commit is contained in:
Ryan Fleury
2024-01-25 11:49:05 -08:00
parent dd38822a4c
commit c8c5da4f4a
6 changed files with 101 additions and 39 deletions
+6 -1
View File
@@ -8692,12 +8692,17 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity)
ui_set_next_background_color(special_color);
}
}
ui_set_next_hover_cursor(OS_Cursor_HandPoint);
if(entity->cfg_src == DF_CfgSrc_CommandLine)
{
Vec4F32 bg_color = mix_4f32(ui_top_background_color(), df_rgba_from_theme_color(DF_ThemeColor_Highlight0), 0.25f);
ui_set_next_background_color(bg_color);
}
else if(entity->kind == DF_EntityKind_Target && entity->b32 != 0)
{
Vec4F32 bg_color = mix_4f32(ui_top_background_color(), df_rgba_from_theme_color(DF_ThemeColor_Highlight1), 0.25f);
ui_set_next_background_color(bg_color);
}
ui_set_next_hover_cursor(OS_Cursor_HandPoint);
UI_Key key = ui_key_from_stringf(ui_top_parent()->key, "entity_ref_button_%p", entity);
UI_Box *box = ui_build_box_from_key(UI_BoxFlag_Clickable|
UI_BoxFlag_DrawBorder|
+13 -2
View File
@@ -3216,9 +3216,20 @@ DF_VIEW_UI_FUNCTION_DEF(Targets)
// rjf: enabled
UI_PrefWidth(ui_em(2.25f, 1))
UI_FocusHot((row_selected && cursor.x == 0) ? UI_FocusKind_On : UI_FocusKind_Off)
if(df_icon_buttonf(target->b32 ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow, "###ebl_%p", target).clicked)
{
df_entity_equip_b32(target, !target->b32);
UI_Signal sig = df_icon_buttonf(target->b32 ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow, "###ebl_%p", target);
if(sig.clicked && sig.event_flags == 0)
{
DF_CmdParams p = df_cmd_params_from_view(ws, panel, view);
p.entity = df_handle_from_entity(target);
df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SelectTarget));
}
else if(sig.clicked && sig.event_flags == OS_EventFlag_Ctrl)
{
DF_CmdParams p = df_cmd_params_from_view(ws, panel, view);
p.entity = df_handle_from_entity(target);
df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(target->b32 ? DF_CoreCmdKind_DisableTarget : DF_CoreCmdKind_EnableTarget));
}
}
// rjf: target name