From: hgn Date: Mon, 5 May 2025 19:28:21 +0000 (+0100) Subject: legend, skip cutscene X-Git-Url: https://harrygodden.com/git/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=carveJwlIkooP6JGAAIwe30JlM.git legend, skip cutscene --- diff --git a/content_skaterift/textures/menu_icons.qoi b/content_skaterift/textures/menu_icons.qoi index 695abb3..094aa67 100644 Binary files a/content_skaterift/textures/menu_icons.qoi and b/content_skaterift/textures/menu_icons.qoi differ diff --git a/icons/icon_comb.png b/icons/icon_comb.png index 2263421..3d333db 100644 Binary files a/icons/icon_comb.png and b/icons/icon_comb.png differ diff --git a/icons/legend.svg b/icons/legend.svg new file mode 100644 index 0000000..fc771cf --- /dev/null +++ b/icons/legend.svg @@ -0,0 +1,232 @@ + + + +URBANLEGENDURBAN diff --git a/icons/make.py b/icons/make.py index 7302a10..550b91d 100644 --- a/icons/make.py +++ b/icons/make.py @@ -4,7 +4,8 @@ f = open( "../src/ui_menu_icons.h0", "w" ) all = [ "early", "Early adopter", "top3", "Global top 3 time record", - "top10", "Global top 10 time record" ] + "top10", "Global top 10 time record", + "legend", "Previously a record holder in the first year"] mega_string = "" msl = 0 diff --git a/src/gameserver_database.c b/src/gameserver_database.c index a9f6282..f7079f5 100644 --- a/src/gameserver_database.c +++ b/src/gameserver_database.c @@ -357,8 +357,6 @@ enum request_status _gs_db_get_profile( vg_msg *msg, u64 steamid ) break; } } - u32 flags = 0x00; - vg_msg_wkvnum( msg, "flags", k_vg_msg_u32, 1, &flags ); vg_msg_wkvnum( msg, "race3", k_vg_msg_u16, 1, &top3_count ); vg_msg_wkvnum( msg, "race10", k_vg_msg_u16, 1, &top10_count ); @@ -370,6 +368,8 @@ enum request_status _gs_db_get_profile( vg_msg *msg, u64 steamid ) vg_msg_wkvstr( msg, "username", profile.name ); if( profile.cc[0] ) vg_msg_wkvstr( msg, "cc", profile.cc ); + + vg_msg_wkvnum( msg, "flags", k_vg_msg_u32, 1, &profile.flags ); } return k_request_status_ok; diff --git a/src/gameserver_database.h b/src/gameserver_database.h index 9fd2f46..a7a0102 100644 --- a/src/gameserver_database.h +++ b/src/gameserver_database.h @@ -49,6 +49,7 @@ struct skaterift_profile { char name[128]; char cc[4]; + u32 flags; }; struct skaterift_entry diff --git a/src/menu.c b/src/menu.c index 45b81ef..137ee26 100644 --- a/src/menu.c +++ b/src/menu.c @@ -466,7 +466,13 @@ void menu_gui( ui_context *ctx ) if( button_down( k_srbind_mopen ) ) { - menu_open( k_menu_page_main ); + if( _cutscene.state >= k_cutscene_state_ready ) + { + menu.cs_row = 0; + menu_open( k_menu_page_cutscene ); + } + else + menu_open( k_menu_page_main ); return; } @@ -952,6 +958,47 @@ void menu_gui( ui_context *ctx ) goto menu_draw; } +/* PAGE spectate */ + else if( menu.page == k_menu_page_cutscene ) + { + i32 R = menu_nav( &menu.cs_row, mh, 1 ); + ui_rect panel = { 0,0, 600, 300 }, + screen = { 0,0, vg.window_x,vg.window_y }; + ui_rect_center( screen, panel ); + ui_fill( ctx, panel, ui_opacity( GUI_COL_DARK, 0.35f ) ); + ui_outline( ctx, panel, 1, GUI_COL_NORM, 0 ); + ui_rect_pad( panel, (ui_px[]){8,8} ); + + ui_rect title; + ui_split( panel, k_ui_axis_h, 28*2, 0, title, panel ); + ctx->font = &vgf_default_title; + ui_text( ctx, title, "Skip Cutscene?", 1, k_ui_align_middle_center, 0 ); + + ui_split( panel, k_ui_axis_h, 28, 0, title, panel ); + ctx->font = &vgf_default_large; + + ui_rect end = { panel[0], panel[1] + panel[3] - 48, panel[2], 48 }, a,b; + ui_split_ratio( end, k_ui_axis_v, 0.5f, 2, a, b ); + + if( menu_button( ctx, a, R == 0, steam_ready, "Skip" ) ) + { + _cutscene.fadeout = 1; + _cutscene.fadeout_start = _cutscene.time; + _cutscene.meta.info.end_frame = (f32)_cutscene.meta.info.framerate * (_cutscene.time + 0.25f); + menu_close(); + } + + if( menu_button( ctx, b, R == 1, 1, "No" ) || button_down( k_srbind_mback ) ) + { + vg_audio_lock(); + vg_audio_oneshot( &audio_ui[3], 1.0f, 0.0f, 0, 0 ); + vg_audio_unlock(); + menu_close(); + return; + } + + goto menu_draw; + } /* TOP BAR * -------------------------------------------------------------------*/ diff --git a/src/menu.h b/src/menu.h index 8843bf9..d25fbeb 100644 --- a/src/menu.h +++ b/src/menu.h @@ -18,6 +18,7 @@ enum menu_page k_menu_page_impromptu_guide, k_menu_page_quick, k_menu_page_spectate, + k_menu_page_cutscene, }; enum menu_main_subpage @@ -43,7 +44,8 @@ struct global_menu prem_row, prof_row, quick_row, - spectate_row; + spectate_row, + cs_row; f32 mouse_dist; /* used for waking up mouse */ f32 repeater; diff --git a/src/network_requests.c b/src/network_requests.c index 3413c5b..d5447fc 100644 --- a/src/network_requests.c +++ b/src/network_requests.c @@ -149,6 +149,9 @@ void network_publish_laptime( const char *mod_uid, const char *route_uid, f64 la if( !network_connected() ) return; + if( vg_console.cheats ) + return; + i32 time_centiseconds = lap_time * 100.0; netmsg_request *packet = alloca( sizeof(netmsg_request) + 512 ); diff --git a/src/skaterift.c b/src/skaterift.c index 7721707..d95fcd0 100644 --- a/src/skaterift.c +++ b/src/skaterift.c @@ -414,15 +414,9 @@ static void render_main_game(void) struct cs_instance *inst = _cutscene.player_binding; struct skeleton *sk = &localplayer.skeleton; for( u32 i=0; ibone_count; i ++ ) - { m4x3_copy( inst->skinning_data[i], localplayer.final_mtx[i] ); - } - } - else if( skaterift.activity == k_skaterift_replay ) - { - //FIXME - //player__animate_from_replay( &player_replay.local ); } + else if( skaterift.activity == k_skaterift_replay ){} else { player__animate(); diff --git a/src/ui_menu_icons.h0 b/src/ui_menu_icons.h0 index f01cf7b..96e136a 100644 --- a/src/ui_menu_icons.h0 +++ b/src/ui_menu_icons.h0 @@ -1,10 +1,12 @@ struct menu_icon_inf k_menu_icons[] = {{0}, {14}, {39}, +{65}, }; -const char k_menu_icon_descriptions[] = {69,97,114,108,121,32,97,100,111,112,116,101,114,0,71,108,111,98,97,108,32,116,111,112,32,51,32,116,105,109,101,32,114,101,99,111,114,100,0,71,108,111,98,97,108,32,116,111,112,32,49,48,32,116,105,109,101,32,114,101,99,111,114,100,0,}; +const char k_menu_icon_descriptions[] = {69,97,114,108,121,32,97,100,111,112,116,101,114,0,71,108,111,98,97,108,32,116,111,112,32,51,32,116,105,109,101,32,114,101,99,111,114,100,0,71,108,111,98,97,108,32,116,111,112,32,49,48,32,116,105,109,101,32,114,101,99,111,114,100,0,80,114,101,118,105,111,117,115,108,121,32,97,32,114,101,99,111,114,100,32,104,111,108,100,101,114,32,105,110,32,116,104,101,32,102,105,114,115,116,32,121,101,97,114,0,}; enum menu_icon { k_menu_icon_early = 0, k_menu_icon_top3 = 1, k_menu_icon_top10 = 2, +k_menu_icon_legend = 3, }; diff --git a/src/user_profile.c b/src/user_profile.c index 79f1801..aa7d1ee 100644 --- a/src/user_profile.c +++ b/src/user_profile.c @@ -227,7 +227,7 @@ void _user_profile_ui( ui_context *ctx, ui_rect box, u64 steamid ) enum menu_icon which; u16 count; } - medal_list[5]; + medal_list[8]; u32 medal_count = 0; u16 race3 = 0, race10 = 0; @@ -244,6 +244,18 @@ void _user_profile_ui( ui_context *ctx, ui_rect box, u64 steamid ) medal_list[ medal_count++ ].count = _user_profile.race10; } + if( _user_profile.flags & 0x2 ) + { + medal_list[ medal_count ].which = k_menu_icon_legend; + medal_list[ medal_count++ ].count = 1; + } + + if( _user_profile.flags & 0x1 ) + { + medal_list[ medal_count ].which = k_menu_icon_early; + medal_list[ medal_count++ ].count = 1; + } + if( medal_count ) { vg_ui.frosting = 0.015f;