]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/mapvoting.qc
Remove _all indirection
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / mapvoting.qc
index 3223bf120aa7cc012f9143e21bc671f12ee9031b..89f540778e97f21d32dbaa8d8eb09a43fab05a1a 100644 (file)
@@ -1,7 +1,7 @@
 #include "mapvoting.qh"
 
-#include "hud/all.qh"
-#include "scoreboard.qh"
+#include "hud/_mod.qh"
+#include "hud/panel/scoreboard.qh"
 
 #include <common/mapinfo.qh>
 
@@ -88,10 +88,10 @@ void GameTypeVote_DrawGameTypeItem(vector pos, float maxh, float tsize, string g
        // Bounding box details
        float rect_margin = hud_fontsize.y / 2;
 
-       pos.x += rect_margin + autocvar_scoreboard_border_thickness;
-       pos.y += rect_margin + autocvar_scoreboard_border_thickness;
-       maxh -= 2 * (rect_margin + autocvar_scoreboard_border_thickness);
-       tsize -= 2 * (rect_margin + autocvar_scoreboard_border_thickness);
+       pos.x += rect_margin + autocvar_hud_panel_mapvote_highlight_border;
+       pos.y += rect_margin + autocvar_hud_panel_mapvote_highlight_border;
+       maxh -= 2 * (rect_margin + autocvar_hud_panel_mapvote_highlight_border);
+       tsize -= 2 * (rect_margin + autocvar_hud_panel_mapvote_highlight_border);
 
        vector rect_pos = pos - '0.5 0.5 0' * rect_margin;
        vector rect_size = '1 1 0';
@@ -109,7 +109,7 @@ void GameTypeVote_DrawGameTypeItem(vector pos, float maxh, float tsize, string g
        if(id == mv_ownvote)
        {
                drawfill(rect_pos, rect_size, rgb, 0.1*alpha, DRAWFLAG_NORMAL);
-               drawborderlines(autocvar_scoreboard_border_thickness, rect_pos, rect_size, rgb, alpha, DRAWFLAG_NORMAL);
+               drawborderlines(autocvar_hud_panel_mapvote_highlight_border, rect_pos, rect_size, rgb, alpha, DRAWFLAG_NORMAL);
        }
 
        vector offset = pos;
@@ -134,7 +134,7 @@ void GameTypeVote_DrawGameTypeItem(vector pos, float maxh, float tsize, string g
 
        string thelabel = mv_desc[id], ts;
        entity last = title;
-       entity next = world;
+       entity next = NULL;
        float nlines = 0;
        if( thelabel != "")
        {
@@ -177,11 +177,11 @@ void GameTypeVote_DrawGameTypeItem(vector pos, float maxh, float tsize, string g
                drawstring(last.origin+offset, last.message, gtv_text_size_small, '1 1 1', alpha, DRAWFLAG_NORMAL);
                next = last;
                last = last.chain;
-               remove(next);
+               delete(next);
        }
 
        // Cleanup
-       remove(title);
+       delete(title);
 }
 
 void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, string pic, float _count, int id)
@@ -193,10 +193,10 @@ void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, strin
 
        float rect_margin = hud_fontsize.y / 2;
 
-       pos.x += rect_margin + autocvar_scoreboard_border_thickness;
-       pos.y += rect_margin + autocvar_scoreboard_border_thickness;
-       isize -= 2 * (rect_margin + autocvar_scoreboard_border_thickness);
-       tsize -= 2 * (rect_margin + autocvar_scoreboard_border_thickness);
+       pos.x += rect_margin + autocvar_hud_panel_mapvote_highlight_border;
+       pos.y += rect_margin + autocvar_hud_panel_mapvote_highlight_border;
+       isize -= 2 * (rect_margin + autocvar_hud_panel_mapvote_highlight_border);
+       tsize -= 2 * (rect_margin + autocvar_hud_panel_mapvote_highlight_border);
 
        vector rect_pos = pos - '0.5 0.5 0' * rect_margin;
        vector rect_size = '1 1 0';
@@ -240,7 +240,7 @@ void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, strin
        if(id == mv_ownvote)
        {
                drawfill(rect_pos, rect_size, rgb, 0.1*theAlpha, DRAWFLAG_NORMAL);
-               drawborderlines(autocvar_scoreboard_border_thickness, rect_pos, rect_size, rgb, theAlpha, DRAWFLAG_NORMAL);
+               drawborderlines(autocvar_hud_panel_mapvote_highlight_border, rect_pos, rect_size, rgb, theAlpha, DRAWFLAG_NORMAL);
        }
 
        drawstring(text_pos, label, hud_fontsize, rgb, theAlpha, DRAWFLAG_NORMAL);
@@ -341,7 +341,6 @@ void MapVote_Draw()
                if ( mpos.x != mv_mousepos.x || mpos.y != mv_mousepos.y )
                        mv_selection_keyboard = 0;
                mv_mousepos = mpos;
-
        }
 
        center = (vid_conwidth - 1)/2;
@@ -360,6 +359,7 @@ void MapVote_Draw()
        pos.y = ymin;
        pos.z = 0;
 
+       HUD_Scale_Disable();
        draw_beginBoldFont();
 
        map = ((gametypevote) ? _("Decide the gametype") : _("Vote for a map"));
@@ -373,10 +373,8 @@ void MapVote_Draw()
                pos.x = center - stringwidth(mapvote_chosenmap, false, hud_fontsize * 1.5) * 0.5;
                drawstring(pos, mapvote_chosenmap, hud_fontsize * 1.5, '1 1 1', 1, DRAWFLAG_NORMAL);
                pos.y += hud_fontsize.y * 1.5;
-               pos.y += hud_fontsize.y * 0.5;
        }
-       else
-               pos.y += hud_fontsize.y * 0.5;
+       pos.y += hud_fontsize.y * 0.5;
 
        draw_endBoldFont();
 
@@ -629,7 +627,7 @@ void GameTypeVote_ReadOption(int i)
        }
        else
        {
-               int type = MapInfo_Type_FromString(gt);
+               Gametype type = MapInfo_Type_FromString(gt);
                mv_pk3[i] = strzone(MapInfo_Type_ToText(type));
                mv_desc[i] = MapInfo_Type_Description(type);
        }
@@ -680,8 +678,8 @@ void MapVote_Init()
        for(i = 0; i < mv_num_maps; ++i )
                mv_flags_start[i] = mv_flags[i];
 
-       // Assume mv_pk3list is world, there should only be 1 mapvote per round
-       mv_pk3list = world; // I'm still paranoid!
+       // Assume mv_pk3list is NULL, there should only be 1 mapvote per round
+       mv_pk3list = NULL; // I'm still paranoid!
 
        for(i = 0; i < mv_num_maps; ++i)
        {