From: terencehill Date: Fri, 27 Jan 2012 18:53:03 +0000 (+0100) Subject: Custom colors for the Clear button X-Git-Tag: xonotic-v0.7.0~55^2~13^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d66f380dbf82446731651878daae59c644dac3d8;p=xonotic%2Fxonotic-data.pk3dir.git Custom colors for the Clear button --- diff --git a/gfx/menu/luminos/skinvalues.txt b/gfx/menu/luminos/skinvalues.txt index de95791772..e79dba0e09 100755 --- a/gfx/menu/luminos/skinvalues.txt +++ b/gfx/menu/luminos/skinvalues.txt @@ -188,7 +188,13 @@ COLOR_DIALOG_HUDCONFIRM '1 0 0' COLOR_INPUTBOX_N '1 1 1' COLOR_INPUTBOX_F '1 1 1' MARGIN_INPUTBOX_CHARS 1 + +// item: clear button +// uses "clearbutton" images OFFSET_CLEARBUTTON -0.3 +COLOR_CLEARBUTTON_N '1 1 1' +COLOR_CLEARBUTTON_C '1 1 1' +COLOR_CLEARBUTTON_F '1 1 1' // item: key grabber COLOR_KEYGRABBER_TITLES '1 1 1' diff --git a/gfx/menu/wickedx/skinvalues.txt b/gfx/menu/wickedx/skinvalues.txt index eee5cc649e..1560512858 100755 --- a/gfx/menu/wickedx/skinvalues.txt +++ b/gfx/menu/wickedx/skinvalues.txt @@ -188,7 +188,13 @@ COLOR_DIALOG_HUDCONFIRM '1 0 0' COLOR_INPUTBOX_N '1 1 1' COLOR_INPUTBOX_F '1 1 1' MARGIN_INPUTBOX_CHARS 1 + +// item: clear button +// uses "clearbutton" images OFFSET_CLEARBUTTON -0.5 +COLOR_CLEARBUTTON_N '1 1 1' +COLOR_CLEARBUTTON_C '1 1 1' +COLOR_CLEARBUTTON_F '1 1 1' // item: key grabber COLOR_KEYGRABBER_TITLES '1 1 1' diff --git a/gfx/menu/xaw/skinvalues.txt b/gfx/menu/xaw/skinvalues.txt index c5e5120372..3bd555f031 100644 --- a/gfx/menu/xaw/skinvalues.txt +++ b/gfx/menu/xaw/skinvalues.txt @@ -128,7 +128,13 @@ HEIGHT_DIALOGBORDER 1 COLOR_INPUTBOX_N '1 1 1' COLOR_INPUTBOX_F '1 1 1' MARGIN_INPUTBOX_CHARS 1 + +// item: clear button +// uses "clearbutton" images OFFSET_CLEARBUTTON 0 +COLOR_CLEARBUTTON_N '1 1 1' +COLOR_CLEARBUTTON_C '1 1 1' +COLOR_CLEARBUTTON_F '1 1 1' // item: key grabber COLOR_KEYGRABBER_TITLES '1 1 1' diff --git a/qcsrc/menu/item/inputbox.c b/qcsrc/menu/item/inputbox.c index 83bb916dad..71f0b60bde 100644 --- a/qcsrc/menu/item/inputbox.c +++ b/qcsrc/menu/item/inputbox.c @@ -34,6 +34,9 @@ CLASS(InputBox) EXTENDS(Label) ATTRIB(InputBox, cb_width, float, 0) ATTRIB(InputBox, cb_pressed, float, 0) ATTRIB(InputBox, cb_focused, float, 0) + ATTRIB(InputBox, cb_color, vector, '1 1 1') + ATTRIB(InputBox, cb_colorF, vector, '1 1 1') + ATTRIB(InputBox, cb_colorC, vector, '1 1 1') ENDCLASS(InputBox) void InputBox_Clear_Click(entity btn, entity me); #endif @@ -368,11 +371,11 @@ void InputBox_draw(entity me) if (me.text != "") { if(me.focused && me.cb_pressed) - draw_Picture(eX * (1 + me.cb_offset - me.cb_width), strcat(me.cb_src, "_c"), eX * me.cb_width + eY, '1 1 1', 1); + draw_Picture(eX * (1 + me.cb_offset - me.cb_width), strcat(me.cb_src, "_c"), eX * me.cb_width + eY, me.cb_colorC, 1); else if(me.focused && me.cb_focused) - draw_Picture(eX * (1 + me.cb_offset - me.cb_width), strcat(me.cb_src, "_f"), eX * me.cb_width + eY, '1 1 1', 1); + draw_Picture(eX * (1 + me.cb_offset - me.cb_width), strcat(me.cb_src, "_f"), eX * me.cb_width + eY, me.cb_colorF, 1); else - draw_Picture(eX * (1 + me.cb_offset - me.cb_width), strcat(me.cb_src, "_n"), eX * me.cb_width + eY, '1 1 1', 1); + draw_Picture(eX * (1 + me.cb_offset - me.cb_width), strcat(me.cb_src, "_n"), eX * me.cb_width + eY, me.cb_color, 1); } // skipping SUPER(InputBox).draw(me); diff --git a/qcsrc/menu/skin-customizables.inc b/qcsrc/menu/skin-customizables.inc index 2afc1d9b25..56c6275195 100644 --- a/qcsrc/menu/skin-customizables.inc +++ b/qcsrc/menu/skin-customizables.inc @@ -164,9 +164,14 @@ SKINBEGIN SKINSTRING(GFX_INPUTBOX, "inputbox"); SKINVECTOR(COLOR_INPUTBOX_N, '1 1 1'); SKINVECTOR(COLOR_INPUTBOX_F, '1 1 1'); + SKINFLOAT(MARGIN_INPUTBOX_CHARS, 1); + + // item: clear button SKINSTRING(GFX_CLEARBUTTON, "clearbutton"); SKINFLOAT(OFFSET_CLEARBUTTON, 0); - SKINFLOAT(MARGIN_INPUTBOX_CHARS, 1); + SKINVECTOR(COLOR_CLEARBUTTON_N, '1 1 1'); + SKINVECTOR(COLOR_CLEARBUTTON_F, '1 1 1'); + SKINVECTOR(COLOR_CLEARBUTTON_C, '1 1 1'); // item: key grabber SKINVECTOR(COLOR_KEYGRABBER_TITLES, '1 1 1'); diff --git a/qcsrc/menu/xonotic/dialog_settings_misc_cvars.c b/qcsrc/menu/xonotic/dialog_settings_misc_cvars.c index 01f4f5f718..86dc021b5b 100644 --- a/qcsrc/menu/xonotic/dialog_settings_misc_cvars.c +++ b/qcsrc/menu/xonotic/dialog_settings_misc_cvars.c @@ -33,6 +33,9 @@ void XonoticCvarsDialog_fill(entity me) // in this dialog, use SKINCOLOR_CVARLIS me.TD(me, 1, me.columns - 1, e = makeXonoticInputBox(0, string_null)); e.color = SKINCOLOR_CVARLIST_CONTROLS; e.colorF = SKINCOLOR_CVARLIST_CONTROLS; + e.cb_color = SKINCOLOR_CVARLIST_CONTROLS; + e.cb_colorC = SKINCOLOR_CVARLIST_CONTROLS; + e.cb_colorF = SKINCOLOR_CVARLIST_CONTROLS; e.onChange = CvarList_Filter_Change; e.onChangeEntity = cvarlist; cvarlist.controlledTextbox = e; // this COULD also be the Value box, but this leads to accidentally editing stuff @@ -52,6 +55,9 @@ void XonoticCvarsDialog_fill(entity me) // in this dialog, use SKINCOLOR_CVARLIS cvarlist.cvarValueBox = e; e.color = SKINCOLOR_CVARLIST_CONTROLS; e.colorF = SKINCOLOR_CVARLIST_CONTROLS; + e.cb_color = SKINCOLOR_CVARLIST_CONTROLS; + e.cb_colorC = SKINCOLOR_CVARLIST_CONTROLS; + e.cb_colorF = SKINCOLOR_CVARLIST_CONTROLS; e.onChange = CvarList_Value_Change; e.onChangeEntity = cvarlist; e.onEnter = CvarList_End_Editing; diff --git a/qcsrc/menu/xonotic/inputbox.c b/qcsrc/menu/xonotic/inputbox.c index 9e42f3bf6f..249fa64ff6 100644 --- a/qcsrc/menu/xonotic/inputbox.c +++ b/qcsrc/menu/xonotic/inputbox.c @@ -19,6 +19,9 @@ CLASS(XonoticInputBox) EXTENDS(InputBox) // Clear button attributes ATTRIB(XonoticInputBox, cb_offset, float, SKINOFFSET_CLEARBUTTON) // bound to range -1, 0 ATTRIB(XonoticInputBox, cb_src, string, SKINGFX_CLEARBUTTON) + ATTRIB(XonoticInputBox, cb_color, vector, SKINCOLOR_CLEARBUTTON_N) + ATTRIB(XonoticInputBox, cb_colorF, vector, SKINCOLOR_CLEARBUTTON_F) + ATTRIB(XonoticInputBox, cb_colorC, vector, SKINCOLOR_CLEARBUTTON_C) ATTRIB(XonoticInputBox, cvarName, string, string_null) METHOD(XonoticInputBox, loadCvars, void(entity))