From: MirceaKitsune Date: Mon, 27 Sep 2010 13:37:19 +0000 (+0300) Subject: More intermission music client side, and fix an issue I introduced X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9fbce161fcfc2030c22a8fa45be0bdc1fd72fb92;p=voretournament%2Fvoretournament.git More intermission music client side, and fix an issue I introduced --- diff --git a/data/defaultVoretournament.cfg b/data/defaultVoretournament.cfg index a32c3e77..3da052d0 100644 --- a/data/defaultVoretournament.cfg +++ b/data/defaultVoretournament.cfg @@ -1226,9 +1226,9 @@ set sv_foginterval 0 set g_cdtracks_remaplist "feeding_frenzy digital-pursuit brokenlight ninesix sixtyfour_revisited infiltrator stone_fortress high_tech_lab space_walk meltdown inner-peace out-there variable quiet boss_theme ghost-town" "list used by mapinfo system to automatically assign cdtracks - must match the cd remap command" set g_cdtracks_dontusebydefault "" "list used by mapinfo system to automatically assign cdtracks - must be a subset of g_cdtracks_remaplist" cd remap $g_cdtracks_remaplist -seta sv_intermission 1 "play intermission music" -seta sv_intermission_cdtrack_win "win_music" -seta sv_intermission_cdtrack_lose "lose_music" +seta cl_intermission 1 "play intermission music" +seta cl_intermission_cdtrack_win "win_music" +seta cl_intermission_cdtrack_lose "lose_music" seta menu_cdtrack feeding_frenzy // maxidle (in seconds): kick players idle for more than that amount of time diff --git a/data/qcsrc/client/View.qc b/data/qcsrc/client/View.qc index c9b1c7c6..a0e9db92 100644 --- a/data/qcsrc/client/View.qc +++ b/data/qcsrc/client/View.qc @@ -490,57 +490,70 @@ void CSQC_UpdateView(float w, float h) ) teamradar_view(); - // Draw Artwork + // Draw artwork and play intermission music if(intermission && !isdemo()) // the match has ended - if(cvar("cl_artwork")) if(!spectatee_status && gametype != GAME_RPG) // no one wins or loses in RPG { - if(artwork_image == "") + if(cvar("cl_artwork")) { - if(getstati(STAT_WINNING)) // we are the winner + if(artwork_image == "") { - if(cvar("cl_artwork_win")) - artwork_image = strcat("gfx/artwork_won_", ftos(floor(1 + (random() * cvar("cl_artwork_win"))))); + if(getstati(STAT_WINNING)) // we are the winner + { + if(cvar("cl_artwork_win")) + artwork_image = strcat("gfx/artwork_won_", ftos(floor(1 + (random() * cvar("cl_artwork_win"))))); + } + else // we have lost + { + if(cvar("cl_artwork_lose")) + artwork_image = strcat("gfx/artwork_lost_", ftos(floor(1 + (random() * cvar("cl_artwork_lose"))))); + } + artwork_image = strzone(artwork_image); + } + + if(cvar("cl_artwork_stretch")) + { + artwork_size_x = vid_conwidth; + artwork_size_y = vid_conheight; + artwork_pos_x = 0; + artwork_pos_y = 0; } - else // we have lost + else { - if(cvar("cl_artwork_lose")) - artwork_image = strcat("gfx/artwork_lost_", ftos(floor(1 + (random() * cvar("cl_artwork_lose"))))); + artwork_size_x = max(vid_conwidth, vid_conheight); + artwork_size_y = max(vid_conwidth, vid_conheight); + artwork_pos_x = (vid_conwidth - artwork_size_x) / 2; + artwork_pos_y = (vid_conheight - artwork_size_y) / 2; } - artwork_image = strzone(artwork_image); - } - if(cvar("cl_artwork_stretch")) - { - artwork_size_x = vid_conwidth; - artwork_size_y = vid_conheight; - artwork_pos_x = 0; - artwork_pos_y = 0; + if(artwork_fade < cvar("cl_artwork_alpha") && cvar("cl_artwork_fade")) + artwork_fade += frametime * cvar("cl_artwork_fade"); + else + artwork_fade = cvar("cl_artwork_alpha"); + + if(artwork_image != "") + drawpic(artwork_pos, artwork_image, artwork_size, '1 1 1', artwork_fade, DRAWFLAG_NORMAL); } else { - artwork_size_x = max(vid_conwidth, vid_conheight); - artwork_size_y = max(vid_conwidth, vid_conheight); - artwork_pos_x = (vid_conwidth - artwork_size_x) / 2; - artwork_pos_y = (vid_conheight - artwork_size_y) / 2; + if(artwork_image != "") + { + strunzone(artwork_image); + artwork_image = ""; + } + artwork_fade = 0; } - if(artwork_fade < cvar("cl_artwork_alpha") && cvar("cl_artwork_fade")) - artwork_fade += frametime * cvar("cl_artwork_fade"); - else - artwork_fade = cvar("cl_artwork_alpha"); - - if(artwork_image != "") - drawpic(artwork_pos, artwork_image, artwork_size, '1 1 1', artwork_fade, DRAWFLAG_NORMAL); - } - else - { - if(artwork_image != "") + if(cvar("cl_intermission")) { - strunzone(artwork_image); - artwork_image = ""; + string s; + if(getstati(STAT_WINNING)) + s = cvar_string("cl_intermission_cdtrack_win"); + else + s = cvar_string("cl_intermission_cdtrack_lose"); + if(s != "") + localcmd(strcat("\ncd play ", s, "\n")); } - artwork_fade = 0; } // draw sbar diff --git a/data/qcsrc/menu/voret/dialog_multiplayer_playersetup.c b/data/qcsrc/menu/voret/dialog_multiplayer_playersetup.c index c88136f0..95033997 100644 --- a/data/qcsrc/menu/voret/dialog_multiplayer_playersetup.c +++ b/data/qcsrc/menu/voret/dialog_multiplayer_playersetup.c @@ -108,7 +108,7 @@ void fillVoretPlayerSettingsTab(entity me) me.TR(me); me.TR(me); me.TD(me, 1, 2.8, e = makeVoretCheckBox(0, "cl_artwork", "Intermission art & music")); - makeMulti(e, "sv_intermission"); + makeMulti(e, "cl_intermission"); me.TR(me); me.TR(me); me.TDempty(me, 0.4); diff --git a/data/qcsrc/server/g_world.qc b/data/qcsrc/server/g_world.qc index cd85cdea..9a8db612 100644 --- a/data/qcsrc/server/g_world.qc +++ b/data/qcsrc/server/g_world.qc @@ -1333,7 +1333,6 @@ void DumpStats(float final) void FixIntermissionClient(entity e) { - string s; if(!e.autoscreenshot) // initial call { e.angles = e.v_angle; @@ -1351,16 +1350,8 @@ void FixIntermissionClient(entity e) e.weaponentity.weaponentity.effects = EF_NODRAW; } if(clienttype(e) == CLIENTTYPE_REAL) - if(cvar("sv_intermission")) - if(!e.spectatee_status && !cvar("g_rpg")) // no one wins or loses in RPG { stuffcmd(e, "\nscr_printspeed 1000000\n"); - if(e.winning) - s = cvar_string("sv_intermission_cdtrack_win"); - else - s = cvar_string("sv_intermission_cdtrack_lose"); - if(s != "") - stuffcmd(e, strcat("\ncd play ", s, "\n")); msg_entity = e; WriteByte(MSG_ONE, SVC_INTERMISSION); }