X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=ent_miniworld.c;h=024fa6c0bc9153ad76d2075d7453efea57d74cd9;hb=74b2136d5b41b18e2eec698f1fd11b503aa1100a;hp=0ceefdab1dfaad6f7e37c7cb94d75d05cce66e71;hpb=330eda0436ed73d6c68214fef8922904abe19422;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/ent_miniworld.c b/ent_miniworld.c index 0ceefda..024fa6c 100644 --- a/ent_miniworld.c +++ b/ent_miniworld.c @@ -5,27 +5,6 @@ #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_teleport],&text)) - vg_strcat( &text, "Teleport" ); - - if( gui_new_helper( input_button_list[k_srbind_miniworld_resume], &text )) - vg_strcat( &text, "Enter World" ); -} - -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) ); @@ -38,14 +17,15 @@ static void ent_miniworld_call( world_instance *world, ent_call *call ){ mdl_transform_m4x3( &miniworld->transform, global_miniworld.mmdl ); global_miniworld.active = miniworld; - global_miniworld.mode = 0; - global_miniworld.dest_spawn = NULL; - miniworld_helper_default(); + + gui_helper_clear(); + vg_str text; + + if( gui_new_helper( input_button_list[k_srbind_miniworld_resume], &text )) + vg_strcat( &text, "Enter World" ); } else if( call->function == 1 ){ global_miniworld.active = NULL; - global_miniworld.mode = 0; - global_miniworld.dest_spawn = NULL; gui_helper_clear(); if( miniworld->proxy ){ @@ -107,7 +87,7 @@ static void ent_miniworld_render( world_instance *host_world, camera *cam ){ return; render_world_override( dest_world, host_world, global_miniworld.mmdl, cam, - global_miniworld.dest_spawn ); + NULL, (v4f){dest_world->tar_min,10000.0f,0.0f,0.0f} ); render_world_routes( dest_world, host_world, global_miniworld.mmdl, cam, 0, 1 ); @@ -134,6 +114,19 @@ static void ent_miniworld_render( world_instance *host_world, camera *cam ){ miniworld_icon( cam, icon, challenge->transform.co, 1.0f ); } + for( u32 i=0; ient_route); i++ ){ + ent_route *route = mdl_arritm( &dest_world->ent_route, i ); + + if( route->flags & k_ent_route_flag_achieve_gold ){ + miniworld_icon( cam, k_gui_icon_rift_run_gold, + route->board_transform[3],1.0f); + } + else if( route->flags & k_ent_route_flag_achieve_silver ){ + miniworld_icon( cam, k_gui_icon_rift_run_silver, + route->board_transform[3],1.0f); + } + } + for( u32 i=0; ient_route); i++ ){ ent_route *route = mdl_arritm( &dest_world->ent_route, i ); @@ -156,30 +149,15 @@ static void ent_miniworld_preupdate(void){ (world_static.active_instance != k_world_purpose_hub) || (!miniworld) || (dest->status != k_world_status_loaded) ){ - - if( global_miniworld.mode ){ - global_miniworld.mode = 0; - global_miniworld.dest_spawn = 0; - menu.disable_open = 0; - srinput.state = k_input_state_resume; - gui_helper_clear(); - } return; } if( button_down( k_srbind_miniworld_resume ) ){ - global_miniworld.mode = 0; global_miniworld.transition = 1; global_miniworld.t = 0.0f; global_miniworld.cam = skaterift.cam; - - if( global_miniworld.dest_spawn ){ - v3_copy( global_miniworld.dest_spawn->transform.co, - dest->player_co ); - } world_switch_instance(1); - global_miniworld.dest_spawn = NULL; srinput.state = k_input_state_resume; menu.disable_open = 0; gui_helper_clear(); @@ -187,31 +165,6 @@ static void ent_miniworld_preupdate(void){ audio_oneshot( &audio_ui[2], 1.0f, 0.0f ); audio_unlock(); } - else { - if( global_miniworld.mode == 1 ){ - if( button_down(k_srbind_mback) ){ - global_miniworld.mode = 0; - global_miniworld.dest_spawn = NULL; - menu.disable_open = 0; - srinput.state = k_input_state_resume; - miniworld_helper_default(); - } - else { - m4x3f mmdl_inv; - m4x3_invert_full( global_miniworld.mmdl, mmdl_inv ); - v3f lco; - m4x3_mulv( mmdl_inv, localplayer.rb.co, lco ); - global_miniworld.dest_spawn = world_find_closest_spawn( dest, lco ); - } - } - else { - if( button_down( k_srbind_miniworld_teleport ) ){ - global_miniworld.mode = 1; - menu.disable_open = 1; - miniworld_helper_tele(); - } - } - } } static void ent_miniworld_goback(void){