console_cmds.c
changeset 3647 d7a1dbe385d8
parent 3621 5d2e486e7a8b
child 3818 4683949ba485
equal deleted inserted replaced
3646:291be46d399e 3647:d7a1dbe385d8
    90 static void IConsoleHelp(const char *str)
    90 static void IConsoleHelp(const char *str)
    91 {
    91 {
    92 	IConsolePrintF(_icolour_warn, "- %s", str);
    92 	IConsolePrintF(_icolour_warn, "- %s", str);
    93 }
    93 }
    94 
    94 
       
    95 DEF_CONSOLE_CMD(ConResetEngines)
       
    96 {
       
    97 	if (argc == 0) {
       
    98 		IConsoleHelp("Reset status data of all engines. This might solve some issues with 'lost' engines. Usage: 'resetengines'");
       
    99 		return true;
       
   100 	}
       
   101 
       
   102 	StartupEngines();
       
   103 	return true;
       
   104 }
       
   105 
       
   106 #ifdef _DEBUG
       
   107 DEF_CONSOLE_CMD(ConResetTile)
       
   108 {
       
   109 	if (argc == 0) {
       
   110 		IConsoleHelp("Reset a tile to bare land. Usage: 'resettile <tile>'");
       
   111 		IConsoleHelp("Tile can be either decimal (34161) or hexadecimal (0x4a5B)");
       
   112 		return true;
       
   113 	}
       
   114 
       
   115 	if (argc == 2) {
       
   116 		uint32 result;
       
   117 		if (GetArgumentInteger(&result, argv[1])) {
       
   118 			DoClearSquare((TileIndex)result);
       
   119 			return true;
       
   120 		}
       
   121 	}
       
   122 
       
   123 	return false;
       
   124 }
       
   125 
    95 DEF_CONSOLE_CMD(ConStopAllVehicles)
   126 DEF_CONSOLE_CMD(ConStopAllVehicles)
    96 {
   127 {
    97 	Vehicle* v;
   128 	Vehicle* v;
    98 	if (argc == 0) {
   129 	if (argc == 0) {
    99 		IConsoleHelp("Stops all vehicles in the game. For debugging only! Use at your own risk... Usage: 'stopall'");
   130 		IConsoleHelp("Stops all vehicles in the game. For debugging only! Use at your own risk... Usage: 'stopall'");
   110 			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
   141 			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
   111 			InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
   142 			InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
   112 		}
   143 		}
   113 	}
   144 	}
   114 	return true;
   145 	return true;
   115 }
       
   116 
       
   117 DEF_CONSOLE_CMD(ConResetEngines)
       
   118 {
       
   119 	if (argc == 0) {
       
   120 		IConsoleHelp("Reset status data of all engines. This might solve some issues with 'lost' engines. Usage: 'resetengines'");
       
   121 		return true;
       
   122 	}
       
   123 
       
   124 	StartupEngines();
       
   125 	return true;
       
   126 }
       
   127 
       
   128 #ifdef _DEBUG
       
   129 DEF_CONSOLE_CMD(ConResetTile)
       
   130 {
       
   131 	if (argc == 0) {
       
   132 		IConsoleHelp("Reset a tile to bare land. Usage: 'resettile <tile>'");
       
   133 		IConsoleHelp("Tile can be either decimal (34161) or hexadecimal (0x4a5B)");
       
   134 		return true;
       
   135 	}
       
   136 
       
   137 	if (argc == 2) {
       
   138 		uint32 result;
       
   139 		if (GetArgumentInteger(&result, argv[1])) {
       
   140 			DoClearSquare((TileIndex)result);
       
   141 			return true;
       
   142 		}
       
   143 	}
       
   144 
       
   145 	return false;
       
   146 }
   146 }
   147 #endif /* _DEBUG */
   147 #endif /* _DEBUG */
   148 
   148 
   149 DEF_CONSOLE_CMD(ConScrollToTile)
   149 DEF_CONSOLE_CMD(ConScrollToTile)
   150 {
   150 {