From: hgn Date: Tue, 21 Nov 2023 04:24:56 +0000 (+0000) Subject: miniworld helpers X-Git-Url: https://harrygodden.com/git/?a=commitdiff_plain;h=7a6ce9a58463f0123223f2b379d90fb6305bad8f;p=carveJwlIkooP6JGAAIwe30JlM.git miniworld helpers --- diff --git a/ent_miniworld.c b/ent_miniworld.c index 802bd8b..c56fa18 100644 --- a/ent_miniworld.c +++ b/ent_miniworld.c @@ -5,6 +5,26 @@ #include "gui.h" #include "menu.h" +static void miniworld_helper_default(void){ + gui_helper_clear(); + vg_str text; + if( gui_new_helper( input_button_list[k_srbind_miniworld_resume], &text )) + vg_strcat( &text, "Resume" ); + + if( gui_new_helper( input_button_list[k_srbind_miniworld_teleport],&text)) + vg_strcat( &text, "Teleport" ); +} + +static void miniworld_helper_tele(void){ + gui_helper_clear(); + vg_str text; + if( gui_new_helper( input_button_list[k_srbind_miniworld_resume], &text )) + vg_strcat( &text, "Confirm" ); + + if( gui_new_helper( input_button_list[k_srbind_mback],&text)) + vg_strcat( &text, "Cancel" ); +} + static void ent_miniworld_call( world_instance *world, ent_call *call ){ ent_miniworld *miniworld = mdl_arritm( &world->ent_miniworld, mdl_entity_id_id(call->id) ); @@ -17,9 +37,11 @@ static void ent_miniworld_call( world_instance *world, ent_call *call ){ mdl_transform_m4x3( &miniworld->transform, global_miniworld.mmdl ); global_miniworld.active = miniworld; + miniworld_helper_default(); } else if( call->function == 1 ){ global_miniworld.active = NULL; + gui_helper_clear(); if( miniworld->proxy ){ ent_prop *prop = mdl_arritm( &world->ent_prop, @@ -141,6 +163,7 @@ static void ent_miniworld_preupdate(void){ global_miniworld.mode = 0; menu.disable_open = 0; srinput.state = k_input_state_resume; + gui_helper_clear(); } return; } @@ -160,6 +183,7 @@ static void ent_miniworld_preupdate(void){ global_miniworld.dest_spawn = NULL; srinput.state = k_input_state_resume; menu.disable_open = 0; + gui_helper_clear(); } else { if( global_miniworld.mode == 1 ){ @@ -168,6 +192,7 @@ static void ent_miniworld_preupdate(void){ global_miniworld.dest_spawn = NULL; menu.disable_open = 0; srinput.state = k_input_state_resume; + miniworld_helper_default(); } else { m4x3f mmdl_inv; @@ -181,6 +206,7 @@ static void ent_miniworld_preupdate(void){ if( button_down( k_srbind_miniworld_teleport ) ){ global_miniworld.mode = 1; menu.disable_open = 1; + miniworld_helper_tele(); } } }