]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Draw the gametype icon on campaign entries 748/head
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 30 Dec 2019 20:26:47 +0000 (22:26 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 30 Dec 2019 20:34:16 +0000 (22:34 +0200)
qcsrc/menu/xonotic/campaign.qc
qcsrc/menu/xonotic/campaign.qh

index a3ad36355d9cece13deb37c750054cfe8794d0d2..0f64aefdbc1a207248f7d1b29e206610b8d7c18e 100644 (file)
@@ -183,6 +183,9 @@ void XonoticCampaignList_resizeNotify(entity me, vector relOrigin, vector relSiz
 
        me.checkMarkOrigin = eY + eX * (me.columnCheckMarkOrigin + me.columnCheckMarkSize) - me.checkMarkSize;
 
+       me.typeIconOrigin = vec3(me.columnPreviewSize - me.checkMarkSize.x, me.checkMarkOrigin.y, 0);
+       me.typeIconSize = me.checkMarkSize;
+
        rewrapCampaign(me.columnNameSize, me.rowsPerItem - 3, me.emptyLineHeight, me.realFontSize);
 }
 void XonoticCampaignList_doubleClickListBoxItem(entity me, float i, vector where)
@@ -226,6 +229,10 @@ void XonoticCampaignList_drawListBoxItem(entity me, int i, vector absSize, bool
        else
                draw_Picture(me.columnPreviewOrigin * eX, strcat("/maps/", campaign_mapname[i]), me.columnPreviewSize * eX + eY, '1 1 1', theAlpha);
 
+       s = strcat("/gfx/menu/", cvar_string("menu_skin"), "/gametype_", campaign_gametype[i]);
+       if(i <= me.campaignIndex && draw_PictureSize(s) != '0 0 0')
+               draw_Picture(me.typeIconOrigin, s, me.typeIconSize, '1 1 1', 1);
+
        if(i < me.campaignIndex)
                draw_Picture(me.checkMarkOrigin, "checkmark", me.checkMarkSize, '1 1 1', 1);
        if(i <= me.campaignIndex)
index 298e27587466697572311d048684b11a2dc21db9..d6c674e8d6343ef21cf9722ebecd0cab9e1d2290 100644 (file)
@@ -23,6 +23,8 @@ CLASS(XonoticCampaignList, XonoticListBox)
        ATTRIB(XonoticCampaignList, columnCheckMarkSize, float, 0);
        ATTRIB(XonoticCampaignList, checkMarkOrigin, vector, '0 0 0');
        ATTRIB(XonoticCampaignList, checkMarkSize, vector, '0 0 0');
+       ATTRIB(XonoticCampaignList, typeIconOrigin, vector, '0 0 0');
+       ATTRIB(XonoticCampaignList, typeIconSize, vector, '0 0 0');
        ATTRIB(XonoticCampaignList, realUpperMargin1, float, 0);
        ATTRIB(XonoticCampaignList, realUpperMargin2, float, 0);