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 2a9a007..d521800 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 2b0f43f..dd65397 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 6e51cd9..7f1ed45 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 477d1c9..6de9976 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 2e0d0b5..fa5a5df 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 6953ba7..b72b868 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));
                                }
                        }