#include "vg/vg_steam_ugc.h"
#include "vg/vg_msg.h"
+#include "vg/vg_tex.h"
+#include "vg/vg_image.h"
+#include "vg/vg_loader.h"
#include "ent_skateshop.h"
#include "world.h"
#include "player.h"
#include "save.h"
#include "network.h"
+struct global_skateshop global_skateshop =
+{
+ .render={.reg_id=0xffffffff,.world_reg=0xffffffff}
+};
+
/*
* Checks string equality but does a hash check first
*/
}
/* TODO: migrate to addon.c */
-static void skateshop_autostart_loading(void){
+void skateshop_autostart_loading(void)
+{
if( !vg_loader_availible() ) return;
SDL_AtomicLock( &addon_system.sl_cache_using_resources );
/*
* VG event init
*/
-static void skateshop_init(void){
+void skateshop_init(void)
+{
vg_async_call( skateshop_init_async, NULL, 0 );
}
* VG event preupdate
*/
void temp_update_playermodel(void);
-static void ent_skateshop_preupdate( ent_skateshop *shop, int active ){
+void ent_skateshop_preupdate( ent_skateshop *shop, int active )
+{
if( !active ) return;
/* input filter */
localplayer.board_view_slot = cache_id;
network_send_item( k_netmsg_playeritem_board );
- world_entity_unfocus();
+ world_entity_exit_modal();
+ world_entity_clear_focus();
gui_helper_clear();
skaterift_autosave(1);
return;
if( button_down( k_srbind_maccept ) ){
network_send_item( k_netmsg_playeritem_player );
- world_entity_unfocus();
+ world_entity_exit_modal();
+ world_entity_clear_focus();
gui_helper_clear();
}
}
vg_fatal_error( "Unknown store (%u)\n", shop->type );
}
- if( button_down( k_srbind_mback ) ){
+ if( button_down( k_srbind_mback ) )
+ {
if( shop->type == k_skateshop_type_charshop )
network_send_item( k_netmsg_playeritem_player );
- world_entity_unfocus();
+ world_entity_exit_modal();
+ world_entity_clear_focus();
gui_helper_clear();
return;
}
}
-static void skateshop_world_preupdate( world_instance *world ){
+void skateshop_world_preupdate( world_instance *world )
+{
for( u32 i=0; i<mdl_arrcount(&world->ent_skateshop); i++ ){
ent_skateshop *shop = mdl_arritm( &world->ent_skateshop, i );
/*
* World: render event
*/
-static void skateshop_render( ent_skateshop *shop ){
+void skateshop_render( ent_skateshop *shop )
+{
if( shop->type == k_skateshop_type_boardshop )
skateshop_render_boardshop( shop );
else if( shop->type == k_skateshop_type_charshop )
vg_fatal_error( "Unknown store (%u)\n", shop->type );
}
-static void skateshop_render_nonfocused( world_instance *world, camera *cam ){
+void skateshop_render_nonfocused( world_instance *world, vg_camera *cam )
+{
for( u32 j=0; j<mdl_arrcount( &world->ent_skateshop ); j ++ ){
ent_skateshop *shop = mdl_arritm(&world->ent_skateshop, j );
/*
* Entity logic: entrance event
*/
-static void ent_skateshop_call( world_instance *world, ent_call *call ){
+void ent_skateshop_call( world_instance *world, ent_call *call )
+{
u32 index = mdl_entity_id_id( call->id );
ent_skateshop *shop = mdl_arritm( &world->ent_skateshop, index );
vg_info( "skateshop_call\n" );
vg_info( "Entering skateshop\n" );
- world_entity_focus( call->id );
+ world_entity_set_focus( call->id );
+ world_entity_focus_modal();
gui_helper_clear();
if( shop->type == k_skateshop_type_boardshop ){