From: Mario Date: Tue, 4 Nov 2014 06:14:24 +0000 (+1100) Subject: Add new changes by Melanosuchus X-Git-Tag: xonotic-v0.8.0~168^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b4c19832b9175becaa6652b7b5a9a26edbc99568;p=xonotic%2Fxonotic-data.pk3dir.git Add new changes by Melanosuchus --- 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();