Cube  Diff

Differences From Artifact [73f6aa3e13]:

To Artifact [e0a1b6879f]:


177
178
179
180
181
182
183
184

185

186

187
188

189
190
191
192
193
194
195
177
178
179
180
181
182
183

184
185
186

187


188
189
190
191
192
193
194
195







-
+

+
-
+
-
-
+







		execute(vhistory[vhistory.count - n - 1]);
		rec = false;
	}
}
COMMAND(history, ARG_1INT)

void
keypress(int code, bool isdown, int cooked)
keypress(int code, bool isDown)
{
	// keystrokes go to commandline
	if (saycommandon) // keystrokes go to commandline
	if (saycommandon) {
	{
		if (isdown) {
		if (isDown) {
			switch (code) {
			case SDLK_RETURN:
				break;

			case SDLK_BACKSPACE:
			case SDLK_LEFT:
				if (commandbuf.length > 0)
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
222
223
224
225
226
227
228


229
230
231
232
233
234
235







-
-







				    (KMOD_LCTRL | KMOD_RCTRL)) {
					pasteconsole();
					return;
				}

			default:
				resetcomplete();
				if (cooked)
					[commandbuf appendFormat:@"%c", cooked];
			}
		} else {
			if (code == SDLK_RETURN) {
				if (commandbuf.length > 0) {
					@autoreleasepool {
						if (vhistory == nil)
							vhistory =
255
256
257
258
259
260
261
262

263
264
265
266
267
268
269

270
271
272
273
274







275
276
277
278
279
280
281
253
254
255
256
257
258
259

260
261
262
263
264
265
266

267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286







-
+






-
+





+
+
+
+
+
+
+







						toserver(commandbuf);
				}
				saycommand(NULL);
			} else if (code == SDLK_ESCAPE) {
				saycommand(NULL);
			}
		}
	} else if (!menukey(code, isdown)) {
	} else if (!menukey(code, isDown)) {
		// keystrokes go to menu

		for (KeyMapping *mapping in keyMappings) {
			if (mapping.code == code) {
				// keystrokes go to game, lookup in keymap and
				// execute
				execute(mapping.action, isdown);
				execute(mapping.action, isDown);
				return;
			}
		}
	}
}

void
input(OFString *text)
{
	if (saycommandon)
		[commandbuf appendString:text];
}

OFString *
getcurcommand()
{
	return saycommandon ? commandbuf : NULL;
}