From: FruitieX Date: Tue, 8 Jun 2010 18:28:41 +0000 (+0300) Subject: hack in flipping the order of the notify stack, so that it can stack from the bottom... X-Git-Tag: xonotic-v0.1.0preview~541^2~95 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2816927cb0e3b4cf86ee1945de1fe47efcc1492e;p=xonotic%2Fxonotic-data.pk3dir.git hack in flipping the order of the notify stack, so that it can stack from the bottom up (enable by default) --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 560efb682..e69d53b8e 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -1406,6 +1406,7 @@ seta hud_notify_bg_color_team "" "override panel color with team color in team b seta hud_notify_bg_alpha "" "if set to something else than \"\" = override default panel background alpha" seta hud_notify_bg_border "" "if set to something else than \"\" = override default size of border around the background" seta hud_notify_bg_padding "" "if set to something else than \"\" = override default padding of contents from border" +seta hud_healtharmor_flip 0 "order the list top to bottom instead of bottom to top" seta hud_notify_print 0 "also con_notify print the messages that are shown on the notify panel" seta hud_notify_time 5 "time that a new entry stays until it fades out" seta hud_notify_fadetime 2 "fade out time" diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 77650a1bf..f908ad78f 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -2404,71 +2404,76 @@ void HUD_Notify (void) string s; - float i; - for(i = 0; i < entries; ++i) + float i, j; + for(j = 0; j < entries; ++j) { + if(cvar("hud_notify_flip")) + i = j; + else // rather nasty hack for ordering items from the bottom up + i = entries - j - 1; + if(fadetime) { - if(killnotify_times[i] + when > time) + if(killnotify_times[j] + when > time) a = 1; else - a = bound(0, (killnotify_times[i] + when + fadetime - time) / fadetime, 1); + a = bound(0, (killnotify_times[j] + when + fadetime - time) / fadetime, 1); } else { - if(killnotify_times[i] + when > time) + if(killnotify_times[j] + when > time) a = 1; else a = 0; } // X [did action to] Y - if(WEP_VALID(killnotify_deathtype[i])) + if(WEP_VALID(killnotify_deathtype[j])) { - self = get_weaponinfo(killnotify_deathtype[i]); + self = get_weaponinfo(killnotify_deathtype[j]); drawpic_skin(pos + eX * 0.5 * mySize_x - eX * 0.5 * height + eY * 0.25 * height + eY * i * height, strcat("weapon", self.netname), '1 0.5 0' * height, '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL); - drawcolorcodedstring(pos + eY * 0.33 * height + eY * i * height, textShortenToWidth(killnotify_attackers[i], 0.5 * mySize_x - 0.5 * height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL); - drawcolorcodedstring(pos + eY * 0.33 * height + eX * 0.5 * mySize_x + eX * 0.5 * height + eY * i * height, textShortenToWidth(killnotify_victims[i], 0.5 * mySize_x - 0.5 * height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos + eY * 0.33 * height + eY * i * height, textShortenToWidth(killnotify_attackers[j], 0.5 * mySize_x - 0.5 * height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos + eY * 0.33 * height + eX * 0.5 * mySize_x + eX * 0.5 * height + eY * i * height, textShortenToWidth(killnotify_victims[j], 0.5 * mySize_x - 0.5 * height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL); } - else if(killnotify_deathtype[i] == DEATH_FALL) + else if(killnotify_deathtype[j] == DEATH_FALL) { drawpic_skin(pos + eX * 0.5 * mySize_x - eX * 0.5 * height + eY * 0.25 * height + eY * i * height, "notify_pushoffedge", '1 0.5 0' * height, '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL); - drawcolorcodedstring(pos + eY * 0.33 * height + eY * i * height, textShortenToWidth(killnotify_attackers[i], 0.5 * mySize_x - 0.5 * height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL); - drawcolorcodedstring(pos + eY * 0.33 * height + eX * 0.5 * mySize_x + eX * 0.5 * height + eY * i * height, textShortenToWidth(killnotify_victims[i], 0.5 * mySize_x - 0.5 * height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos + eY * 0.33 * height + eY * i * height, textShortenToWidth(killnotify_attackers[j], 0.5 * mySize_x - 0.5 * height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos + eY * 0.33 * height + eX * 0.5 * mySize_x + eX * 0.5 * height + eY * i * height, textShortenToWidth(killnotify_victims[j], 0.5 * mySize_x - 0.5 * height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL); } // Y [used by] X - else if(killnotify_deathtype[i] == DEATH_KILL) + else if(killnotify_deathtype[j] == DEATH_KILL) { drawpic_skin(pos + eY * 0.25 * height + eY * i * height, "notify_selfkill", '1 0.5 0' * height, '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL); - drawcolorcodedstring(pos + eX * height + eY * 0.33 * height + eY * i * height, textShortenToWidth(killnotify_attackers[i], mySize_x - height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos + eX * height + eY * 0.33 * height + eY * i * height, textShortenToWidth(killnotify_attackers[j], mySize_x - height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL); } - else if(killnotify_deathtype[i] == INFO_GOTFLAG) + else if(killnotify_deathtype[j] == INFO_GOTFLAG) { - if(killnotify_victims[i] == "^1RED^7 flag") + if(killnotify_victims[j] == "^1RED^7 flag") s = "red"; else s = "blue"; drawpic_skin(pos + eY * i * height, strcat("flag_", s, "_carrying"), '1 1 0' * height, '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL); - drawcolorcodedstring(pos + eX * height + eY * 0.33 * height + eY * i * height, textShortenToWidth(killnotify_attackers[i], mySize_x - height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos + eX * height + eY * 0.33 * height + eY * i * height, textShortenToWidth(killnotify_attackers[j], mySize_x - height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL); } - else if(killnotify_deathtype[i] == INFO_RETURNFLAG) + else if(killnotify_deathtype[j] == INFO_RETURNFLAG) { - if(killnotify_victims[i] == "^1RED^7 flag") + if(killnotify_victims[j] == "^1RED^7 flag") s = "red"; else s = "blue"; drawpic_skin(pos + eY * i * height, strcat("flag_", s, "_taken"), '1 1 0' * height, '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL); - drawcolorcodedstring(pos + eX * height + eY * 0.33 * height + eY * i * height, textShortenToWidth(killnotify_attackers[i], mySize_x - height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos + eX * height + eY * 0.33 * height + eY * i * height, textShortenToWidth(killnotify_attackers[j], mySize_x - height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL); } - else if(killnotify_deathtype[i] == INFO_LOSTFLAG) + else if(killnotify_deathtype[j] == INFO_LOSTFLAG) { - if(killnotify_victims[i] == "^1RED^7 flag") + if(killnotify_victims[j] == "^1RED^7 flag") s = "red"; else s = "blue"; drawpic_skin(pos + eY * i * height, strcat("flag_", s, "_lost"), '1 1 0' * height, '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL); - drawcolorcodedstring(pos + eX * height + eY * 0.33 * height + eY * i * height, textShortenToWidth(killnotify_attackers[i], mySize_x - height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos + eX * height + eY * 0.33 * height + eY * i * height, textShortenToWidth(killnotify_attackers[j], mySize_x - height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL); } } /* This will come later.