X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fskinlist.c;h=fdb07870a411f12b8b068eaf1601437d966ba7ab;hb=4aa545c4f63e4d388349eea4c2e2b453d22f29c9;hp=a4f733cf581b8bcd2e6df6b23b4b698a9c501665;hpb=60a4aa95129e30c512d4f36e249d451865aa1503;p=xonotic%2Fxonotic-data.pk3dir.git
diff --git a/qcsrc/menu/xonotic/skinlist.c b/qcsrc/menu/xonotic/skinlist.c
index a4f733cf5..fdb07870a 100644
--- a/qcsrc/menu/xonotic/skinlist.c
+++ b/qcsrc/menu/xonotic/skinlist.c
@@ -104,8 +104,11 @@ 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, _("
"));
bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_AUTHOR, _(""));
- bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_PREVIEW, strcat("/gfx/menu/", substring(s, 9, strlen(s) - 24), "/skinpreview"));
- fh = fopen(language_file(s), FILE_READ);
+ if(draw_PictureSize(strcat("/gfx/menu/", substring(s, 9, strlen(s) - 24), "/skinpreview")) == '0 0 0')
+ bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_PREVIEW, "nopreview_menuskin");
+ 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)
{
print("Warning: can't open skinvalues.txt file\n");
@@ -172,7 +175,7 @@ void XonoticSkinList_drawListBoxItem(entity me, float i, vector absSize, float i
void XonoticSkinList_setSkin(entity me)
{
me.saveCvars(me);
- localcmd("\nmenu_restart\ntogglemenu\ndefer 0.1 \"menu_cmd skinselect\"\n");
+ localcmd("\nmenu_restart\nmenu_cmd skinselect\n");
}
void SetSkin_Click(entity btn, entity me)