more entity code deletion

This commit is contained in:
Ryan Fleury
2025-01-22 09:57:40 -08:00
parent 7443f33069
commit 443fee10ec
3 changed files with 8 additions and 23 deletions
-15
View File
@@ -11467,21 +11467,6 @@ rd_query_cached_entity_list_with_kind(RD_EntityKind kind)
return result; return result;
} }
internal RD_EntityList
rd_push_active_target_list(Arena *arena)
{
RD_EntityList active_targets = {0};
RD_EntityList all_targets = rd_query_cached_entity_list_with_kind(RD_EntityKind_Target);
for(RD_EntityNode *n = all_targets.first; n != 0; n = n->next)
{
if(!n->entity->disabled)
{
rd_entity_list_push(arena, &active_targets, n->entity);
}
}
return active_targets;
}
//- rjf: config state //- rjf: config state
internal RD_CfgTable * internal RD_CfgTable *
-1
View File
@@ -1419,7 +1419,6 @@ internal String8 rd_cfg_path_from_src(RD_CfgSrc src);
//- rjf: entity cache queries //- rjf: entity cache queries
internal RD_EntityList rd_query_cached_entity_list_with_kind(RD_EntityKind kind); internal RD_EntityList rd_query_cached_entity_list_with_kind(RD_EntityKind kind);
internal RD_EntityList rd_push_active_target_list(Arena *arena);
//- rjf: config state //- rjf: config state
internal RD_CfgTable *rd_cfg_table(void); internal RD_CfgTable *rd_cfg_table(void);
+8 -7
View File
@@ -3485,7 +3485,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(getting_started)
UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak)
UI_Padding(ui_pct(1, 0)) UI_Focus(UI_FocusKind_Null) UI_Padding(ui_pct(1, 0)) UI_Focus(UI_FocusKind_Null)
{ {
RD_EntityList targets = rd_push_active_target_list(scratch.arena); RD_CfgList targets = rd_cfg_top_level_list_from_string(scratch.arena, str8_lit("target"));
CTRL_EntityList processes = ctrl_entity_list_from_kind(d_state->ctrl_entity_store, CTRL_EntityKind_Process); CTRL_EntityList processes = ctrl_entity_list_from_kind(d_state->ctrl_entity_store, CTRL_EntityKind_Process);
//- rjf: icon & info //- rjf: icon & info
@@ -3543,8 +3543,9 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(getting_started)
//- rjf: user has 1 target. build helper for launching it //- rjf: user has 1 target. build helper for launching it
case 1: case 1:
{ {
RD_Entity *target = rd_first_entity_from_list(&targets); RD_Cfg *target_cfg = rd_cfg_list_first(&targets);
String8 target_full_path = target->string; D_Target target = rd_target_from_cfg(scratch.arena, target_cfg);
String8 target_full_path = target.exe;
String8 target_name = str8_skip_last_slash(target_full_path); String8 target_name = str8_skip_last_slash(target_full_path);
UI_PrefHeight(ui_em(3.75f, 1.f)) UI_PrefHeight(ui_em(3.75f, 1.f))
UI_Row UI_Row
@@ -3556,12 +3557,12 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(getting_started)
{ {
if(ui_clicked(rd_icon_buttonf(RD_IconKind_Play, 0, "Launch %S", target_name))) if(ui_clicked(rd_icon_buttonf(RD_IconKind_Play, 0, "Launch %S", target_name)))
{ {
rd_cmd(RD_CmdKind_LaunchAndRun, .entity = rd_handle_from_entity(target)); rd_cmd(RD_CmdKind_LaunchAndRun, .cfg = rd_handle_from_cfg(target_cfg));
} }
ui_spacer(ui_em(1.5f, 1)); ui_spacer(ui_em(1.5f, 1));
if(ui_clicked(rd_icon_buttonf(RD_IconKind_Play, 0, "Step Into %S", target_name))) if(ui_clicked(rd_icon_buttonf(RD_IconKind_Play, 0, "Step Into %S", target_name)))
{ {
rd_cmd(RD_CmdKind_LaunchAndInit, .entity = rd_handle_from_entity(target)); rd_cmd(RD_CmdKind_LaunchAndInit, .cfg = rd_handle_from_cfg(target_cfg));
} }
} }
}break; }break;
@@ -3593,8 +3594,8 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(getting_started)
RD_Palette(RD_PaletteCode_Floating) RD_Palette(RD_PaletteCode_Floating)
{ {
ui_labelf("use"); ui_labelf("use");
UI_TextAlignment(UI_TextAlign_Center) rd_cmd_binding_buttons(rd_cmd_kind_info_table[RD_CmdKind_RunCommand].string); UI_TextAlignment(UI_TextAlign_Center) rd_cmd_binding_buttons(rd_cmd_kind_info_table[RD_CmdKind_OpenLister].string);
ui_labelf("to open command menu"); ui_labelf("to open the lister for commands and options");
} }
} }
scratch_end(scratch); scratch_end(scratch);