update helpers/location to 'frosted' ui
[carveJwlIkooP6JGAAIwe30JlM.git] / ent_route.c
index 11b680d6f08a00cb6419754ad2998fe676200017..8564eed3c5c8c60400c2eb69e5a71b7ad599e1b1 100644 (file)
@@ -4,12 +4,13 @@
 
 struct global_ent_route global_ent_route;
 
-void ent_route_call( world_instance *world, ent_call *call )
+entity_call_result ent_route_call( world_instance *world, ent_call *call )
 {
    u32 index = mdl_entity_id_id( call->id );
    ent_route *route = mdl_arritm( &world->ent_route, index );
 
-   if( call->function == 0 ){ /* view() */
+   if( call->function == 0 )
+   { /* view() */
       if( localplayer.subsystem == k_player_subsystem_walk )
       {
          world_entity_set_focus( call->id );
@@ -20,29 +21,30 @@ void ent_route_call( world_instance *world, ent_call *call )
 
          if( (global_ent_route.helper_weekly = 
                   gui_new_helper( input_button_list[k_srbind_mleft], &text )))
-            vg_strcat( &text, "weekly" );
+            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" );
+            vg_strcat( &text, "All time" );
 
          if( gui_new_helper( input_button_list[k_srbind_mback], &text ) )
-            vg_strcat( &text, "exit" );
+            vg_strcat( &text, "Exit" );
       }
+
+      return k_entity_call_result_OK;
    }
-   else {
-      /* TODO: Comrpession */
-      vg_print_backtrace();
-      vg_error( "Unhandled function id: %u\n", call->function );
-   }
+
+   return k_entity_call_result_unhandled;
 }
 
-/* TODO: these should recieve the world instance */
-void ent_route_preupdate( ent_route *route, int active )
+void ent_route_preupdate( ent_focus_context *ctx )
 {
-   if( !active ) return;
+   if( !ctx->active ) 
+      return;
+
+   world_instance *world = ctx->world;
+   ent_route *route = mdl_arritm( &world->ent_route, ctx->index );
 
-   world_instance *world = world_current_instance();
    u32 cam_id = 0;
    
    if( __builtin_expect( world->meta.info.version >= 103, 1 ) )