From: terencehill Date: Thu, 30 Apr 2015 20:21:22 +0000 (+0200) Subject: Add the fade effect in the charmap too X-Git-Tag: xonotic-v0.8.1~55^2~12 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=26dcd9dd8e28dccaa4d0e1ad944de4de44029e52;p=xonotic%2Fxonotic-data.pk3dir.git Add the fade effect in the charmap too --- diff --git a/gfx/menu/luma/skinvalues.txt b/gfx/menu/luma/skinvalues.txt index 2a9a0077e..d521800a0 100644 --- a/gfx/menu/luma/skinvalues.txt +++ b/gfx/menu/luma/skinvalues.txt @@ -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 diff --git a/gfx/menu/luminos/skinvalues.txt b/gfx/menu/luminos/skinvalues.txt index 2b0f43f69..dd653973c 100755 --- a/gfx/menu/luminos/skinvalues.txt +++ b/gfx/menu/luminos/skinvalues.txt @@ -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 diff --git a/gfx/menu/wickedx/skinvalues.txt b/gfx/menu/wickedx/skinvalues.txt index 6e51cd982..7f1ed4500 100644 --- a/gfx/menu/wickedx/skinvalues.txt +++ b/gfx/menu/wickedx/skinvalues.txt @@ -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 diff --git a/gfx/menu/xaw/skinvalues.txt b/gfx/menu/xaw/skinvalues.txt index 477d1c972..6de99761e 100644 --- a/gfx/menu/xaw/skinvalues.txt +++ b/gfx/menu/xaw/skinvalues.txt @@ -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 diff --git a/qcsrc/menu/skin-customizables.inc b/qcsrc/menu/skin-customizables.inc index 2e0d0b5fa..fa5a5df19 100644 --- a/qcsrc/menu/skin-customizables.inc +++ b/qcsrc/menu/skin-customizables.inc @@ -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"); diff --git a/qcsrc/menu/xonotic/charmap.qc b/qcsrc/menu/xonotic/charmap.qc index 6953ba78d..b72b86826 100644 --- a/qcsrc/menu/xonotic/charmap.qc +++ b/qcsrc/menu/xonotic/charmap.qc @@ -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)); } }