From 799c52c450ee781fdc9ff0f4b755aa12020dc9f8 Mon Sep 17 00:00:00 2001 From: sauerbraten Date: Thu, 11 Mar 2021 22:33:20 +0100 Subject: [PATCH] hudfragmessagecolors -> hudfragmessageforcecolors --- README.md | 5 +---- patches/hudfragmessages.patch | 14 +++++++------- src/fpsgame/fps.cpp | 10 +++++----- src/fpsgame/fragmessages.cpp | 2 +- src/fpsgame/fragmessages.h | 2 +- 5 files changed, 15 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 1a11530..064c81f 100644 --- a/README.md +++ b/README.md @@ -95,10 +95,7 @@ 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 + - `hudfragmessageforcecolors`: when 1 (default), uses colored names, even in non-team modes You can easily configure the hud frag messages using the [improved menu](#menu) (options → hud → adjust hud frag messages). diff --git a/patches/hudfragmessages.patch b/patches/hudfragmessages.patch index c165df3..e167599 100644 --- a/patches/hudfragmessages.patch +++ b/patches/hudfragmessages.patch @@ -56,13 +56,13 @@ Index: src/fpsgame/fps.cpp if(d==player1) conoutf(contype, "\f2%s got fragged by %s", dname, aname); else conoutf(contype, "\f2%s fragged %s", aname, dname); } -+ if(hudfragmessagecolors) ++ if(hudfragmessageforcecolors && !m_teammode) + { -+ 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); ++ dname = colorname(d, NULL, d==h ? "\fs\f1" : "\fs\f3", "\fr", NULL); ++ aname = colorname(actor, NULL, actor==h ? "\fs\f1" : "\fs\f3", "\fr", NULL); + } ++ if(h==player1 && d==player1) dname = "\fs\f2you\fr"; ++ if(h==player1 && actor==player1) aname = "\fs\f2you\fr"; + if(d==actor) addfragmessage(contype, NULL, dname, HICON_TOKEN-HICON_FIST); + else addfragmessage(contype, aname, dname, d->lasthitpushgun); deathstate(d); @@ -95,7 +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); ++ VARP(hudfragmessageforcecolors, 0, 1, 1); + + void addfragmessage(int contype, const char *aname, const char *vname, int gun) + { @@ -185,7 +185,7 @@ Index: src/fpsgame/fragmessages.h + + extern vector fragmessages; + extern int hudfragmessages; -+ extern int hudfragmessagecolors; ++ extern int hudfragmessageforcecolors; + 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 369d784..a34f110 100644 --- a/src/fpsgame/fps.cpp +++ b/src/fpsgame/fps.cpp @@ -506,13 +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(hudfragmessagecolors) + if(hudfragmessageforcecolors && !m_teammode) { - 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); + dname = colorname(d, NULL, d==h ? "\fs\f1" : "\fs\f3", "\fr", NULL); + aname = colorname(actor, NULL, actor==h ? "\fs\f1" : "\fs\f3", "\fr", NULL); } + if(h==player1 && d==player1) dname = "\fs\f2you\fr"; + if(h==player1 && actor==player1) aname = "\fs\f2you\fr"; 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 6f37d12..b4c09b5 100644 --- a/src/fpsgame/fragmessages.cpp +++ b/src/fpsgame/fragmessages.cpp @@ -12,7 +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); + VARP(hudfragmessageforcecolors, 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 6018f5c..fbd17e3 100644 --- a/src/fpsgame/fragmessages.h +++ b/src/fpsgame/fragmessages.h @@ -20,7 +20,7 @@ namespace game { extern vector fragmessages; extern int hudfragmessages; - extern int hudfragmessagecolors; + extern int hudfragmessageforcecolors; extern void addfragmessage(int contype, const char *aname, const char *vname, int gun); extern void clearfragmessages(); extern void drawfragmessages(int w, int h);