X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fmapvoting.qc;h=5be42cda965546119a7f2ef45425de9889cca315;hb=126111bb9ef1d8979a6b76bcf464f6e19ea1168d;hp=d0bab24b56d2d1918da0a132275efdd143e348bf;hpb=546842f7e5a63b11a9b862dbf1709318bb97689b;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/mapvoting.qc b/qcsrc/client/mapvoting.qc index d0bab24b5..5be42cda9 100644 --- a/qcsrc/client/mapvoting.qc +++ b/qcsrc/client/mapvoting.qc @@ -1,13 +1,18 @@ #include "mapvoting.qh" -#include "autocvars.qh" -#include "miscfunctions.qh" -#include "defs.qh" -#include "hud/_mod.qh" -#include "hud/panel/scoreboard.qh" - +#include +#include +#include #include +#include + +// MapVote (#21) +void MapVote_Draw_Export(int fh) +{ + // allow saving cvars that aesthetically change the panel into hud skin files + HUD_Write_Cvar("hud_panel_mapvote_highlight_border"); +} int mv_num_maps; @@ -41,6 +46,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); @@ -629,7 +647,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); }