]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Custom colors for the Clear button
authorterencehill <piuntn@gmail.com>
Fri, 27 Jan 2012 18:53:03 +0000 (19:53 +0100)
committerterencehill <piuntn@gmail.com>
Fri, 27 Jan 2012 18:53:03 +0000 (19:53 +0100)
gfx/menu/luminos/skinvalues.txt
gfx/menu/wickedx/skinvalues.txt
gfx/menu/xaw/skinvalues.txt
qcsrc/menu/item/inputbox.c
qcsrc/menu/skin-customizables.inc
qcsrc/menu/xonotic/dialog_settings_misc_cvars.c
qcsrc/menu/xonotic/inputbox.c

index de957917721ebcd5ce5012ff8abe0280eeecee9e..e79dba0e099fd157d28f4c8f7ad7692b3568f7c1 100755 (executable)
@@ -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'
index eee5cc649eea7344ab34a2853f0eca1ac985170e..15605128588e79c4e3c73c4f647a3e518837ea50 100755 (executable)
@@ -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'
index c5e5120372fed2fcdd2a961a7d33a4d4701923cb..3bd555f031ed32255e35cec19596893bfc5597dc 100644 (file)
@@ -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'
index 83bb916dad2363dc389fd8db05bb54a6565bdfa2..71f0b60bde8faaa4a0de854159c850f7335614ce 100644 (file)
@@ -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);
index 2afc1d9b25706e0b29171deb5ed33a0d48696257..56c62751959df29719c9ade134e2b8b8807a7d7e 100644 (file)
@@ -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');
index 01f4f5f71835f0c14d260a4e7bcb462b40d60504..86dc021b5b196f4050fb561da94f122b71675f49 100644 (file)
@@ -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;
index 9e42f3bf6fc0fa61c56f54f5bd92e2ab80612223..249fa64ff6f49f4f32f50bb137c9d4977be84c93 100644 (file)
@@ -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))