]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't draw map previews if the images are missing. Later to be replaced with a "previ...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 25 Nov 2011 12:23:07 +0000 (14:23 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 25 Nov 2011 12:23:07 +0000 (14:23 +0200)
qcsrc/client/mapvoting.qc
qcsrc/menu/xonotic/campaign.c
qcsrc/menu/xonotic/dialog_multiplayer_create_mapinfo.c
qcsrc/menu/xonotic/maplist.c

index 201d1a96962439f63e49e2e323717a65a0b655b0..5492d51940575232f481e59cdc6b9adbdbdf9331 100644 (file)
@@ -88,7 +88,8 @@ void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, strin
        }
        else
        {
-               drawpic(pos, pic, img_size, '1 1 1', alpha, DRAWFLAG_NORMAL);
+               if(fexists(strcat(pic, ".jpg")) || fexists(strcat(pic, ".png")) || fexists(strcat(pic, ".tga")))
+                       drawpic(pos, pic, img_size, '1 1 1', alpha, DRAWFLAG_NORMAL);
        }
 
        if(id == mv_ownvote)
index 04f7a083c2d32a035ac9bb5d15e6c2e1c127b72e..9737014d31542e15d75607fd2d5bd2ea12b02285 100644 (file)
@@ -275,7 +275,8 @@ void XonoticCampaignList_drawListBoxItem(entity me, float i, vector absSize, flo
                draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
 
        s = ftos(p);
-       draw_Picture(me.columnPreviewOrigin * eX, strcat("/maps/", campaign_mapname[i]), me.columnPreviewSize * eX + eY, '1 1 1', theAlpha);
+       if(fexists(strcat("maps/", campaign_mapname[i], ".jpg")) || fexists(strcat("maps/", campaign_mapname[i], ".png")) || fexists(strcat("maps/", campaign_mapname[i], ".tga")))
+               draw_Picture(me.columnPreviewOrigin * eX, strcat("/maps/", campaign_mapname[i]), me.columnPreviewSize * eX + eY, '1 1 1', theAlpha);
        if(i < me.campaignIndex)
                draw_Picture(me.checkMarkOrigin, "checkmark", me.checkMarkSize, '1 1 1', 1);
        if(i <= me.campaignIndex)
index e242b6667546e5576444ccee6fa668908693be3f..732b4468b02af75039c4109a289a3d1304b5209f 100644 (file)
@@ -54,7 +54,8 @@ void XonoticMapInfoDialog_loadMapInfo(entity me, float i, entity mlb)
        me.authorLabel.setText(me.authorLabel, me.currentMapAuthor);
        me.descriptionLabel.setText(me.descriptionLabel, me.currentMapDescription);
        me.featuresLabel.setText(me.featuresLabel, me.currentMapFeaturesText);
-       me.previewImage.src = me.currentMapPreviewImage;
+       if(fexists(strcat("maps/", me.currentMapPreviewImage, ".jpg")) || fexists(strcat("maps/", me.currentMapPreviewImage, ".png")) || fexists(strcat("maps/", me.currentMapPreviewImage, ".tga")))
+               me.previewImage.src = me.currentMapPreviewImage;
 
        for(i = 0; i < GameType_GetCount(); ++i)
        {
index 9ce298082c2fca2f236ba1ea987ebe001005a1f4..1edb222cd987de29e801302cf89a1f4a9e8efcfb 100644 (file)
@@ -186,7 +186,8 @@ void XonoticMapList_drawListBoxItem(entity me, float i, vector absSize, float is
                draw_Fill('0 0 0', '1 1 0', SKINCOLOR_MAPLIST_INCLUDEDBG, SKINALPHA_MAPLIST_INCLUDEDBG);
 
        s = ftos(p);
-       draw_Picture(me.columnPreviewOrigin * eX, strcat("/maps/", MapInfo_Map_bspname), me.columnPreviewSize * eX + eY, '1 1 1', theAlpha);
+       if(fexists(strcat("maps/", MapInfo_Map_bspname, ".jpg")) || fexists(strcat("maps/", MapInfo_Map_bspname, ".png")) || fexists(strcat("maps/", MapInfo_Map_bspname, ".tga")))
+               draw_Picture(me.columnPreviewOrigin * eX, strcat("/maps/", MapInfo_Map_bspname), me.columnPreviewSize * eX + eY, '1 1 1', theAlpha);
        if(included)
                draw_Picture(me.checkMarkOrigin, "checkmark", me.checkMarkSize, '1 1 1', 1);
        s = draw_TextShortenToWidth(MapInfo_Map_titlestring, me.columnNameSize, 0, me.realFontSize);