5 struct global_ent_route global_ent_route
;
7 entity_call_result
ent_route_call( world_instance
*world
, ent_call
*call
)
9 u32 index
= mdl_entity_id_id( call
->id
);
10 ent_route
*route
= mdl_arritm( &world
->ent_route
, index
);
12 if( call
->function
== 0 )
14 if( localplayer
.subsystem
== k_player_subsystem_walk
)
16 world_entity_set_focus( call
->id
);
17 world_entity_focus_modal();
22 if( (global_ent_route
.helper_weekly
=
23 gui_new_helper( input_button_list
[k_srbind_mleft
], &text
)))
24 vg_strcat( &text
, "weekly" );
26 if( (global_ent_route
.helper_alltime
=
27 gui_new_helper( input_button_list
[k_srbind_mright
], &text
)))
28 vg_strcat( &text
, "all time" );
30 if( gui_new_helper( input_button_list
[k_srbind_mback
], &text
) )
31 vg_strcat( &text
, "exit" );
34 return k_entity_call_result_OK
;
37 return k_entity_call_result_unhandled
;
40 void ent_route_preupdate( ent_focus_context
*ctx
)
45 world_instance
*world
= ctx
->world
;
46 ent_route
*route
= mdl_arritm( &world
->ent_route
, ctx
->index
);
50 if( __builtin_expect( world
->meta
.info
.version
>= 103, 1 ) )
51 cam_id
= route
->id_camera
;
53 world_entity_focus_camera( world
, cam_id
);
55 if( button_down( k_srbind_mleft
) ){
56 world_sfd
.view_weekly
= 1;
57 world_sfd_compile_active_scores();
60 if( button_down( k_srbind_mright
) ){
61 world_sfd
.view_weekly
= 0;
62 world_sfd_compile_active_scores();
65 global_ent_route
.helper_alltime
->greyed
=!world_sfd
.view_weekly
;
66 global_ent_route
.helper_weekly
->greyed
= world_sfd
.view_weekly
;
68 if( button_down( k_srbind_mback
) )
70 world_entity_exit_modal();
71 world_entity_clear_focus();