]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/mapvoting.qc
Implement a new design for the Arc secondary: electric orbs that can bounce (balance...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / mapvoting.qc
index c025bdd4651229ed39d182281ca9f4542b31fb59..06a33f665e4932e1361292c3e2c79003d08c0273 100644 (file)
@@ -1,12 +1,13 @@
 #include "mapvoting.qh"
 
 #include "autocvars.qh"
-#include "miscfunctions.qh"
-#include "defs.qh"
+#include <client/draw.qh>
+#include "main.qh"
 #include "hud/_mod.qh"
 #include "hud/panel/scoreboard.qh"
 
 #include <common/mapinfo.qh>
+#include <common/util.qh>
 
 // MapVote (#21)
 
@@ -48,6 +49,19 @@ const int NUM_SSDIRS = 4;
 string ssdirs[NUM_SSDIRS];
 int n_ssdirs;
 
+bool PreviewExists(string name)
+{
+       if(autocvar_cl_readpicture_force)
+               return false;
+
+       if (fexists(strcat(name, ".tga"))) return true;
+       if (fexists(strcat(name, ".png"))) return true;
+       if (fexists(strcat(name, ".jpg"))) return true;
+       if (fexists(strcat(name, ".pcx"))) return true;
+
+       return false;
+}
+
 string MapVote_FormatMapItem(int id, string map, float _count, float maxwidth, vector fontsize)
 {
        TC(int, id);
@@ -636,7 +650,7 @@ void GameTypeVote_ReadOption(int i)
        }
        else
        {
-               Gametype type = MapInfo_Type_FromString(gt);
+               Gametype type = MapInfo_Type_FromString(gt, false);
                mv_pk3[i] = strzone(MapInfo_Type_ToText(type));
                mv_desc[i] = MapInfo_Type_Description(type);
        }