X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=ent_route.c;h=fa1d66900c452edbf58f5641cf8351f5d1a574c7;hb=e311bbe2fa903a7e2a922f202f389b799193195d;hp=a11464093b6646c84838a9e5d110596a2d53f92e;hpb=4eb81766e4e7c54599b057ebf57b7fab01cd0726;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/ent_route.c b/ent_route.c index a114640..fa1d669 100644 --- a/ent_route.c +++ b/ent_route.c @@ -12,6 +12,20 @@ static void ent_route_call( world_instance *world, ent_call *call ){ if( call->function == 0 ){ /* view() */ if( localplayer.subsystem == k_player_subsystem_walk ){ world_entity_focus( call->id ); + + gui_helper_clear(); + vg_str text; + + if( (global_ent_route.helper_weekly = + gui_new_helper( input_button_list[k_srbind_mleft], &text ))) + vg_strcat( &text, "weekly" ); + + if( (global_ent_route.helper_alltime = + gui_new_helper( input_button_list[k_srbind_mright], &text ))) + vg_strcat( &text, "all time" ); + + if( gui_new_helper( input_button_list[k_srbind_mback], &text ) ) + vg_strcat( &text, "exit" ); } } else { @@ -33,13 +47,22 @@ static void ent_route_preupdate( ent_route *route, int active ){ world_entity_focus_camera( world, cam_id ); - gui_helper_action( button_display_string( k_srbind_mleft ), "weekly" ); - gui_helper_action( button_display_string( k_srbind_mright ), "all time" ); + if( button_down( k_srbind_mleft ) ){ + world_sfd.view_weekly = 1; + world_sfd_compile_active_scores(); + } + + if( button_down( k_srbind_mright ) ){ + world_sfd.view_weekly = 0; + world_sfd_compile_active_scores(); + } - gui_helper_action( button_display_string( k_srbind_mback ), "exit" ); + global_ent_route.helper_alltime->greyed =!world_sfd.view_weekly; + global_ent_route.helper_weekly->greyed = world_sfd.view_weekly; if( button_down( k_srbind_mback ) ){ world_entity_unfocus(); + gui_helper_clear(); return; } }