diff --git a/README.md b/README.md index 44abee1..1a11530 100644 --- a/README.md +++ b/README.md @@ -95,8 +95,12 @@ a.k.a. Features - `hudfragmessagescale`: size of the messages, between 0.0 and 1.0 - `hudfragmessagestackdir`: direction in which to stack old messages: -1 to stack upwards, 1 to stack downwards, 0 to stack towards the closes edge of the screen depending on `hudfragmessagey` - `hudfragmessagefilter`: bitfield filter var (like confilter), e.g. 0x3800 shows all players' frags, suicides, and teamkills + - `hudfragmessagecolors`: when 1 (default), uses colored names, even in non-team modes: + - yellow: you (while playing) + - blue: your team or the player you're spectating + - red: anyone else -You can easily configure the hud frag messages using the [improved menu](#menu) (options -> hud -> adjust hud frag messages). +You can easily configure the hud frag messages using the [improved menu](#menu) (options → hud → adjust hud frag messages). ### [fullconsole.patch](./patches/fullconsole.patch) diff --git a/patches/hudfragmessages.patch b/patches/hudfragmessages.patch index a419054..c165df3 100644 --- a/patches/hudfragmessages.patch +++ b/patches/hudfragmessages.patch @@ -52,18 +52,23 @@ Index: src/fpsgame/fps.cpp conoutf("follow off"); } -@@ -496,6 +500,10 @@ +@@ -496,6 +500,15 @@ if(d==player1) conoutf(contype, "\f2%s got fragged by %s", dname, aname); else conoutf(contype, "\f2%s fragged %s", aname, dname); } -+ if(actor==player1) aname = "\f2you"; -+ if(d==player1) dname = "\f2you"; ++ if(hudfragmessagecolors) ++ { ++ if(h==player1 && actor==player1) aname = "\fs\f2you\fr"; ++ else aname = colorname(actor, aname, actor==h ? "\fs\f1" : "\fs\f3", "\fr", NULL); ++ if(h==player1 && d==player1) dname = "\fs\f2you\fr"; ++ else dname = colorname(d, dname, d==h ? "\fs\f1" : "\fs\f3", "\fr", NULL); ++ } + if(d==actor) addfragmessage(contype, NULL, dname, HICON_TOKEN-HICON_FIST); + else addfragmessage(contype, aname, dname, d->lasthitpushgun); deathstate(d); ai::killed(d, actor); } -@@ -1091,6 +1099,7 @@ +@@ -1091,6 +1104,7 @@ { if(gameclock) drawgameclock(w, h); if(hudscore) drawhudscore(w, h); @@ -75,7 +80,7 @@ Index: src/fpsgame/fragmessages.cpp =================================================================== --- src/fpsgame/fragmessages.cpp (nonexistent) +++ src/fpsgame/fragmessages.cpp (working copy) -@@ -0,0 +1,76 @@ +@@ -0,0 +1,77 @@ +#include "game.h" + +namespace game { @@ -90,6 +95,7 @@ Index: src/fpsgame/fragmessages.cpp + FVARP(hudfragmessagescale, 0.1f, 0.5f, 1.0f); + VARP(hudfragmessagestackdir, -1, 0, 1); // -1 = upwards, 1 = downwards + HVARP(hudfragmessagefilter, 0, 0x2800, 0x7FFFFFF); // default: own frags + teamkills ++ VARP(hudfragmessagecolors, 0, 1, 1); + + void addfragmessage(int contype, const char *aname, const char *vname, int gun) + { @@ -156,7 +162,7 @@ Index: src/fpsgame/fragmessages.h =================================================================== --- src/fpsgame/fragmessages.h (nonexistent) +++ src/fpsgame/fragmessages.h (working copy) -@@ -0,0 +1,28 @@ +@@ -0,0 +1,29 @@ +#ifndef __FRAGMESSAGES_H__ +#define __FRAGMESSAGES_H__ + @@ -179,6 +185,7 @@ Index: src/fpsgame/fragmessages.h + + extern vector fragmessages; + extern int hudfragmessages; ++ extern int hudfragmessagecolors; + extern void addfragmessage(int contype, const char *aname, const char *vname, int gun); + extern void clearfragmessages(); + extern void drawfragmessages(int w, int h); diff --git a/src/fpsgame/fps.cpp b/src/fpsgame/fps.cpp index 7e84ef0..369d784 100644 --- a/src/fpsgame/fps.cpp +++ b/src/fpsgame/fps.cpp @@ -506,8 +506,13 @@ namespace game if(d==player1) conoutf(contype, "\f2%s got fragged by %s", dname, aname); else conoutf(contype, "\f2%s fragged %s", aname, dname); } - if(actor==player1) aname = "\f2you"; - if(d==player1) dname = "\f2you"; + if(hudfragmessagecolors) + { + if(h==player1 && actor==player1) aname = "\fs\f2you\fr"; + else aname = colorname(actor, aname, actor==h ? "\fs\f1" : "\fs\f3", "\fr", NULL); + if(h==player1 && d==player1) dname = "\fs\f2you\fr"; + else dname = colorname(d, dname, d==h ? "\fs\f1" : "\fs\f3", "\fr", NULL); + } if(d==actor) addfragmessage(contype, NULL, dname, HICON_TOKEN-HICON_FIST); else addfragmessage(contype, aname, dname, d->lasthitpushgun); deathstate(d); diff --git a/src/fpsgame/fragmessages.cpp b/src/fpsgame/fragmessages.cpp index 69c16b9..6f37d12 100644 --- a/src/fpsgame/fragmessages.cpp +++ b/src/fpsgame/fragmessages.cpp @@ -12,6 +12,7 @@ namespace game { FVARP(hudfragmessagescale, 0.1f, 0.5f, 1.0f); VARP(hudfragmessagestackdir, -1, 0, 1); // -1 = upwards, 1 = downwards HVARP(hudfragmessagefilter, 0, 0x2800, 0x7FFFFFF); // default: own frags + teamkills + VARP(hudfragmessagecolors, 0, 1, 1); void addfragmessage(int contype, const char *aname, const char *vname, int gun) { diff --git a/src/fpsgame/fragmessages.h b/src/fpsgame/fragmessages.h index 10ee1fd..6018f5c 100644 --- a/src/fpsgame/fragmessages.h +++ b/src/fpsgame/fragmessages.h @@ -20,6 +20,7 @@ namespace game { extern vector fragmessages; extern int hudfragmessages; + extern int hudfragmessagecolors; extern void addfragmessage(int contype, const char *aname, const char *vname, int gun); extern void clearfragmessages(); extern void drawfragmessages(int w, int h);