- localplayer_cmd_respawn( 0, NULL );
- cl_menu_go_away = 1;
- game_menu.page = 0;
-}
-
-VG_STATIC void menu_btn_fuckoff( int event )
-{
- vg.window_should_close = 1;
-}
-
-VG_STATIC void menu_btn_quit( int event )
-{
- game_menu.page = k_menu_page_quit;
- game_menu.loc = menu_get_loc( "text_yes" );
-}
-
-VG_STATIC void menu_btn_settings( int event )
-{
- game_menu.page = k_menu_page_settings;
- game_menu.loc = menu_get_loc( "fov_slider" );
-}
-
-VG_STATIC void menu_btn_skater( int event )
-{
- game_menu.page = k_menu_page_skater;
-}
-
-VG_STATIC void menu_btn_blur( int event )
-{
- cl_blur ^= 0x1;
-}
-
-VG_STATIC void menu_btn_invert_y( int event )
-{
- cl_invert_y ^= 0x1;
-}
-
-VG_STATIC void menu_btn_map( int event )
-{
- game_menu.page = k_menu_page_map;
- game_menu.map_count = 0;
- game_menu.selected_map = 0;
-
- tinydir_dir dir;
- tinydir_open( &dir, "maps" );
-
- while( dir.has_next ){
- tinydir_file file;
- tinydir_readfile( &dir, &file );
-
- if( file.is_reg ){
- struct menu_map_file *mf = &game_menu.maps_list[ game_menu.map_count ];
-
- vg_strncpy( file.name, mf->name,
- vg_list_size(game_menu.maps_list[0].name),
- k_strncpy_always_add_null );
-
- game_menu.map_count ++;
- if( game_menu.map_count == vg_list_size(game_menu.maps_list) )
- break;
- }
-
- tinydir_next( &dir );
- }
-
- tinydir_close(&dir);
-}
-
-VG_STATIC void menu_crap_ui(void)
-{
-#if 0
- if( cl_menu && (game_menu.page == k_menu_page_map) ){
- ui_rect box;
- box[0] = vg.window_x/2 - 150;
- box[1] = vg.window_y/2 - 300;
- box[2] = 300;
- box[3] = 600;
-
- ui_fill_rect( box, 0xa0000000 );
-
- if( game_menu.map_count == 0 ){
- ui_text( (ui_rect){ vg.window_x/2, box[1]+8, 0,0 }, "No maps found", 1,
- k_text_align_center );
- }
- else{
- ui_rect_pad( box, 4 );
- box[3] = 16;
-
- for( int i=0; i<game_menu.map_count; i++ ){
- struct menu_map_file *mf = &game_menu.maps_list[ i ];
-
- ui_fill_rect( box, game_menu.selected_map == i? 0xa0ffffff:
- 0xa0808080 );
- ui_text( (ui_rect){ vg.window_x/2, box[1]+2, 0,0 },
- mf->name, 1, k_text_align_center );
- box[1] += 16+4;
- }
- }
- }
-#endif
-}
-
-VG_STATIC void steam_on_game_overlay( CallbackMsg_t *msg )
-{
- GameOverlayActivated_t *inf = (GameOverlayActivated_t *)msg->m_pubParam;
- vg_info( "Steam game overlay activated; pausing\n" );
-
- if( inf->m_bActive ){
- cl_menu = 1;
- game_menu.page = k_menu_page_main;
- game_menu.loc = menu_get_loc( "text_skater" );
- }
-}
-
-VG_STATIC void menu_init(void)
-{
-#if 0
- vg_apply_bind_str( &input_menu_h, "", "gp-ls-h" );
- vg_apply_bind_str( &input_menu_h, "+", "right" );
- vg_apply_bind_str( &input_menu_h, "-", "left" );
- vg_apply_bind_str( &input_menu_v, "", "-gp-ls-v" );
- vg_apply_bind_str( &input_menu_v, "+", "up" );
- vg_apply_bind_str( &input_menu_v, "-", "down" );
- vg_apply_bind_str( &input_menu_press, "", "gp-a" );
- vg_apply_bind_str( &input_menu_press, "", "\2enter" );
- vg_apply_bind_str( &input_menu_back, "", "gp-b" );
- vg_apply_bind_str( &input_menu_back, "", "\2escape" );
- vg_apply_bind_str( &input_menu_toggle_kbm, "", "\2escape" );
- vg_apply_bind_str( &input_menu_toggle, "", "\2gp-menu" );
-#endif
-
- vg_linear_clear( vg_mem.scratch );
-
- mdl_open( &menu_model, "models/rs_menu.mdl", vg_mem.rtmemory );
- mdl_load_metadata_block( &menu_model, vg_mem.rtmemory );
- mdl_load_array( &menu_model, &menu_markers, "ent_marker", vg_mem.rtmemory );
- //mdl_invert_uv_coordinates( &menu_model );
- mdl_async_load_glmesh( &menu_model, &menu_glmesh );
- mdl_close( &menu_model );
-
- vg_tex2d_load_qoi_async_file( "textures/menu.qoi",
- VG_TEX2D_CLAMP|VG_TEX2D_NEAREST,
- &tex_menu );
-
-
- for( int i=0; i<vg_list_size(menu_buttons); i++ ){
- struct menu_button *btn = &menu_buttons[i];
- btn->mesh = mdl_find_mesh( &menu_model, btn->name );
-
- if( !btn->mesh ){
- vg_info( "info: %s\n", btn->name );
- vg_fatal_error( "Menu programming error" );
- }
- }
-
- menu_mark_fov_max =
- ent_find_marker( &menu_model, &menu_markers, "fov_slider_max" );
- menu_mark_fov_min =
- ent_find_marker( &menu_model, &menu_markers, "fov_slider_min" );
- menu_mark_vol_max =
- ent_find_marker( &menu_model, &menu_markers, "vol_slider_max" );
- menu_mark_vol_min =
- ent_find_marker( &menu_model, &menu_markers, "vol_slider_min" );
- menu_mark_res_max =
- ent_find_marker( &menu_model, &menu_markers, "res_slider_max" );
- menu_mark_res_min =
- ent_find_marker( &menu_model, &menu_markers, "res_slider_min" );
-
- menu_mesh_fov_slider = mdl_find_mesh( &menu_model, "fov_slider" );
- menu_mesh_vol_slider = mdl_find_mesh( &menu_model, "vol_slider" );
- menu_mesh_res_slider = mdl_find_mesh( &menu_model, "res_slider" );
-
- shader_model_menu_register();
-
-#ifdef SR_NETWORKED
- steam_register_callback( k_iGameOverlayActivated, steam_on_game_overlay );
-#endif
-}
-
-VG_STATIC void menu_run_directional(void)
-{
-#if 0
- struct menu_button *btn = &menu_buttons[ game_menu.loc ];
-
- if( vg_input_button_down( &input_menu_press ) ){
- if( btn->fn_press ){
- audio_lock();
- audio_oneshot( &audio_ui[0], 1.0f, 0.0f );
- audio_unlock();
-
- btn->fn_press( 1 );
- return;
- }
- }
-
- if( menu_input_cooldown <= 0.0f ){
- v2f dir = { input_menu_h.axis.value,
- -input_menu_v.axis.value };
-
- if( v2_length2( dir ) > 0.8f*0.8f ){
- const char *link = NULL;
-
- if( fabsf(dir[0]) > fabsf(dir[1]) ){
- if( dir[0] > 0.0f ) link = btn->lr;
- else link = btn->ll;
- }
- else{
- if( dir[1] > 0.0f ) link = btn->ld;
- else link = btn->lu;
- }
-
- if( link ){
- game_menu.loc = menu_get_loc( link );
- menu_input_cooldown = 0.25f;
- }
- }
- }
-#endif
-}
-
-VG_STATIC int menu_page_should_backout(void)
-{
- return 0;
-#if 0
- return vg_input_button_down( &input_menu_back );
-#endif
-}