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
+COLOR_LISTBOX_FOCUSED '0.09 0.42 0.69'
// mainmenu
ALPHAS_MAINMENU '0.8 0.9 1'
ALPHA_LISTBOX_SELECTED 1
COLOR_LISTBOX_WAITING '1 1 1'
ALPHA_LISTBOX_WAITING 0.5
+COLOR_LISTBOX_FOCUSED '0 0.25 0.5'
+ALPHA_LISTBOX_FOCUSED 0.7
+FADEALPHA_LISTBOX_FOCUSED 0.3
// item: map list
COLOR_MAPLIST_TITLE '1 1 1'
ALPHA_LISTBOX_SELECTED 1
COLOR_LISTBOX_WAITING '1 1 1'
ALPHA_LISTBOX_WAITING 0.5
+COLOR_LISTBOX_FOCUSED '0 0.375 0.75'
+ALPHA_LISTBOX_FOCUSED 0.35
+FADEALPHA_LISTBOX_FOCUSED 0.75
// item: map list
COLOR_MAPLIST_TITLE '1 1 1'
ALPHA_LISTBOX_SELECTED 1
COLOR_LISTBOX_WAITING '1 0 0'
ALPHA_LISTBOX_WAITING 0.5
-COLOR_LISTBOX_BACKGROUND '0 0 0'
-ALPHA_LISTBOX_BACKGROUND 0
+COLOR_LISTBOX_BACKGROUND '0 0 0'
+ALPHA_LISTBOX_BACKGROUND 0
+COLOR_LISTBOX_FOCUSED '0 0 0'
+ALPHA_LISTBOX_FOCUSED 0.3
+FADEALPHA_LISTBOX_FOCUSED 0.3
// item: map list
COLOR_MAPLIST_TITLE '1 1 1'
SKINFLOAT(ALPHA_LISTBOX_WAITING, 0.5);
SKINVECTOR(COLOR_LISTBOX_BACKGROUND, '0 0 0');
SKINFLOAT(ALPHA_LISTBOX_BACKGROUND, 0.5);
+ SKINVECTOR(COLOR_LISTBOX_FOCUSED, '0 0 1');
+ SKINFLOAT(ALPHA_LISTBOX_FOCUSED, 0.7);
+ SKINFLOAT(FADEALPHA_LISTBOX_FOCUSED, 0.3);
// item: map list
SKINVECTOR(COLOR_MAPLIST_TITLE, '1 1 1');
if(isSelected)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
else if(highlightedTime)
- draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, getHighlightAlpha(SKINALPHA_LISTBOX_SELECTED * 0.1, highlightedTime));
+ draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_FOCUSED, getHighlightAlpha(SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED, highlightedTime));
if(draw_PictureSize(strcat("/maps/", campaign_mapname[i])) == '0 0 0')
draw_Picture(me.columnPreviewOrigin * eX, "nopreview_map", me.columnPreviewSize * eX + eY, '1 1 1', theAlpha);
if(isSelected)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
else if(highlightedTime)
- draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, getHighlightAlpha(SKINALPHA_LISTBOX_SELECTED * 0.1, highlightedTime));
+ draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_FOCUSED, getHighlightAlpha(SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED, highlightedTime));
k = bufstr_get(me.handle, i);
if(isSelected)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
else if(highlightedTime)
- draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, getHighlightAlpha(SKINALPHA_LISTBOX_SELECTED * 0.1, highlightedTime));
+ draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_FOCUSED, getHighlightAlpha(SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED, highlightedTime));
s = me.demoName(me,i);
s = draw_TextShortenToWidth(s, me.columnNameSize, 0, me.realFontSize);
if(isSelected)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
else if(highlightedTime)
- draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, getHighlightAlpha(SKINALPHA_LISTBOX_SELECTED * 0.1, highlightedTime));
+ draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_FOCUSED, getHighlightAlpha(SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED, highlightedTime));
draw_Picture(me.columnIconOrigin * eX, GameType_GetIcon(i), me.columnIconSize * eX + eY, '1 1 1', SKINALPHA_LISTBOX_SELECTED);
s1 = GameType_GetName(i);
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
}
else if(highlightedTime)
- draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, getHighlightAlpha(SKINALPHA_LISTBOX_SELECTED * 0.1, highlightedTime));
+ draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_FOCUSED, getHighlightAlpha(SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED, highlightedTime));
theAlpha = SKINALPHA_KEYGRABBER_KEYS;
theColor = SKINCOLOR_KEYGRABBER_KEYS;
if(isSelected)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
else if(highlightedTime)
- draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, getHighlightAlpha(SKINALPHA_LISTBOX_SELECTED * 0.1, highlightedTime));
+ draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_FOCUSED, getHighlightAlpha(SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED, highlightedTime));
s = me.languageParameter(me, i, LANGPARM_NAME_LOCALIZED);
if(included)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_MAPLIST_INCLUDEDBG, SKINALPHA_MAPLIST_INCLUDEDBG);
if(highlightedTime)
- draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, getHighlightAlpha(SKINALPHA_LISTBOX_SELECTED * 0.1, highlightedTime));
+ draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_FOCUSED, getHighlightAlpha(SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED, highlightedTime));
}
if(draw_PictureSize(strcat("/maps/", MapInfo_Map_bspname)) == '0 0 0')
if(isSelected)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
else if(highlightedTime)
- draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, getHighlightAlpha(SKINALPHA_LISTBOX_SELECTED * 0.1, highlightedTime));
+ draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_FOCUSED, getHighlightAlpha(SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED, highlightedTime));
if(i == me.playingTrack)
{
if(isSelected)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
else if(highlightedTime)
- draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, getHighlightAlpha(SKINALPHA_LISTBOX_SELECTED * 0.1, highlightedTime));
+ draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_FOCUSED, getHighlightAlpha(SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED, highlightedTime));
s = me.screenshotName(me,i);
s = draw_TextShortenToWidth(s, me.columnNameSize, 0, me.realFontSize);
if(isSelected)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
else if(highlightedTime)
- draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, getHighlightAlpha(SKINALPHA_LISTBOX_SELECTED * 0.1, highlightedTime));
+ draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_FOCUSED, getHighlightAlpha(SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED, highlightedTime));
s = gethostcachestring(SLIST_FIELD_QCSTATUS, i);
m = tokenizebyseparator(s, ":");
if(isSelected)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
else if(highlightedTime)
- draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, getHighlightAlpha(SKINALPHA_LISTBOX_SELECTED * 0.1, highlightedTime));
+ draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_FOCUSED, getHighlightAlpha(SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED, highlightedTime));
s = me.skinParameter(me, i, SKINPARM_PREVIEW);
draw_Picture(me.columnPreviewOrigin * eX, s, me.columnPreviewSize * eX + eY, '1 1 1', 1);
if(isSelected)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
else if(highlightedTime)
- draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, getHighlightAlpha(SKINALPHA_LISTBOX_SELECTED * 0.1, highlightedTime));
+ draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_FOCUSED, getHighlightAlpha(SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED, highlightedTime));
s = me.soundName(me,i);
if(s == cvar_string("menu_cdtrack")) // current menu track
if(isSelected)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
else if(highlightedTime)
- draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, getHighlightAlpha(SKINALPHA_LISTBOX_SELECTED * 0.1, highlightedTime));
+ draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_FOCUSED, getHighlightAlpha(SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED, highlightedTime));
string data = bufstr_get(me.listStats, i);
string s = car(data);
}
#define FADE_TIME 0.5
-#define MAX_ALPHA_INCREASE 0.1
#define TRESHOLD_TIME 0.1
-float getHighlightAlpha(float baseAlpha, float highlightedTime)
+float getHighlightAlpha(float startAlpha, float targetAlpha, float highlightedTime)
{
- float alphaIncrease;
- if (time - highlightedTime - TRESHOLD_TIME < FADE_TIME)
+ float theAlpha;
+ if((time - highlightedTime - TRESHOLD_TIME) < FADE_TIME)
{
- alphaIncrease = max(0, (time - highlightedTime - TRESHOLD_TIME) / FADE_TIME);
- alphaIncrease = (1 - alphaIncrease) * MAX_ALPHA_INCREASE;
+ float f = max(0, (time - highlightedTime - TRESHOLD_TIME) / FADE_TIME);
+ theAlpha = startAlpha + f * (targetAlpha - startAlpha);
}
else
- alphaIncrease = 0;
- return baseAlpha + alphaIncrease;
+ theAlpha = targetAlpha;
+ return theAlpha;
}
void CheckSendCvars(entity me, string cvarnamestring)
me.TD(me, 1, 4, e = makeXonoticCheckBox(0, strzone(strcat("hud_panel_", panelname)), _("Enable panel"))); \
DIALOG_HUDPANEL_COMMON_NOTOGGLE()
-float getHighlightAlpha(float baseAlpha, float highlightedTime);
+float getHighlightAlpha(float startAlpha, float targetAlpha, float highlightedTime);
string _Nex_ExtResponseSystem_BannedServers;
float _Nex_ExtResponseSystem_BannedServersNeedsRefresh;
if(isSelected)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
else if(highlightedTime)
- draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, getHighlightAlpha(SKINALPHA_LISTBOX_SELECTED * 0.1, highlightedTime));
+ draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_FOCUSED, getHighlightAlpha(SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED, highlightedTime));
e = get_weaponinfo(stof(argv(i)));
string msg = e.message;
if(e.spawnflags & WEP_FLAG_MUTATORBLOCKED)