]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add new changes by Melanosuchus
authorMario <zacjardine@y7mail.com>
Tue, 4 Nov 2014 06:14:24 +0000 (17:14 +1100)
committerMario <zacjardine@y7mail.com>
Tue, 4 Nov 2014 06:14:24 +0000 (17:14 +1100)
qcsrc/client/mapvoting.qc
qcsrc/server/mapvoting.qc

index ddd20c7cf06da738c4e7d6c292f15e31fd3b55d0..dbedd013ad68390b91b9513bc2e75456212d06ee 100644 (file)
@@ -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;
                
index c5e32c4d8fdcd76fea7e13b42f39f145e678f1fa..3e1a86620314020cfe4ac7e6c8a61fd58480e377 100644 (file)
@@ -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();