Cube  Diff

Differences From Artifact [74e953a174]:

To Artifact [e55e1dd6f3]:


18
19
20
21
22
23
24
25
26
27


28
29
30
31
32
33
34
18
19
20
21
22
23
24



25
26
27
28
29
30
31
32
33







-
-
-
+
+








void
setconskip(int n)
{
	conskip += n;
	if (conskip < 0)
		conskip = 0;
};

COMMANDN(conskip, setconskip, ARG_1INT);
}
COMMANDN(conskip, setconskip, ARG_1INT)

void
conline(const char *sf, bool highlight) // add a line to the console buffer
{
	cline cl;
	cl.cref = conlines.length() > 100
	              ? conlines.pop().cref
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
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







-
-
-
+
+












-
-
-
+
+
















-
-
-
-
+
+
+
+








void
keymap(char *code, char *key, char *action)
{
	keyms[numkm].code = atoi(code);
	keyms[numkm].name = newstring(key);
	keyms[numkm++].action = newstringbuf(action);
};

COMMAND(keymap, ARG_3STR);
}
COMMAND(keymap, ARG_3STR)

void
bindkey(char *key, char *action)
{
	for (char *x = key; *x; x++)
		*x = toupper(*x);
	loopi(numkm) if (strcmp(keyms[i].name, key) == 0)
	{
		strcpy_s(keyms[i].action, action);
		return;
	};
	conoutf(@"unknown key \"%s\"", key);
};

COMMANDN(bind, bindkey, ARG_2STR);
}
COMMANDN(bind, bindkey, ARG_2STR)

void
saycommand(char *init) // turns input to the command line on or off
{
	SDL_EnableUNICODE(saycommandon = (init != NULL));
	if (!editmode)
		keyrepeat(saycommandon);
	if (!init)
		init = "";
	strcpy_s(commandbuf, init);
};

void
mapmsg(char *s)
{
	strn0cpy(hdr.maptitle, s, 128);
};

COMMAND(saycommand, ARG_VARI);
COMMAND(mapmsg, ARG_1STR);
}

COMMAND(saycommand, ARG_VARI)
COMMAND(mapmsg, ARG_1CSTR)

#ifndef _WIN32
# include <SDL_syswm.h>
# include <X11/Xlib.h>
#endif

void
194
195
196
197
198
199
200
201
202
203


204
205
206
207
208
209
210
191
192
193
194
195
196
197



198
199
200
201
202
203
204
205
206







-
-
-
+
+







{
	static bool rec = false;
	if (!rec && n >= 0 && n < vhistory.length()) {
		rec = true;
		execute(vhistory[vhistory.length() - n - 1]);
		rec = false;
	};
};

COMMAND(history, ARG_1INT);
}
COMMAND(history, ARG_1INT)

void
keypress(int code, bool isdown, int cooked)
{
	if (saycommandon) // keystrokes go to commandline
	{
		if (isdown) {