#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) );
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 ){
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 );
miniworld_icon( cam, icon, challenge->transform.co, 1.0f );
}
+ for( u32 i=0; i<mdl_arrcount(&dest_world->ent_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; i<mdl_arrcount(&dest_world->ent_route); i++ ){
ent_route *route = mdl_arritm( &dest_world->ent_route, i );
(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();
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){