#include "gui.h"
#include "menu.h"
#include "pointcloud.h"
+#include "highscores.h"
/*
* Checks string equality but does a hash check first
}
}
-/* generic reciever */
-VG_STATIC void workshop_async_any_complete( void *data, u32 size )
-{
- skaterift_end_op();
-}
-
/*
* op/subroutine: k_workshop_op_item_load
* -----------------------------------------------------------------------------
vg_str file = folder;
vg_strcat( &file, "/" );
vg_strcat( &file, entry->d_name );
- if( !vg_strgood( &file ) ) break;
+ if( !vg_strgood( &file ) ) continue;
char *ext = vg_strch( &file, '.' );
if( !ext ) continue;
if( !global_skateshop.active ) return;
- world_instance *world = get_active_world();
+ world_instance *world = world_current_instance();
ent_skateshop *shop = global_skateshop.ptr_ent;
if( global_skateshop.world_registry_count ){
gui_helper_action( axis_display_string(k_sraxis_mbrowse_h), "browse" );
}
+
+ if( skaterift.async_op == k_async_op_none ){
+ gui_helper_action( button_display_string(k_srbind_maccept), "load" );
+ }
int change = 0;
if( button_down( k_srbind_mleft ) ){
}
}
- if( change && (pointcloud.anim == k_pointcloud_anim_idle) ){
+ if( change && (pointcloud.anim == k_pointcloud_anim_idle) &&
+ pointcloud.visibility == 1.0f ){
pointcloud.anim = k_pointcloud_anim_hiding;
pointcloud.anim_start = vg.time;
}
- if( button_down( k_srbind_maccept ) ){
+ if( (skaterift.async_op == k_async_op_none ) &&
+ button_down( k_srbind_maccept ) )
+ {
+ struct registry_world *rw = &global_skateshop.world_registry[
+ global_skateshop.selected_world_id ];
+
vg_info( "Select world (%u)\n", global_skateshop.selected_world_id );
- global_skateshop_exit();
+ skaterift_change_world( rw->foldername );
return;
}
}
VG_STATIC void skateshop_render_boardshop(void)
{
- world_instance *world = get_active_world();
+ world_instance *world = world_current_instance();
ent_skateshop *shop = global_skateshop.ptr_ent;
u32 slot_count = vg_list_size(global_skateshop.shop_view_slots);
float scale = 0.2f,
thickness = 0.03f;
- font3d_bind( &world_global.font, &main_camera );
+ font3d_bind( &gui.font, &main_camera );
shader_model_font_uColour( (v4f){1.0f,1.0f,1.0f,1.0f} );
/* Selection counter
m4x3_mul( mrack, mlocal, mmdl );
if( global_skateshop.registry_count == 0 ){
- font3d_simple_draw( &world_global.font, 0,
+ font3d_simple_draw( &gui.font, 0,
"Nothing installed", &main_camera, mmdl );
}
else{
i+=highscore_intl( buf+i, global_skateshop.registry_count, 3 );
buf[i++] = '\0';
- font3d_simple_draw( &world_global.font, 0, buf, &main_camera, mmdl );
+ font3d_simple_draw( &gui.font, 0, buf, &main_camera, mmdl );
}
struct cache_board *cache_ptr = skateshop_selected_cache_if_loaded();
* ----------------------------------------------------------------- */
m3x3_zero( mlocal );
m3x3_setdiagonalv3( mlocal, (v3f){ scale, scale, thickness } );
- mlocal[3][0] = -font3d_string_width( &world_global.font, 0, info->title );
+ mlocal[3][0] = -font3d_string_width( &gui.font, 0, info->title );
mlocal[3][0] *= scale*0.5f;
mlocal[3][1] = 0.1f;
mlocal[3][2] = 0.0f;
m4x3_mul( mtext, mlocal, mmdl );
- font3d_simple_draw( &world_global.font, 0, info->title, &main_camera, mmdl );
+ font3d_simple_draw( &gui.font, 0, info->title, &main_camera, mmdl );
/* Author name
* ----------------------------------------------------------------- */
scale *= 0.4f;
m3x3_setdiagonalv3( mlocal, (v3f){ scale, scale, thickness } );
- mlocal[3][0] = -font3d_string_width( &world_global.font, 0,
- info->author_name );
+ mlocal[3][0] = -font3d_string_width( &gui.font, 0, info->author_name );
mlocal[3][0] *= scale*0.5f;
mlocal[3][1] = 0.0f;
mlocal[3][2] = 0.0f;
m4x3_mul( mtext, mlocal, mmdl );
- font3d_simple_draw( &world_global.font, 0,
- info->author_name, &main_camera, mmdl );
+ font3d_simple_draw( &gui.font, 0, info->author_name, &main_camera, mmdl );
}
VG_STATIC void skateshop_render_charshop(void)
VG_STATIC void skateshop_render_worldshop(void)
{
- world_instance *world = get_active_world();
+ world_instance *world = world_current_instance();
ent_skateshop *shop = global_skateshop.ptr_ent;
ent_marker *mark_display = mdl_arritm( &world->ent_marker,
vg_strcat( &info, "No worlds installed" );
}
+ if( skaterift.async_op == k_async_op_world_loading ||
+ skaterift.async_op == k_async_op_world_preloading ){
+ vg_strcat( &info, "Loading..." );
+ }
+
m4x3f mtext,mlocal,mtextmdl;
mdl_transform_m4x3( &mark_info->transform, mtext );
- font3d_bind( &world_global.font, &main_camera );
+ font3d_bind( &gui.font, &main_camera );
shader_model_font_uColour( (v4f){1.0f,1.0f,1.0f,1.0f} );
float scale = 0.2f, thickness = 0.015f, scale1 = 0.08f;
m3x3_zero( mlocal );
m3x3_setdiagonalv3( mlocal, (v3f){ scale, scale, thickness } );
- mlocal[3][0] = -font3d_string_width( &world_global.font, 0, buftext );
+ mlocal[3][0] = -font3d_string_width( &gui.font, 0, buftext );
mlocal[3][0] *= scale*0.5f;
mlocal[3][1] = 0.1f;
mlocal[3][2] = 0.0f;
m4x3_mul( mtext, mlocal, mtextmdl );
- font3d_simple_draw( &world_global.font, 0, buftext, &main_camera, mtextmdl );
+ font3d_simple_draw( &gui.font, 0, buftext, &main_camera, mtextmdl );
m3x3_setdiagonalv3( mlocal, (v3f){ scale1, scale1, thickness } );
- mlocal[3][0] = -font3d_string_width( &world_global.font, 0, bufsubtext );
+ mlocal[3][0] = -font3d_string_width( &gui.font, 0, bufsubtext );
mlocal[3][0] *= scale1*0.5f;
mlocal[3][1] = -scale1*0.3f;
m4x3_mul( mtext, mlocal, mtextmdl );
- font3d_simple_draw( &world_global.font, 0, bufsubtext,
- &main_camera, mtextmdl );
+ font3d_simple_draw( &gui.font, 0, bufsubtext, &main_camera, mtextmdl );
/* pointcloud */
m4x3f mmdl;