From ba8ede081486f24d3284b73dbd17e7d7e5f7e91e Mon Sep 17 00:00:00 2001 From: Severin Meyer Date: Fri, 12 Sep 2014 16:15:24 +0200 Subject: [PATCH] Make the main text color editable in menu skins --- qcsrc/menu/item/label.c | 2 +- qcsrc/menu/skin-customizables.inc | 3 ++- qcsrc/menu/xonotic/demolist.c | 2 +- qcsrc/menu/xonotic/gametypelist.c | 4 ++-- qcsrc/menu/xonotic/languagelist.c | 4 ++-- qcsrc/menu/xonotic/playerlist.c | 2 +- qcsrc/menu/xonotic/playermodel.c | 4 ++-- qcsrc/menu/xonotic/weaponslist.c | 2 +- 8 files changed, 12 insertions(+), 11 deletions(-) diff --git a/qcsrc/menu/item/label.c b/qcsrc/menu/item/label.c index 8406af01f..0f6f96647 100644 --- a/qcsrc/menu/item/label.c +++ b/qcsrc/menu/item/label.c @@ -20,7 +20,7 @@ CLASS(Label) EXTENDS(Item) ATTRIB(Label, realFontSize, vector, '0 0 0') ATTRIB(Label, realOrigin, vector, '0 0 0') ATTRIB(Label, alpha, float, 0.7) - ATTRIB(Label, colorL, vector, '1 1 1') + ATTRIB(Label, colorL, vector, SKINCOLOR_TEXT) ATTRIB(Label, disabled, float, 0) ATTRIB(Label, disabledAlpha, float, 0.3) ATTRIB(Label, textEntity, entity, NULL) diff --git a/qcsrc/menu/skin-customizables.inc b/qcsrc/menu/skin-customizables.inc index 1b8f3e38b..a8846197b 100644 --- a/qcsrc/menu/skin-customizables.inc +++ b/qcsrc/menu/skin-customizables.inc @@ -98,7 +98,8 @@ SKINBEGIN SKINFLOAT(ALPHA_DISABLED, 0.2); SKINFLOAT(ALPHA_BEHIND, 0.5); SKINFLOAT(ALPHA_TEXT, 0.7); - + SKINVECTOR(COLOR_TEXT, '1 1 1'); + // item: button SKINSTRING(GFX_BUTTON, "button"); SKINSTRING(GFX_BUTTON_GRAY, "buttongray"); diff --git a/qcsrc/menu/xonotic/demolist.c b/qcsrc/menu/xonotic/demolist.c index ee8cf6a4f..cf0e987c0 100644 --- a/qcsrc/menu/xonotic/demolist.c +++ b/qcsrc/menu/xonotic/demolist.c @@ -104,7 +104,7 @@ void XonoticDemoList_drawListBoxItem(entity me, float i, vector absSize, float i s = me.demoName(me,i); s = draw_TextShortenToWidth(s, me.columnNameSize, 0, me.realFontSize); - draw_Text(me.realUpperMargin * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, '1 1 1', SKINALPHA_TEXT, 0); + draw_Text(me.realUpperMargin * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, SKINCOLOR_TEXT, SKINALPHA_TEXT, 0); } void XonoticDemoList_showNotify(entity me) diff --git a/qcsrc/menu/xonotic/gametypelist.c b/qcsrc/menu/xonotic/gametypelist.c index 56c25314d..02f17dddb 100644 --- a/qcsrc/menu/xonotic/gametypelist.c +++ b/qcsrc/menu/xonotic/gametypelist.c @@ -83,9 +83,9 @@ void XonoticGametypeList_drawListBoxItem(entity me, float i, vector absSize, flo draw_Picture(me.columnIconOrigin * eX, GameType_GetIcon(i), me.columnIconSize * eX + eY, '1 1 1', SKINALPHA_LISTBOX_SELECTED); s = GameType_GetName(i); - draw_Text(me.realUpperMargin1 * eY + (me.columnNameOrigin + 0.5 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, '1 1 1', SKINALPHA_TEXT, 0); + draw_Text(me.realUpperMargin1 * eY + (me.columnNameOrigin + 0.5 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, SKINCOLOR_TEXT, SKINALPHA_TEXT, 0); //s = GameType_GetTeams(i); - //draw_Text(me.realUpperMargin1 * eY + (me.columnNameOrigin + 1.00 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, '1 1 1', SKINALPHA_TEXT, 0); + //draw_Text(me.realUpperMargin1 * eY + (me.columnNameOrigin + 1.00 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, SKINCOLOR_TEXT, SKINALPHA_TEXT, 0); } void XonoticGametypeList_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { diff --git a/qcsrc/menu/xonotic/languagelist.c b/qcsrc/menu/xonotic/languagelist.c index b91610a30..56d074115 100644 --- a/qcsrc/menu/xonotic/languagelist.c +++ b/qcsrc/menu/xonotic/languagelist.c @@ -65,13 +65,13 @@ void XonoticLanguageList_drawListBoxItem(entity me, float i, vector absSize, flo s = me.languageParameter(me, i, LANGPARM_NAME_LOCALIZED); s = draw_TextShortenToWidth(s, me.columnNameSize, 0, me.realFontSize); - draw_Text(me.realUpperMargin * eY + me.columnNameOrigin * eX, s, me.realFontSize, '1 1 1', SKINALPHA_TEXT, 0); + draw_Text(me.realUpperMargin * eY + me.columnNameOrigin * eX, s, me.realFontSize, SKINCOLOR_TEXT, SKINALPHA_TEXT, 0); p = me.languageParameter(me, i, LANGPARM_PERCENTAGE); if(p != "") { p = draw_TextShortenToWidth(p, me.columnPercentageSize, 0, me.realFontSize); - draw_Text(me.realUpperMargin * eY + (me.columnPercentageOrigin + (me.columnPercentageSize - draw_TextWidth(p, 0, me.realFontSize))) * eX, p, me.realFontSize, '1 1 1', SKINALPHA_TEXT, 0); + draw_Text(me.realUpperMargin * eY + (me.columnPercentageOrigin + (me.columnPercentageSize - draw_TextWidth(p, 0, me.realFontSize))) * eX, p, me.realFontSize, SKINCOLOR_TEXT, SKINALPHA_TEXT, 0); } } diff --git a/qcsrc/menu/xonotic/playerlist.c b/qcsrc/menu/xonotic/playerlist.c index a0f64ca39..315a68caa 100644 --- a/qcsrc/menu/xonotic/playerlist.c +++ b/qcsrc/menu/xonotic/playerlist.c @@ -108,7 +108,7 @@ void XonoticPlayerList_drawListBoxItem(entity me, float i, vector absSize, float else if(t == 4) rgb = colormapPaletteColor(9, 0); else - rgb = '1 1 1'; + rgb = SKINCOLOR_TEXT; s = me.getPlayerList(me, i, PLAYERPARM_NAME); score = me.getPlayerList(me, i, PLAYERPARM_SCORE); diff --git a/qcsrc/menu/xonotic/playermodel.c b/qcsrc/menu/xonotic/playermodel.c index f37aaeb07..e4195617f 100644 --- a/qcsrc/menu/xonotic/playermodel.c +++ b/qcsrc/menu/xonotic/playermodel.c @@ -174,7 +174,7 @@ void XonoticPlayerModelSelector_draw(entity me) if (me.numModels <= 0) { - draw_CenterText('0.5 0.5 0', _(""), me.realFontSize, '1 1 1', 0.6, FALSE); + draw_CenterText('0.5 0.5 0', _(""), me.realFontSize, SKINCOLOR_TEXT, 0.6, FALSE); return; } @@ -190,7 +190,7 @@ void XonoticPlayerModelSelector_draw(entity me) o = '0.5 1 0' - eY * me.realFontSize_y * ((n = tokenizebyseparator(me.currentModelDescription, "\n")) + 0.5); for(i = 0; i < n; ++i) { - draw_CenterText(o, argv(i), me.realFontSize, '1 1 1', 1, FALSE); + draw_CenterText(o, argv(i), me.realFontSize, SKINCOLOR_TEXT, 1, FALSE); o += eY * me.realFontSize_y; } } diff --git a/qcsrc/menu/xonotic/weaponslist.c b/qcsrc/menu/xonotic/weaponslist.c index ad4071060..b6c536a90 100644 --- a/qcsrc/menu/xonotic/weaponslist.c +++ b/qcsrc/menu/xonotic/weaponslist.c @@ -100,7 +100,7 @@ void XonoticWeaponsList_drawListBoxItem(entity me, float i, vector absSize, floa string msg = e.message; if(e.spawnflags & WEP_FLAG_MUTATORBLOCKED) msg = sprintf(_("%s (mutator weapon)"), msg); - draw_Text(me.realUpperMargin * eY, msg, me.realFontSize, '1 1 1', SKINALPHA_TEXT, 0); + draw_Text(me.realUpperMargin * eY, msg, me.realFontSize, SKINCOLOR_TEXT, SKINALPHA_TEXT, 0); } float XonoticWeaponsList_keyDown(entity me, float scan, float ascii, float shift) -- 2.39.2