5 struct global_ent_route global_ent_route
;
7 void 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 ){ /* view() */
13 if( localplayer
.subsystem
== k_player_subsystem_walk
)
15 world_entity_set_focus( call
->id
);
16 world_entity_focus_modal();
21 if( (global_ent_route
.helper_weekly
=
22 gui_new_helper( input_button_list
[k_srbind_mleft
], &text
)))
23 vg_strcat( &text
, "weekly" );
25 if( (global_ent_route
.helper_alltime
=
26 gui_new_helper( input_button_list
[k_srbind_mright
], &text
)))
27 vg_strcat( &text
, "all time" );
29 if( gui_new_helper( input_button_list
[k_srbind_mback
], &text
) )
30 vg_strcat( &text
, "exit" );
34 /* TODO: Comrpession */
36 vg_error( "Unhandled function id: %u\n", call
->function
);
40 /* TODO: these should recieve the world instance */
41 void ent_route_preupdate( ent_route
*route
, int active
)
45 world_instance
*world
= world_current_instance();
48 if( __builtin_expect( world
->meta
.info
.version
>= 103, 1 ) )
49 cam_id
= route
->id_camera
;
51 world_entity_focus_camera( world
, cam_id
);
53 if( button_down( k_srbind_mleft
) ){
54 world_sfd
.view_weekly
= 1;
55 world_sfd_compile_active_scores();
58 if( button_down( k_srbind_mright
) ){
59 world_sfd
.view_weekly
= 0;
60 world_sfd_compile_active_scores();
63 global_ent_route
.helper_alltime
->greyed
=!world_sfd
.view_weekly
;
64 global_ent_route
.helper_weekly
->greyed
= world_sfd
.view_weekly
;
66 if( button_down( k_srbind_mback
) )
68 world_entity_exit_modal();
69 world_entity_clear_focus();