From b4c19832b9175becaa6652b7b5a9a26edbc99568 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 4 Nov 2014 17:14:24 +1100 Subject: [PATCH] Add new changes by Melanosuchus --- qcsrc/client/mapvoting.qc | 18 +++++++++++------- qcsrc/server/mapvoting.qc | 16 +++++++++++++--- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/qcsrc/client/mapvoting.qc b/qcsrc/client/mapvoting.qc index ddd20c7cf..dbedd013a 100644 --- a/qcsrc/client/mapvoting.qc +++ b/qcsrc/client/mapvoting.qc @@ -23,7 +23,7 @@ float mv_mouse_selection; float mv_selection_keyboard; float gametypevote; -string mapvote_choosenmap; +string mapvote_chosenmap; vector gtv_text_size; vector gtv_text_size_small; @@ -320,10 +320,10 @@ void MapVote_Draw() drawstring(pos, map, '24 24 0', '1 1 1', 1, DRAWFLAG_NORMAL); pos_y += 26; - if(gametypevote && mapvote_choosenmap != "" ) + if( mapvote_chosenmap != "" ) { - pos_x = center - stringwidth(mapvote_choosenmap, false, hud_fontsize); - drawstring(pos, mapvote_choosenmap, hud_fontsize*2, '1 1 1', 1, DRAWFLAG_NORMAL); + pos_x = center - stringwidth(mapvote_chosenmap, false, hud_fontsize*1.5/2); + drawstring(pos, mapvote_chosenmap, hud_fontsize*1.5, '1 1 1', 1, DRAWFLAG_NORMAL); pos_y += hud_fontsize_y*2; } @@ -532,12 +532,16 @@ void MapVote_Init() gametypevote = ReadByte(); float mv_real_num_maps = mv_num_maps - mv_abstain; + + if ( gametypevote ) + { + mapvote_chosenmap = strzone(ReadString()); + if ( gametypevote == 2 ) + gametypevote = 0; + } if(gametypevote) { - // read map name in case we have nextmap set - mapvote_choosenmap = strzone(ReadString()); - gtv_text_size = hud_fontsize*1.4; gtv_text_size_small = hud_fontsize*1.1; diff --git a/qcsrc/server/mapvoting.qc b/qcsrc/server/mapvoting.qc index c5e32c4d8..3e1a86620 100644 --- a/qcsrc/server/mapvoting.qc +++ b/qcsrc/server/mapvoting.qc @@ -256,10 +256,20 @@ float MapVote_SendEntity(entity to, float sf) WriteByte(MSG_ENTITY, mapvote_detail); WriteCoord(MSG_ENTITY, mapvote_timeout); - WriteByte(MSG_ENTITY, gametypevote); - - if(gametypevote) + if ( gametypevote ) + { + // gametype vote + WriteByte(MSG_ENTITY, 1); WriteString(MSG_ENTITY, autocvar_nextmap); + } + else if ( autocvar_sv_vote_gametype ) + { + // map vote but gametype has been chosen via voting screen + WriteByte(MSG_ENTITY, 2); + WriteString(MSG_ENTITY, MapInfo_Type_ToText(MapInfo_CurrentGametype())); + } + else + WriteByte(MSG_ENTITY, 0); // map vote MapVote_WriteMask(); -- 2.39.2