]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Code a missing preview image for menu skins too, so that the set is completed
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 25 Nov 2011 17:34:10 +0000 (19:34 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 25 Nov 2011 17:34:10 +0000 (19:34 +0200)
qcsrc/menu/xonotic/skinlist.c

index bb01f974cbf1d0c6312b57cd8ec40c1f0107edca..5fcd354355ae4062a78c03e932711aed3fd06ac9 100644 (file)
@@ -104,7 +104,10 @@ void XonoticSkinList_getSkins(entity me)
                bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_NAME, substring(s, 9, strlen(s) - 24)); // the * part
                bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_TITLE, _("<TITLE>"));
                bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_AUTHOR, _("<AUTHOR>"));
-               bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_PREVIEW, strcat("/gfx/menu/", substring(s, 9, strlen(s) - 24), "/skinpreview"));
+               if(draw_PreloadPicture(strcat("/gfx/menu/", substring(s, 9, strlen(s) - 24), "/skinpreview")) == "")
+                       bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_PREVIEW, "nopreview_skin");
+               else
+                       bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_PREVIEW, strcat("/gfx/menu/", substring(s, 9, strlen(s) - 24), "/skinpreview"));
                fh = fopen(language_filename(s), FILE_READ);
                if(fh < 0)
                {