minimapname = strzone(minimapname);\r
\r
WarpZone_Init();\r
+\r
+ draw_currentSkin = strzone(strcat("gfx/menu/", cvar_string("menu_skin")));\r
}\r
\r
// CSQC_Shutdown : Called every time the CSQC code is shutdown (changing maps, quitting, etc)\r
img_size -= (sbar_border_thickness * 2) * '1 1 0';\r
if(pic == "")\r
{\r
- drawfill(pos, img_size, '.5 .5 .5', .7, DRAWFLAG_NORMAL);\r
+ if(precache_pic(pic) == "")\r
+ drawpic(pos, draw_UseSkinFor("nopreview_player"), img_size, '1 1 1', 0.7, DRAWFLAG_NORMAL);\r
+ else\r
+ drawpic(pos, pic, img_size, '1 1 1', 0.7, DRAWFLAG_NORMAL);\r
}\r
else\r
{\r
#endif\r
#endif\r
\r
+#ifndef SVQC\r
+string draw_UseSkinFor(string pic)\r
+{\r
+ if(substring(pic, 0, 1) == "/")\r
+ return substring(pic, 1, strlen(pic)-1);\r
+ else\r
+ return strcat(draw_currentSkin, "/", pic);\r
+}\r
+#endif\r
+\r
string unescape(string in)\r
{\r
local float i, len;\r
#endif\r
void wordwrap_cb(string s, float l, void(string) callback)\r
\r
+#ifndef SVQC\r
+string draw_currentSkin;\r
+string draw_UseSkinFor(string pic);\r
+#endif\r
+\r
float GameCommand_Generic(string cmd);\r
// returns TRUE if handled, FALSE otherwise\r
// uses tokenize on its argument!\r
vector draw_mousepointer_offset;\r
vector draw_mousepointer_size;\r
\r
-string draw_UseSkinFor(string pic)\r
-{\r
- if(substring(pic, 0, 1) == "/")\r
- return substring(pic, 1, strlen(pic)-1);\r
- else\r
- return strcat(draw_currentSkin, "/", pic);\r
-}\r
-\r
void draw_setMousePointer(string pic, vector theSize, vector theOffset)\r
{\r
draw_mousepointer = strzone(draw_UseSkinFor(pic));\r
return v;\r
}\r
\r
-void draw_PreloadPicture(string pic)\r
+string draw_PreloadPicture(string pic)\r
{\r
pic = draw_UseSkinFor(pic);\r
- precache_pic(pic);\r
+ return precache_pic(pic);\r
}\r
\r
void draw_Picture(vector theOrigin, string pic, vector theSize, vector theColor, float theAlpha)\r
void draw_setMousePointer(string pic, vector theSize, vector theOffset);\r
void draw_drawMousePointer(vector where);\r
\r
-void draw_PreloadPicture(string pic);\r
+string draw_PreloadPicture(string pic);\r
void draw_ButtonPicture(vector theOrigin, string pic, vector theSize, vector theColor, float theAlpha);\r
void draw_VertButtonPicture(vector theOrigin, string pic, vector theSize, vector theColor, float theAlpha);\r
void draw_BorderPicture(vector theOrigin, string pic, vector theSize, vector theColor, float theAlpha, vector theBorderSize);\r
\r
float draw_NeedResizeNotify;\r
\r
-string draw_currentSkin;\r
-\r
float draw_TextWidth_WithColors(string s, vector size);\r
float draw_TextWidth_WithoutColors(string s, vector size);\r
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);\r
\r
s = ftos(p);\r
- if(i <= me.campaignIndex)\r
- draw_Picture(me.columnPreviewOrigin * eX, strcat("/maps/", campaign_mapname[i]), me.columnPreviewSize * eX + eY, '1 1 1', theAlpha);\r
- else\r
+ if(i > me.campaignIndex)\r
draw_Picture(me.columnPreviewOrigin * eX, "/gfx/campaign_hidden", me.columnPreviewSize * eX + eY, '1 1 1', theAlpha);\r
+ else if(draw_PreloadPicture(strcat("/maps/", campaign_mapname[i])) == "")\r
+ draw_Picture(me.columnPreviewOrigin * eX, "nopreview_map", me.columnPreviewSize * eX + eY, '1 1 1', theAlpha);\r
+ else\r
+ draw_Picture(me.columnPreviewOrigin * eX, strcat("/maps/", campaign_mapname[i]), me.columnPreviewSize * eX + eY, '1 1 1', theAlpha);\r
+\r
if(i < me.campaignIndex)\r
draw_Picture(me.checkMarkOrigin, "checkmark", me.checkMarkSize, '1 1 1', 1);\r
if(i <= me.campaignIndex)\r
me.authorLabel.setText(me.authorLabel, me.currentMapAuthor);\r
me.descriptionLabel.setText(me.descriptionLabel, me.currentMapDescription);\r
me.featuresLabel.setText(me.featuresLabel, me.currentMapFeaturesText);\r
- me.previewImage.src = me.currentMapPreviewImage;\r
+ if(draw_PreloadPicture(me.currentMapPreviewImage) == "")\r
+ me.previewImage.src = "nopreview_map";\r
+ else\r
+ me.previewImage.src = me.currentMapPreviewImage;\r
\r
me.typeDeathmatchLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH);\r
me.typeTDMLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_TEAM_DEATHMATCH);\r
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_MAPLIST_INCLUDEDBG, SKINALPHA_MAPLIST_INCLUDEDBG);\r
\r
s = ftos(p);\r
- draw_Picture(me.columnPreviewOrigin * eX, strcat("/maps/", MapInfo_Map_bspname), me.columnPreviewSize * eX + eY, '1 1 1', theAlpha);\r
+ if(draw_PreloadPicture(strcat("/maps/", MapInfo_Map_bspname)) == "")\r
+ draw_Picture(me.columnPreviewOrigin * eX, "nopreview_map", me.columnPreviewSize * eX + eY, '1 1 1', theAlpha);\r
+ else\r
+ draw_Picture(me.columnPreviewOrigin * eX, strcat("/maps/", MapInfo_Map_bspname), me.columnPreviewSize * eX + eY, '1 1 1', theAlpha);\r
+\r
if(included)\r
draw_Picture(me.checkMarkOrigin, "checkmark", me.checkMarkSize, '1 1 1', 1);\r
s = draw_TextShortenToWidth(strcat(MapInfo_Map_bspname, ": ", MapInfo_Map_title), me.columnNameSize, 0, me.realFontSize);\r
float i, n;\r
vector o;\r
\r
- me.src = me.currentModelName;\r
+ if(draw_PreloadPicture(me.currentModelName) == "")\r
+ me.src = "nopreview_player";\r
+ else\r
+ me.src = me.currentModelName;\r
drawImage(me);\r
me.src = string_null;\r
\r