-
Notifications
You must be signed in to change notification settings - Fork 3
/
zenmode.patch
158 lines (152 loc) · 6.81 KB
/
zenmode.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
NOTE: builds partly on top of modversion.patch
Index: src/p1xbraten/version.cpp
===================================================================
--- src/p1xbraten/version.cpp (nonexistent)
+++ src/p1xbraten/version.cpp (working copy)
@@ -15,6 +15,12 @@
if(naturalsort(p1xbratenversion, version) == -1)
{
// we're newer, run migrations
+ if(naturalsort(p1xbratenversion, "3.0.0") == -1) {
+ // activate CON_NONZEN in all consoles
+ if(!(confilter&(1<<14))) confilter += 1<<14;
+ if(!(fullconfilter&(1<<14))) fullconfilter += 1<<14;
+ if(!(miniconfilter&(1<<14))) miniconfilter += 1<<14;
+ }
}
setsvar("p1xbratenversion", version);
lockversion();
Index: src/engine/console.cpp
===================================================================
--- src/engine/console.cpp (revision 6491)
+++ src/engine/console.cpp (working copy)
@@ -116,7 +116,8 @@
{
// shuffle backwards to fill if necessary
int idx = offset+i < numl ? offset+i : --offset;
- if(!(conlines[idx].type&filter)) continue;
+ int flags = conlines[idx].type & CON_FLAGS;
+ if((flags&filter)!=flags) continue;
char *line = conlines[idx].line;
int width, height;
text_bounds(line, width, height, conwidth);
@@ -127,7 +128,8 @@
loopi(numl)
{
int idx = offset + (dir > 0 ? numl-i-1 : i);
- if(!(conlines[idx].type&filter)) continue;
+ int flags = conlines[idx].type & CON_FLAGS;
+ if((flags&filter)!=flags) continue;
char *line = conlines[idx].line;
int width, height;
text_bounds(line, width, height, conwidth);
Index: src/fpsgame/ai.cpp
===================================================================
--- src/fpsgame/ai.cpp (revision 6491)
+++ src/fpsgame/ai.cpp (working copy)
@@ -149,7 +149,7 @@
if(!d->name[0])
{
if(aidebug) conoutf(CON_DEBUG, "%s assigned to %s at skill %d", colorname(d, name), o ? colorname(o) : "?", sk);
- else conoutf("\f0join:\f7 %s", colorname(d, name));
+ else conoutf(CON_INFO|CON_NONZEN, "\f0join:\f7 %s", colorname(d, name));
resetthisguy = true;
}
else
Index: src/fpsgame/client.cpp
===================================================================
--- src/fpsgame/client.cpp (revision 6491)
+++ src/fpsgame/client.cpp (working copy)
@@ -445,6 +445,19 @@
ICOMMAND(unignore, "s", (char *arg), unignore(parseplayer(arg)));
ICOMMAND(isignored, "s", (char *arg), intret(isignored(parseplayer(arg)) ? 1 : 0));
+ MOD(VARFP, zenmode, 0, 0, 1, {
+ if(zenmode)
+ {
+ if(miniconfilter&CON_NONZEN) miniconfilter -= CON_NONZEN;
+ if(confilter&CON_NONZEN) confilter -= CON_NONZEN;
+ }
+ else
+ {
+ if(!(miniconfilter&CON_NONZEN)) miniconfilter += CON_NONZEN;
+ if(!(confilter&CON_NONZEN)) confilter += CON_NONZEN;
+ }
+ });
+
void setteam(const char *arg1, const char *arg2)
{
int i = parseplayer(arg1);
@@ -1329,3 +1342,3 @@
if(d->state!=CS_DEAD && d->state!=CS_SPECTATOR)
particle_textcopy(d->abovehead(), text, PART_TEXT, 2000, 0x32FF64, 4.0f, -8);
- conoutf(CON_CHAT, "%s:\f0 %s", chatcolorname(d), text);
+ conoutf(CON_CHAT + (d->state==CS_SPECTATOR ? CON_NONZEN : 0), "%s:\f0 %s", chatcolorname(d), text);
@@ -1342,3 +1355,3 @@
if(t->state!=CS_DEAD && t->state!=CS_SPECTATOR)
particle_textcopy(t->abovehead(), text, PART_TEXT, 2000, COL_BLUE, 4.0f, -8);
- conoutf(CON_TEAMCHAT, "\fs\f8[%s]\fr %s: \f8%s", t->state==CS_SPECTATOR ? "spec" : "team", chatcolorname(t), text);
+ conoutf(CON_TEAMCHAT + (t->state==CS_SPECTATOR ? CON_NONZEN : 0), "\fs\f8[%s]\fr %s: \f8%s", t->state==CS_SPECTATOR ? "spec" : "team", chatcolorname(t), text);
@@ -1400,11 +1413,11 @@
if(d->name[0]) // already connected
{
if(strcmp(d->name, text) && !isignored(d->clientnum))
- conoutf("%s is now known as %s", colorname(d), colorname(d, text));
+ conoutf(CON_INFO + (d->state==CS_SPECTATOR ? CON_NONZEN : 0), "%s is now known as %s", colorname(d), colorname(d, text));
}
else // new client
{
- conoutf("\f0join:\f7 %s", colorname(d, text));
+ conoutf(CON_INFO|CON_NONZEN, "\f0join:\f7 %s", colorname(d, text));
if(needclipboard >= 0) needclipboard++;
}
copystring(d->name, text, MAXNAMELEN+1);
@@ -1422,7 +1435,7 @@
if(!text[0]) copystring(text, "unnamed");
if(strcmp(text, d->name))
{
- if(!isignored(d->clientnum)) conoutf("%s is now known as %s", colorname(d), colorname(d, text));
+ if(!isignored(d->clientnum)) conoutf(CON_INFO + (d->state==CS_SPECTATOR ? CON_NONZEN : 0), "%s is now known as %s", colorname(d), colorname(d, text));
copystring(d->name, text, MAXNAMELEN+1);
}
}
@@ -1771,7 +1784,7 @@
case N_SERVMSG:
getstring(text, p);
- conoutf("%s", text);
+ conoutf(CON_INFO|CON_NONZEN, "%s", text);
break;
case N_SENDDEMOLIST:
Index: src/fpsgame/fps.cpp
===================================================================
--- src/fpsgame/fps.cpp (revision 6491)
+++ src/fpsgame/fps.cpp (working copy)
@@ -575,7 +575,7 @@
unignore(cn);
fpsent *d = clients[cn];
if(!d) return;
- if(notify && d->name[0]) conoutf("\f4leave:\f7 %s", colorname(d));
+ if(notify && d->name[0]) conoutf(CON_INFO + (d->state==CS_SPECTATOR ? CON_NONZEN : 0), "\f4leave:\f7 %s", colorname(d));
removeweapons(d);
removetrackedparticles(d);
removetrackeddynlights(d);
Index: src/fpsgame/game.h
===================================================================
--- src/fpsgame/game.h (revision 6491)
+++ src/fpsgame/game.h (working copy)
@@ -12,7 +12,8 @@
CON_GAMEINFO = 1<<10,
CON_FRAG_SELF = 1<<11,
CON_FRAG_OTHER = 1<<12,
- CON_TEAMKILL = 1<<13
+ CON_TEAMKILL = 1<<13,
+ CON_NONZEN = 1<<14
};
// network quantization scale
Index: src/shared/iengine.h
===================================================================
--- src/shared/iengine.h (revision 6491)
+++ src/shared/iengine.h (working copy)
@@ -201,3 +201,4 @@
+extern int confilter, fullconfilter, miniconfilter;
extern void conoutf(const char *s, ...) PRINTFARGS(1, 2);
extern void conoutf(int type, const char *s, ...) PRINTFARGS(2, 3);