]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add the fade effect in the charmap too
authorterencehill <piuntn@gmail.com>
Thu, 30 Apr 2015 20:21:22 +0000 (22:21 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 30 Apr 2015 20:21:22 +0000 (22:21 +0200)
gfx/menu/luma/skinvalues.txt
gfx/menu/luminos/skinvalues.txt
gfx/menu/wickedx/skinvalues.txt
gfx/menu/xaw/skinvalues.txt
qcsrc/menu/skin-customizables.inc
qcsrc/menu/xonotic/charmap.qc

index 2a9a0077e131f764d6b4a331470d98aca0c71b93..d521800a0f36ab479a707b0eba32b17dae14a005 100644 (file)
@@ -33,8 +33,6 @@ COLOR_CAMPAIGN_SELECTABLE     '0.96 0.99 1'
 // charmap
 ALPHA_CHARMAP_CHAR            0.85
 COLOR_CHARMAP_CHAR            '1 1 1'
-ALPHA_CHARMAP_FOCUS           0.85
-COLOR_CHARMAP_FOCUS           '0.09 0.42 0.69'
 
 // checkbox
 COLOR_CHECKBOX_C              '1 1 1'
@@ -143,7 +141,7 @@ COLOR_LISTBOX_SELECTED        '0.97 0.56 0.27'
 ALPHA_LISTBOX_WAITING         0.8
 COLOR_LISTBOX_WAITING         '0.73 0.82 0.9'
 ALPHA_LISTBOX_FOCUSED         0.8
-FADEALPHA_LISTBOX_FOCUSED     0.2
+FADEALPHA_LISTBOX_FOCUSED     0.4
 COLOR_LISTBOX_FOCUSED         '0.09 0.42 0.69'
 
 // mainmenu
index 2b0f43f69c08e01eb2b35e53dae44309f08b1c8c..dd653973c6d74725f2632fc2d380aa20df516092 100755 (executable)
@@ -224,8 +224,6 @@ ALPHA_KEYGRABBER_KEYS           0.7
 // item: charmap
 ALPHA_CHARMAP_CHAR              0.85
 COLOR_CHARMAP_CHAR              '1 1 1'
-ALPHA_CHARMAP_FOCUS             1
-COLOR_CHARMAP_FOCUS             '0 0.25 0.5'
 
 // item: radio button
 //   uses "radiobutton" images
index 6e51cd982f3d757c9e0d317913740b4c4d39bd78..7f1ed450027a9dee5142db65088eb3f3f2ebca69 100644 (file)
@@ -224,8 +224,6 @@ ALPHA_KEYGRABBER_KEYS           0.7
 // item: charmap
 ALPHA_CHARMAP_CHAR              0.85
 COLOR_CHARMAP_CHAR              '1 1 1'
-ALPHA_CHARMAP_FOCUS             0.75
-COLOR_CHARMAP_FOCUS             '0 0.375 0.75'
 
 // item: radio button
 //   uses "radiobutton" images
index 477d1c972d01291d5ecf5c1fb6c07448ff6d1593..6de99761e73fbc8305696129ff468c6107ae4c83 100644 (file)
@@ -179,8 +179,6 @@ ALPHA_MODELTITLE                1
 // item: charmap
 ALPHA_CHARMAP_CHAR              0.85
 COLOR_CHARMAP_CHAR              '1 1 1'
-ALPHA_CHARMAP_FOCUS             0.5
-COLOR_CHARMAP_FOCUS             '0 0 0'
 
 // item: radio button
 //   uses "radiobutton" images
index 2e0d0b5fa7553ceb43cb95902a39519483df3b05..fa5a5df1998e18f312afc4bae5af75c2c4c04c23 100644 (file)
@@ -217,8 +217,6 @@ SKINBEGIN
        // item: player name editor
        SKINVECTOR(COLOR_CHARMAP_CHAR, '1 1 1');
        SKINFLOAT(ALPHA_CHARMAP_CHAR, 1);
-       SKINVECTOR(COLOR_CHARMAP_FOCUS, '0 0 1');
-       SKINFLOAT(ALPHA_CHARMAP_FOCUS, 0.5);
 
        // item: radio button
        SKINSTRING(GFX_RADIOBUTTON, "radiobutton");
index 6953ba78d169138c967d34bf258955619dbe598d..b72b86826ad51b04f0cdc988260c85359668c723 100644 (file)
@@ -17,6 +17,7 @@ CLASS(XonoticCharmap) EXTENDS(Item)
        ATTRIB(XonoticCharmap, realFontSize, vector, '0 0 0')
        ATTRIB(XonoticCharmap, realCellSize, vector, '0 0 0')
        ATTRIB(XonoticCharmap, focusedCell, vector, '-1 -1 0')
+       ATTRIB(XonoticCharmap, focusedCellTime, float, 0)
        ATTRIB(XonoticCharmap, pressedCell, vector, '-1 -1 0')
 ENDCLASS(XonoticCharmap)
 entity makeXonoticCharmap(entity controlledInputBox);
@@ -92,6 +93,7 @@ void XonoticCharmap_resizeNotify(entity me, vector relOrigin, vector relSize, ve
 
 float XonoticCharmap_mouseMove(entity me, vector coords)
 {
+       vector prevFocusedCell = me.focusedCell;
        me.focusedCell_x = floor(coords.x * CHARMAP_COLS);
        me.focusedCell_y = floor(coords.y * CHARMAP_ROWS);
 
@@ -102,6 +104,9 @@ float XonoticCharmap_mouseMove(entity me, vector coords)
                return 0;
        }
 
+       if(me.focusedCell != prevFocusedCell)
+               me.focusedCellTime = time;
+
        return 1;
 }
 
@@ -227,7 +232,7 @@ void XonoticCharmap_draw(entity me)
                                {
                                        cellPos_x = mod(me.focusedCell.x, CHARMAP_COLS) / CHARMAP_COLS;
                                        cellPos_y = mod(me.focusedCell.y, CHARMAP_ROWS) / CHARMAP_ROWS;
-                                       draw_Fill(cellPos, me.realCellSize, SKINCOLOR_CHARMAP_FOCUS, SKINALPHA_CHARMAP_FOCUS);
+                                       draw_Fill(cellPos, me.realCellSize, SKINCOLOR_LISTBOX_FOCUSED, getHighlightAlpha(SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED, me.focusedCellTime));
                                }
                        }