From: Mircea Kitsune Date: Mon, 30 Dec 2019 20:26:47 +0000 (+0200) Subject: Draw the gametype icon on campaign entries X-Git-Tag: xonotic-v0.8.5~1105^2~51^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=dd448c8e197e0baef7a9f6bc3864fb4d66294837;p=xonotic%2Fxonotic-data.pk3dir.git Draw the gametype icon on campaign entries --- diff --git a/qcsrc/menu/xonotic/campaign.qc b/qcsrc/menu/xonotic/campaign.qc index a3ad36355..0f64aefdb 100644 --- a/qcsrc/menu/xonotic/campaign.qc +++ b/qcsrc/menu/xonotic/campaign.qc @@ -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) diff --git a/qcsrc/menu/xonotic/campaign.qh b/qcsrc/menu/xonotic/campaign.qh index 298e27587..d6c674e8d 100644 --- a/qcsrc/menu/xonotic/campaign.qh +++ b/qcsrc/menu/xonotic/campaign.qh @@ -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);