Changeset - r22376:332c148bca52
[Not reviewed]
master
0 7 0
frosch - 9 years ago 2016-05-22 10:07:48
frosch@openttd.org
(svn r27571) -Codechange: Consistent naming for command callbacks which play a sound effect.
7 files changed with 28 insertions and 28 deletions:
0 comments (0 inline, 0 general)
src/command_func.h
Show inline comments
 
@@ -81,7 +81,7 @@ CommandCallback CcBuildBridge;
 

	
 
/* dock_gui.cpp */
 
CommandCallback CcBuildDocks;
 
CommandCallback CcBuildCanal;
 
CommandCallback CcPlaySound_SPLAT_WATER;
 

	
 
/* depot_gui.cpp */
 
CommandCallback CcCloneVehicle;
 
@@ -97,19 +97,19 @@ CommandCallback CcAddVehicleNewGroup;
 
CommandCallback CcBuildIndustry;
 

	
 
/* main_gui.cpp */
 
CommandCallback CcPlaySound10;
 
CommandCallback CcPlaySound_EXPLOSION;
 
CommandCallback CcPlaceSign;
 
CommandCallback CcTerraform;
 
CommandCallback CcGiveMoney;
 

	
 
/* rail_gui.cpp */
 
CommandCallback CcPlaySound1E;
 
CommandCallback CcPlaySound_SPLAT_RAIL;
 
CommandCallback CcRailDepot;
 
CommandCallback CcStation;
 
CommandCallback CcBuildRailTunnel;
 

	
 
/* road_gui.cpp */
 
CommandCallback CcPlaySound1D;
 
CommandCallback CcPlaySound_SPLAT_OTHER;
 
CommandCallback CcBuildRoadTunnel;
 
CommandCallback CcRoadDepot;
 
CommandCallback CcRoadStop;
src/dock_gui.cpp
Show inline comments
 
@@ -48,7 +48,7 @@ void CcBuildDocks(const CommandCost &res
 
	if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace();
 
}
 

	
 
void CcBuildCanal(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2)
 
void CcPlaySound_SPLAT_WATER(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2)
 
{
 
	if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_02_SPLAT_WATER, tile);
 
}
 
@@ -235,10 +235,10 @@ struct BuildDocksToolbarWindow : Window 
 
					GUIPlaceProcDragXY(select_proc, start_tile, end_tile);
 
					break;
 
				case DDSP_CREATE_WATER:
 
					DoCommandP(end_tile, start_tile, (_game_mode == GM_EDITOR && _ctrl_pressed) ? WATER_CLASS_SEA : WATER_CLASS_CANAL, CMD_BUILD_CANAL | CMD_MSG(STR_ERROR_CAN_T_BUILD_CANALS), CcBuildCanal);
 
					DoCommandP(end_tile, start_tile, (_game_mode == GM_EDITOR && _ctrl_pressed) ? WATER_CLASS_SEA : WATER_CLASS_CANAL, CMD_BUILD_CANAL | CMD_MSG(STR_ERROR_CAN_T_BUILD_CANALS), CcPlaySound_SPLAT_WATER);
 
					break;
 
				case DDSP_CREATE_RIVER:
 
					DoCommandP(end_tile, start_tile, WATER_CLASS_RIVER, CMD_BUILD_CANAL | CMD_MSG(STR_ERROR_CAN_T_PLACE_RIVERS), CcBuildCanal);
 
					DoCommandP(end_tile, start_tile, WATER_CLASS_RIVER, CMD_BUILD_CANAL | CMD_MSG(STR_ERROR_CAN_T_PLACE_RIVERS), CcPlaySound_SPLAT_WATER);
 
					break;
 

	
 
				default: break;
src/main_gui.cpp
Show inline comments
 
@@ -118,7 +118,7 @@ bool HandlePlacePushButton(Window *w, in
 
}
 

	
 

	
 
void CcPlaySound10(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2)
 
void CcPlaySound_EXPLOSION(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2)
 
{
 
	if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_12_EXPLOSION, tile);
 
}
src/network/network_command.cpp
Show inline comments
 
@@ -27,7 +27,7 @@ static CommandCallback * const _callback
 
	/* 0x01 */ CcBuildPrimaryVehicle,
 
	/* 0x02 */ CcBuildAirport,
 
	/* 0x03 */ CcBuildBridge,
 
	/* 0x04 */ CcBuildCanal,
 
	/* 0x04 */ CcPlaySound_SPLAT_WATER,
 
	/* 0x05 */ CcBuildDocks,
 
	/* 0x06 */ CcFoundTown,
 
	/* 0x07 */ CcBuildRoadTunnel,
 
@@ -36,9 +36,9 @@ static CommandCallback * const _callback
 
	/* 0x0A */ CcRoadDepot,
 
	/* 0x0B */ CcRailDepot,
 
	/* 0x0C */ CcPlaceSign,
 
	/* 0x0D */ CcPlaySound10,
 
	/* 0x0E */ CcPlaySound1D,
 
	/* 0x0F */ CcPlaySound1E,
 
	/* 0x0D */ CcPlaySound_EXPLOSION,
 
	/* 0x0E */ CcPlaySound_SPLAT_OTHER,
 
	/* 0x0F */ CcPlaySound_SPLAT_RAIL,
 
	/* 0x10 */ CcStation,
 
	/* 0x11 */ CcTerraform,
 
	/* 0x12 */ CcAI,
src/rail_gui.cpp
Show inline comments
 
@@ -86,7 +86,7 @@ static bool IsStationAvailable(const Sta
 
	return Convert8bitBooleanCallback(statspec->grf_prop.grffile, CBID_STATION_AVAILABILITY, cb_res);
 
}
 

	
 
void CcPlaySound1E(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2)
 
void CcPlaySound_SPLAT_RAIL(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2)
 
{
 
	if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_20_SPLAT_RAIL, tile);
 
}
 
@@ -97,7 +97,7 @@ static void GenericPlaceRail(TileIndex t
 
			_remove_button_clicked ?
 
			CMD_REMOVE_SINGLE_RAIL | CMD_MSG(STR_ERROR_CAN_T_REMOVE_RAILROAD_TRACK) :
 
			CMD_BUILD_SINGLE_RAIL | CMD_MSG(STR_ERROR_CAN_T_BUILD_RAILROAD_TRACK),
 
			CcPlaySound1E);
 
			CcPlaySound_SPLAT_RAIL);
 
}
 

	
 
/**
 
@@ -223,7 +223,7 @@ static void GenericPlaceSignals(TileInde
 
	Track track = FindFirstTrack(trackbits);
 

	
 
	if (_remove_button_clicked) {
 
		DoCommandP(tile, track, 0, CMD_REMOVE_SIGNALS | CMD_MSG(STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM), CcPlaySound1E);
 
		DoCommandP(tile, track, 0, CMD_REMOVE_SIGNALS | CMD_MSG(STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM), CcPlaySound_SPLAT_RAIL);
 
	} else {
 
		const Window *w = FindWindowById(WC_BUILD_SIGNAL, 0);
 

	
 
@@ -250,7 +250,7 @@ static void GenericPlaceSignals(TileInde
 

	
 
		DoCommandP(tile, p1, 0, CMD_BUILD_SIGNALS |
 
				CMD_MSG((w != NULL && _convert_signal_button) ? STR_ERROR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE : STR_ERROR_CAN_T_BUILD_SIGNALS_HERE),
 
				CcPlaySound1E);
 
				CcPlaySound_SPLAT_RAIL);
 
	}
 
}
 

	
 
@@ -355,7 +355,7 @@ static void DoRailroadTrack(int mode)
 
			_remove_button_clicked ?
 
			CMD_REMOVE_RAILROAD_TRACK | CMD_MSG(STR_ERROR_CAN_T_REMOVE_RAILROAD_TRACK) :
 
			CMD_BUILD_RAILROAD_TRACK  | CMD_MSG(STR_ERROR_CAN_T_BUILD_RAILROAD_TRACK),
 
			CcPlaySound1E);
 
			CcPlaySound_SPLAT_RAIL);
 
}
 

	
 
static void HandleAutodirPlacement()
 
@@ -410,7 +410,7 @@ static void HandleAutoSignalPlacement()
 
			_remove_button_clicked ?
 
			CMD_REMOVE_SIGNAL_TRACK | CMD_MSG(STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM) :
 
			CMD_BUILD_SIGNAL_TRACK  | CMD_MSG(STR_ERROR_CAN_T_BUILD_SIGNALS_HERE),
 
			CcPlaySound1E);
 
			CcPlaySound_SPLAT_RAIL);
 
}
 

	
 

	
 
@@ -710,7 +710,7 @@ struct BuildRailToolbarWindow : Window {
 
					break;
 

	
 
				case DDSP_CONVERT_RAIL:
 
					DoCommandP(end_tile, start_tile, _cur_railtype | (_ctrl_pressed ? 0x10 : 0), CMD_CONVERT_RAIL | CMD_MSG(STR_ERROR_CAN_T_CONVERT_RAIL), CcPlaySound1E);
 
					DoCommandP(end_tile, start_tile, _cur_railtype | (_ctrl_pressed ? 0x10 : 0), CMD_CONVERT_RAIL | CMD_MSG(STR_ERROR_CAN_T_CONVERT_RAIL), CcPlaySound_SPLAT_RAIL);
 
					break;
 

	
 
				case DDSP_REMOVE_STATION:
 
@@ -718,20 +718,20 @@ struct BuildRailToolbarWindow : Window {
 
					if (this->IsWidgetLowered(WID_RAT_BUILD_STATION)) {
 
						/* Station */
 
						if (_remove_button_clicked) {
 
							DoCommandP(end_tile, start_tile, _ctrl_pressed ? 0 : 1, CMD_REMOVE_FROM_RAIL_STATION | CMD_MSG(STR_ERROR_CAN_T_REMOVE_PART_OF_STATION), CcPlaySound1E);
 
							DoCommandP(end_tile, start_tile, _ctrl_pressed ? 0 : 1, CMD_REMOVE_FROM_RAIL_STATION | CMD_MSG(STR_ERROR_CAN_T_REMOVE_PART_OF_STATION), CcPlaySound_SPLAT_RAIL);
 
						} else {
 
							HandleStationPlacement(start_tile, end_tile);
 
						}
 
					} else {
 
						/* Waypoint */
 
						if (_remove_button_clicked) {
 
							DoCommandP(end_tile, start_tile, _ctrl_pressed ? 0 : 1, CMD_REMOVE_FROM_RAIL_WAYPOINT | CMD_MSG(STR_ERROR_CAN_T_REMOVE_TRAIN_WAYPOINT), CcPlaySound1E);
 
							DoCommandP(end_tile, start_tile, _ctrl_pressed ? 0 : 1, CMD_REMOVE_FROM_RAIL_WAYPOINT | CMD_MSG(STR_ERROR_CAN_T_REMOVE_TRAIN_WAYPOINT), CcPlaySound_SPLAT_RAIL);
 
						} else {
 
							TileArea ta(start_tile, end_tile);
 
							uint32 p1 = _cur_railtype | (select_method == VPM_FIX_X ? AXIS_X : AXIS_Y) << 4 | ta.w << 8 | ta.h << 16 | _ctrl_pressed << 24;
 
							uint32 p2 = STAT_CLASS_WAYP | _cur_waypoint_type << 8 | INVALID_STATION << 16;
 

	
 
							CommandContainer cmdcont = { ta.tile, p1, p2, CMD_BUILD_RAIL_WAYPOINT | CMD_MSG(STR_ERROR_CAN_T_BUILD_TRAIN_WAYPOINT), CcPlaySound1E, "" };
 
							CommandContainer cmdcont = { ta.tile, p1, p2, CMD_BUILD_RAIL_WAYPOINT | CMD_MSG(STR_ERROR_CAN_T_BUILD_TRAIN_WAYPOINT), CcPlaySound_SPLAT_RAIL, "" };
 
							ShowSelectWaypointIfNeeded(cmdcont, ta);
 
						}
 
					}
src/road_gui.cpp
Show inline comments
 
@@ -64,7 +64,7 @@ static RoadType _cur_roadtype;
 
static DiagDirection _road_depot_orientation;
 
static DiagDirection _road_station_picker_orientation;
 

	
 
void CcPlaySound1D(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2)
 
void CcPlaySound_SPLAT_OTHER(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2)
 
{
 
	if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_1F_SPLAT_OTHER, tile);
 
}
 
@@ -629,7 +629,7 @@ struct BuildRoadToolbarWindow : Window {
 
					DoCommandP(start_tile, end_tile, _place_road_flag | (_cur_roadtype << 3) | (_one_way_button_clicked << 5),
 
							_remove_button_clicked ?
 
							CMD_REMOVE_LONG_ROAD | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_road) :
 
							CMD_BUILD_LONG_ROAD | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_road), CcPlaySound1D);
 
							CMD_BUILD_LONG_ROAD | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_road), CcPlaySound_SPLAT_OTHER);
 
					break;
 

	
 
				case DDSP_BUILD_BUSSTOP:
 
@@ -642,13 +642,13 @@ struct BuildRoadToolbarWindow : Window {
 

	
 
				case DDSP_REMOVE_BUSSTOP: {
 
					TileArea ta(start_tile, end_tile);
 
					DoCommandP(ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_BUS, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[ROADSTOP_BUS]), CcPlaySound1D);
 
					DoCommandP(ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_BUS, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[ROADSTOP_BUS]), CcPlaySound_SPLAT_OTHER);
 
					break;
 
				}
 

	
 
				case DDSP_REMOVE_TRUCKSTOP: {
 
					TileArea ta(start_tile, end_tile);
 
					DoCommandP(ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_TRUCK, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[ROADSTOP_TRUCK]), CcPlaySound1D);
 
					DoCommandP(ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_TRUCK, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[ROADSTOP_TRUCK]), CcPlaySound_SPLAT_OTHER);
 
					break;
 
				}
 
			}
src/terraform_gui.cpp
Show inline comments
 
@@ -114,7 +114,7 @@ bool GUIPlaceProcDragXY(ViewportDragDrop
 

	
 
	switch (proc) {
 
		case DDSP_DEMOLISH_AREA:
 
			DoCommandP(end_tile, start_tile, _ctrl_pressed ? 1 : 0, CMD_CLEAR_AREA | CMD_MSG(STR_ERROR_CAN_T_CLEAR_THIS_AREA), CcPlaySound10);
 
			DoCommandP(end_tile, start_tile, _ctrl_pressed ? 1 : 0, CMD_CLEAR_AREA | CMD_MSG(STR_ERROR_CAN_T_CLEAR_THIS_AREA), CcPlaySound_EXPLOSION);
 
			break;
 
		case DDSP_RAISE_AND_LEVEL_AREA:
 
			DoCommandP(end_tile, start_tile, LM_RAISE << 1 | (_ctrl_pressed ? 1 : 0), CMD_LEVEL_LAND | CMD_MSG(STR_ERROR_CAN_T_RAISE_LAND_HERE), CcTerraform);
 
@@ -237,7 +237,7 @@ struct TerraformToolbarWindow : Window {
 
				break;
 

	
 
			case WID_TT_BUY_LAND: // Buy land button
 
				DoCommandP(tile, OBJECT_OWNED_LAND, 0, CMD_BUILD_OBJECT | CMD_MSG(STR_ERROR_CAN_T_PURCHASE_THIS_LAND), CcPlaySound1E);
 
				DoCommandP(tile, OBJECT_OWNED_LAND, 0, CMD_BUILD_OBJECT | CMD_MSG(STR_ERROR_CAN_T_PURCHASE_THIS_LAND), CcPlaySound_SPLAT_RAIL);
 
				break;
 

	
 
			case WID_TT_PLACE_SIGN: // Place sign button
0 comments (0 inline, 0 general)