(svn r14337) -Codechange: use CmdRename* and CMD_RENAME_* for vehicle, president and company renaming commands, too
authorsmatz
Mon, 15 Sep 2008 22:58:41 +0000
changeset 10151 0dd6c35bf0cc
parent 10150 7f5047689c72
child 10152 5faa68713d8c
(svn r14337) -Codechange: use CmdRename* and CMD_RENAME_* for vehicle, president and company renaming commands, too
src/autoreplace_cmd.cpp
src/command.cpp
src/command_type.h
src/misc_cmd.cpp
src/order_cmd.cpp
src/player_gui.cpp
src/players.cpp
src/vehicle.cpp
src/vehicle_gui.cpp
--- a/src/autoreplace_cmd.cpp	Mon Sep 15 22:45:18 2008 +0000
+++ b/src/autoreplace_cmd.cpp	Mon Sep 15 22:58:41 2008 +0000
@@ -313,7 +313,7 @@
 		/* Copy vehicle name */
 		if (old_head->name != NULL) {
 			_cmd_text = old_head->name;
-			DoCommand(0, new_head->index, 0, DC_EXEC | DC_AUTOREPLACE, CMD_NAME_VEHICLE);
+			DoCommand(0, new_head->index, 0, DC_EXEC | DC_AUTOREPLACE, CMD_RENAME_VEHICLE);
 			_cmd_text = NULL;
 		}
 
--- a/src/command.cpp	Mon Sep 15 22:45:18 2008 +0000
+++ b/src/command.cpp	Mon Sep 15 22:58:41 2008 +0000
@@ -113,11 +113,11 @@
 
 DEF_COMMAND(CmdWantEnginePreview);
 
-DEF_COMMAND(CmdNameVehicle);
+DEF_COMMAND(CmdRenameVehicle);
 DEF_COMMAND(CmdRenameEngine);
 
-DEF_COMMAND(CmdChangeCompanyName);
-DEF_COMMAND(CmdChangePresidentName);
+DEF_COMMAND(CmdRenameCompany);
+DEF_COMMAND(CmdRenamePresident);
 
 DEF_COMMAND(CmdRenameStation);
 
@@ -263,11 +263,11 @@
 
 	{CmdWantEnginePreview,                   0}, /* CMD_WANT_ENGINE_PREVIEW */
 
-	{CmdNameVehicle,                         0}, /* CMD_NAME_VEHICLE */
+	{CmdRenameVehicle,                       0}, /* CMD_RENAME_VEHICLE */
 	{CmdRenameEngine,                        0}, /* CMD_RENAME_ENGINE */
 
-	{CmdChangeCompanyName,                   0}, /* CMD_CHANGE_COMPANY_NAME */
-	{CmdChangePresidentName,                 0}, /* CMD_CHANGE_PRESIDENT_NAME */
+	{CmdRenameCompany,                       0}, /* CMD_RENAME_COMPANY */
+	{CmdRenamePresident,                     0}, /* CMD_RENAME_PRESIDENT */
 
 	{CmdRenameStation,                       0}, /* CMD_RENAME_STATION */
 
--- a/src/command_type.h	Mon Sep 15 22:45:18 2008 +0000
+++ b/src/command_type.h	Mon Sep 15 22:58:41 2008 +0000
@@ -209,10 +209,10 @@
 
 	CMD_WANT_ENGINE_PREVIEW,          ///< confirm the preview of an engine
 
-	CMD_NAME_VEHICLE,                 ///< rename a whole vehicle
+	CMD_RENAME_VEHICLE,               ///< rename a whole vehicle
 	CMD_RENAME_ENGINE,                ///< rename a engine (in the engine list)
-	CMD_CHANGE_COMPANY_NAME,          ///< change the company name
-	CMD_CHANGE_PRESIDENT_NAME,        ///< change the president name
+	CMD_RENAME_COMPANY,               ///< change the company name
+	CMD_RENAME_PRESIDENT,             ///< change the president name
 	CMD_RENAME_STATION,               ///< rename a station
 
 	CMD_SELL_AIRCRAFT,                ///< sell an aircraft
--- a/src/misc_cmd.cpp	Mon Sep 15 22:45:18 2008 +0000
+++ b/src/misc_cmd.cpp	Mon Sep 15 22:58:41 2008 +0000
@@ -222,7 +222,7 @@
  * @param p1 unused
  * @param p2 unused
  */
-CommandCost CmdChangeCompanyName(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdRenameCompany(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	bool reset = StrEmpty(_cmd_text);
 
@@ -261,7 +261,7 @@
  * @param p1 unused
  * @param p2 unused
  */
-CommandCost CmdChangePresidentName(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdRenamePresident(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	bool reset = StrEmpty(_cmd_text);
 
@@ -284,7 +284,7 @@
 
 				snprintf(buf, lengthof(buf), "%s Transport", _cmd_text);
 				_cmd_text = buf;
-				DoCommand(0, 0, 0, DC_EXEC, CMD_CHANGE_COMPANY_NAME);
+				DoCommand(0, 0, 0, DC_EXEC, CMD_RENAME_COMPANY);
 			}
 		}
 
--- a/src/order_cmd.cpp	Mon Sep 15 22:45:18 2008 +0000
+++ b/src/order_cmd.cpp	Mon Sep 15 22:58:41 2008 +0000
@@ -1259,7 +1259,7 @@
 	/* If we have a custom name, process that */
 	if (bak->name != NULL) {
 		_cmd_text = bak->name;
-		DoCommandP(0, v->index, 0, NULL, CMD_NAME_VEHICLE);
+		DoCommandP(0, v->index, 0, NULL, CMD_RENAME_VEHICLE);
 	}
 
 	/* If we had shared orders, recover that */
--- a/src/player_gui.cpp	Mon Sep 15 22:45:18 2008 +0000
+++ b/src/player_gui.cpp	Mon Sep 15 22:58:41 2008 +0000
@@ -1335,11 +1335,11 @@
 			default: NOT_REACHED();
 
 			case PCW_WIDGET_PRESIDENT_NAME:
-				DoCommandP(0, 0, 0, NULL, CMD_CHANGE_PRESIDENT_NAME | CMD_MSG(STR_700D_CAN_T_CHANGE_PRESIDENT));
+				DoCommandP(0, 0, 0, NULL, CMD_RENAME_PRESIDENT | CMD_MSG(STR_700D_CAN_T_CHANGE_PRESIDENT));
 				break;
 
 			case PCW_WIDGET_COMPANY_NAME:
-				DoCommandP(0, 0, 0, NULL, CMD_CHANGE_COMPANY_NAME | CMD_MSG(STR_700C_CAN_T_CHANGE_COMPANY_NAME));
+				DoCommandP(0, 0, 0, NULL, CMD_RENAME_COMPANY | CMD_MSG(STR_700C_CAN_T_CHANGE_COMPANY_NAME));
 				break;
 		}
 	}
--- a/src/players.cpp	Mon Sep 15 22:45:18 2008 +0000
+++ b/src/players.cpp	Mon Sep 15 22:58:41 2008 +0000
@@ -880,7 +880,7 @@
 				 * For example in network_client.c:534? */
 				_cmd_text = ci->client_name;
 				_local_player = ci->client_playas;
-				NetworkSend_Command(0, 0, 0, CMD_CHANGE_PRESIDENT_NAME, NULL);
+				NetworkSend_Command(0, 0, 0, CMD_RENAME_PRESIDENT, NULL);
 				_local_player = player_backup;
 			}
 		}
--- a/src/vehicle.cpp	Mon Sep 15 22:45:18 2008 +0000
+++ b/src/vehicle.cpp	Mon Sep 15 22:58:41 2008 +0000
@@ -1677,7 +1677,7 @@
  * @param p1 vehicle ID to name
  * @param p2 unused
  */
-CommandCost CmdNameVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdRenameVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	if (!IsValidVehicleID(p1)) return CMD_ERROR;
 
--- a/src/vehicle_gui.cpp	Mon Sep 15 22:45:18 2008 +0000
+++ b/src/vehicle_gui.cpp	Mon Sep 15 22:58:41 2008 +0000
@@ -1516,7 +1516,7 @@
 		if (str == NULL) return;
 
 		_cmd_text = str;
-		DoCommandP(0, this->window_number, 0, NULL, CMD_NAME_VEHICLE | CMD_MSG(_name_vehicle_error[GetVehicle(this->window_number)->type]));
+		DoCommandP(0, this->window_number, 0, NULL, CMD_RENAME_VEHICLE | CMD_MSG(_name_vehicle_error[GetVehicle(this->window_number)->type]));
 	}
 
 	virtual void OnResize(Point new_size, Point delta)