src/console.cpp
branchNewGRF_ports
changeset 6871 5a9dc001e1ad
parent 6743 cabfaa4a0295
child 6872 1c4a4a609f85
equal deleted inserted replaced
6870:ca3fd1fbe311 6871:5a9dc001e1ad
    86 			}
    86 			}
    87 
    87 
    88 			DoDrawString(_iconsole_cmdline.buf, 10 + delta, w->height - ICON_LINE_HEIGHT, _icolour_cmd);
    88 			DoDrawString(_iconsole_cmdline.buf, 10 + delta, w->height - ICON_LINE_HEIGHT, _icolour_cmd);
    89 
    89 
    90 			if (_iconsole_cmdline.caret)
    90 			if (_iconsole_cmdline.caret)
    91 				DoDrawString("_", 10 + delta + _iconsole_cmdline.caretxoffs, w->height - ICON_LINE_HEIGHT, 12);
    91 				DoDrawString("_", 10 + delta + _iconsole_cmdline.caretxoffs, w->height - ICON_LINE_HEIGHT, TC_WHITE);
    92 			break;
    92 			break;
    93 		}
    93 		}
    94 		case WE_MOUSELOOP:
    94 		case WE_MOUSELOOP:
    95 			if (HandleCaret(&_iconsole_cmdline))
    95 			if (HandleCaret(&_iconsole_cmdline))
    96 				SetWindowDirty(w);
    96 				SetWindowDirty(w);
   213 	_iconsole_output_file = NULL;
   213 	_iconsole_output_file = NULL;
   214 	_icolour_def  =  1;
   214 	_icolour_def  =  1;
   215 	_icolour_err  =  3;
   215 	_icolour_err  =  3;
   216 	_icolour_warn = 13;
   216 	_icolour_warn = 13;
   217 	_icolour_dbg  =  5;
   217 	_icolour_dbg  =  5;
   218 	_icolour_cmd  =  2;
   218 	_icolour_cmd  = TC_GOLD;
   219 	_iconsole_historypos = ICON_HISTORY_SIZE - 1;
   219 	_iconsole_historypos = ICON_HISTORY_SIZE - 1;
   220 	_iconsole_mode = ICONSOLE_CLOSED;
   220 	_iconsole_mode = ICONSOLE_CLOSED;
   221 
   221 
   222 #ifdef ENABLE_NETWORK /* Initialize network only variables */
   222 #ifdef ENABLE_NETWORK /* Initialize network only variables */
   223 	_redirect_console_to_client = 0;
   223 	_redirect_console_to_client = 0;
   303 		case ICONSOLE_CLOSED: {
   303 		case ICONSOLE_CLOSED: {
   304 			Window *w = AllocateWindowDesc(&_iconsole_window_desc);
   304 			Window *w = AllocateWindowDesc(&_iconsole_window_desc);
   305 			w->height = _screen.height / 3;
   305 			w->height = _screen.height / 3;
   306 			w->width = _screen.width;
   306 			w->width = _screen.width;
   307 			_iconsole_mode = ICONSOLE_OPENED;
   307 			_iconsole_mode = ICONSOLE_OPENED;
   308 			SETBIT(_no_scroll, SCROLL_CON); // override cursor arrows; the gamefield will not scroll
   308 			SetBit(_no_scroll, SCROLL_CON); // override cursor arrows; the gamefield will not scroll
   309 		} break;
   309 		} break;
   310 		case ICONSOLE_OPENED: case ICONSOLE_FULL:
   310 		case ICONSOLE_OPENED: case ICONSOLE_FULL:
   311 			DeleteWindowById(WC_CONSOLE, 0);
   311 			DeleteWindowById(WC_CONSOLE, 0);
   312 			_iconsole_mode = ICONSOLE_CLOSED;
   312 			_iconsole_mode = ICONSOLE_CLOSED;
   313 			CLRBIT(_no_scroll, SCROLL_CON);
   313 			ClrBit(_no_scroll, SCROLL_CON);
   314 			break;
   314 			break;
   315 	}
   315 	}
   316 
   316 
   317 	MarkWholeScreenDirty();
   317 	MarkWholeScreenDirty();
   318 }
   318 }
   354 	}
   354 	}
   355 
   355 
   356 	_iconsole_historypos = i;
   356 	_iconsole_historypos = i;
   357 	IConsoleClearCommand();
   357 	IConsoleClearCommand();
   358 	/* copy history to 'command prompt / bash' */
   358 	/* copy history to 'command prompt / bash' */
   359 	assert(_iconsole_history[i] != NULL && IS_INT_INSIDE(i, 0, ICON_HISTORY_SIZE));
   359 	assert(_iconsole_history[i] != NULL && IsInsideMM(i, 0, ICON_HISTORY_SIZE));
   360 	ttd_strlcpy(_iconsole_cmdline.buf, _iconsole_history[i], _iconsole_cmdline.maxlength);
   360 	ttd_strlcpy(_iconsole_cmdline.buf, _iconsole_history[i], _iconsole_cmdline.maxlength);
   361 	UpdateTextBufferSize(&_iconsole_cmdline);
   361 	UpdateTextBufferSize(&_iconsole_cmdline);
   362 }
   362 }
   363 
   363 
   364 /**
   364 /**