Changeset - r26096:cbf789e6763e
[Not reviewed]
master
0 21 3
Michael Lutz - 3 years ago 2021-10-10 00:35:06
michi@icosahedron.de
Codechange: Move command callback declarations to the cmd header files.
24 files changed with 110 insertions and 56 deletions:
0 comments (0 inline, 0 general)
src/CMakeLists.txt
Show inline comments
 
@@ -42,6 +42,7 @@ add_files(
 
    aircraft_gui.cpp
 
    airport.cpp
 
    airport.h
 
    airport_cmd.h
 
    airport_gui.cpp
 
    animated_tile.cpp
 
    animated_tile_func.h
 
@@ -131,6 +132,7 @@ add_files(
 
    direction_type.h
 
    disaster_vehicle.cpp
 
    disaster_vehicle.h
 
    dock_cmd.h
 
    dock_gui.cpp
 
    driver.cpp
 
    driver.h
src/airport_cmd.h
Show inline comments
 
new file 100644
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file airport_cmd.h Command definitions related to airports. */
 

	
 
#ifndef AIRPORT_CMD_H
 
#define AIRPORT_CMD_H
 

	
 
#include "command_type.h"
 

	
 
CommandCallback CcBuildAirport;
 

	
 
#endif /* AIRPORT_CMD_H */
src/airport_gui.cpp
Show inline comments
 
@@ -26,6 +26,7 @@
 
#include "hotkeys.h"
 
#include "vehicle_func.h"
 
#include "gui.h"
 
#include "airport_cmd.h"
 

	
 
#include "widgets/airport_widget.h"
 

	
src/build_vehicle_gui.cpp
Show inline comments
 
@@ -30,6 +30,8 @@
 
#include "cargotype.h"
 
#include "core/geometry_func.hpp"
 
#include "autoreplace_func.h"
 
#include "train_cmd.h"
 
#include "vehicle_cmd.h"
 

	
 
#include "widgets/build_vehicle_widget.h"
 

	
src/command_func.h
Show inline comments
 
@@ -67,60 +67,4 @@ static inline DoCommandFlag CommandFlags
 
	return flags;
 
}
 

	
 
/*** All command callbacks that exist ***/
 

	
 
/* ai/ai_instance.cpp */
 
CommandCallback CcAI;
 

	
 
/* airport_gui.cpp */
 
CommandCallback CcBuildAirport;
 

	
 
/* bridge_gui.cpp */
 
CommandCallback CcBuildBridge;
 

	
 
/* dock_gui.cpp */
 
CommandCallback CcBuildDocks;
 
CommandCallback CcPlaySound_CONSTRUCTION_WATER;
 

	
 
/* depot_gui.cpp */
 
CommandCallback CcCloneVehicle;
 

	
 
/* game/game_instance.cpp */
 
CommandCallback CcGame;
 

	
 
/* group_gui.cpp */
 
CommandCallback CcCreateGroup;
 
CommandCallback CcAddVehicleNewGroup;
 

	
 
/* industry_gui.cpp */
 
CommandCallback CcBuildIndustry;
 

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

	
 
/* rail_gui.cpp */
 
CommandCallback CcPlaySound_CONSTRUCTION_RAIL;
 
CommandCallback CcRailDepot;
 
CommandCallback CcStation;
 
CommandCallback CcBuildRailTunnel;
 

	
 
/* road_gui.cpp */
 
CommandCallback CcPlaySound_CONSTRUCTION_OTHER;
 
CommandCallback CcBuildRoadTunnel;
 
CommandCallback CcRoadDepot;
 
CommandCallback CcRoadStop;
 

	
 
/* train_gui.cpp */
 
CommandCallback CcBuildWagon;
 

	
 
/* town_gui.cpp */
 
CommandCallback CcFoundTown;
 
CommandCallback CcFoundRandomTown;
 

	
 
/* vehicle_gui.cpp */
 
CommandCallback CcBuildPrimaryVehicle;
 
CommandCallback CcStartStopVehicle;
 

	
 
#endif /* COMMAND_FUNC_H */
src/depot_cmd.h
Show inline comments
 
@@ -16,4 +16,6 @@ CommandProc CmdRenameDepot;
 

	
 
DEF_CMD_TRAIT(CMD_RENAME_DEPOT, CmdRenameDepot, 0, CMDT_OTHER_MANAGEMENT)
 

	
 
CommandCallback CcCloneVehicle;
 

	
 
#endif /* DEPOT_CMD_H */
src/dock_cmd.h
Show inline comments
 
new file 100644
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file dock_cmd.h Command definitions related to docks. */
 

	
 
#ifndef DOCK_CMD_H
 
#define DOCK_CMD_H
 

	
 
#include "command_type.h"
 

	
 
CommandCallback CcBuildDocks;
 
CommandCallback CcPlaySound_CONSTRUCTION_WATER;
 

	
 
#endif /* DOCK_CMD_H */
src/dock_gui.cpp
Show inline comments
 
@@ -25,6 +25,8 @@
 
#include "hotkeys.h"
 
#include "gui.h"
 
#include "zoom_func.h"
 
#include "tunnelbridge_cmd.h"
 
#include "dock_cmd.h"
 

	
 
#include "widgets/dock_widget.h"
 

	
src/group_cmd.h
Show inline comments
 
@@ -30,4 +30,7 @@ DEF_CMD_TRAIT(CMD_REMOVE_ALL_VEHICLES_GR
 
DEF_CMD_TRAIT(CMD_SET_GROUP_FLAG,            CmdSetGroupFlag,           0, CMDT_ROUTE_MANAGEMENT)
 
DEF_CMD_TRAIT(CMD_SET_GROUP_LIVERY,          CmdSetGroupLivery,         0, CMDT_ROUTE_MANAGEMENT)
 

	
 
CommandCallback CcCreateGroup;
 
CommandCallback CcAddVehicleNewGroup;
 

	
 
#endif /* GROUP_CMD_H */
src/group_gui.cpp
Show inline comments
 
@@ -25,6 +25,7 @@
 
#include "company_base.h"
 
#include "company_gui.h"
 
#include "gui.h"
 
#include "group_cmd.h"
 

	
 
#include "widgets/group_widget.h"
 

	
src/industry_cmd.h
Show inline comments
 
@@ -18,4 +18,6 @@ CommandProc CmdIndustryCtrl;
 
DEF_CMD_TRAIT(CMD_BUILD_INDUSTRY, CmdBuildIndustry, CMD_DEITY,                CMDT_LANDSCAPE_CONSTRUCTION)
 
DEF_CMD_TRAIT(CMD_INDUSTRY_CTRL,  CmdIndustryCtrl,  CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT)
 

	
 
CommandCallback CcBuildIndustry;
 

	
 
#endif /* INDUSTRY_CMD_H */
src/network/network_command.cpp
Show inline comments
 
@@ -14,6 +14,19 @@
 
#include "../command_func.h"
 
#include "../company_func.h"
 
#include "../settings_type.h"
 
#include "../airport_cmd.h"
 
#include "../depot_cmd.h"
 
#include "../dock_cmd.h"
 
#include "../group_cmd.h"
 
#include "../industry_cmd.h"
 
#include "../rail_cmd.h"
 
#include "../road_cmd.h"
 
#include "../terraform_cmd.h"
 
#include "../town_cmd.h"
 
#include "../train_cmd.h"
 
#include "../tunnelbridge_cmd.h"
 
#include "../vehicle_cmd.h"
 
#include "../script/script_cmd.h"
 

	
 
#include "../safeguards.h"
 

	
src/object_gui.cpp
Show inline comments
 
@@ -24,6 +24,7 @@
 
#include "window_gui.h"
 
#include "window_func.h"
 
#include "zoom_func.h"
 
#include "terraform_cmd.h"
 

	
 
#include "widgets/object_widget.h"
 

	
src/rail_cmd.h
Show inline comments
 
@@ -34,4 +34,9 @@ DEF_CMD_TRAIT(CMD_CONVERT_RAIL,         
 
DEF_CMD_TRAIT(CMD_BUILD_SIGNAL_TRACK,    CmdBuildSignalTrack,    CMD_AUTO,                CMDT_LANDSCAPE_CONSTRUCTION)
 
DEF_CMD_TRAIT(CMD_REMOVE_SIGNAL_TRACK,   CmdRemoveSignalTrack,   CMD_AUTO,                CMDT_LANDSCAPE_CONSTRUCTION)
 

	
 
CommandCallback CcPlaySound_CONSTRUCTION_RAIL;
 
CommandCallback CcRailDepot;
 
CommandCallback CcStation;
 
CommandCallback CcBuildRailTunnel;
 

	
 
#endif /* RAIL_CMD_H */
src/road_cmd.h
Show inline comments
 
@@ -29,4 +29,9 @@ DEF_CMD_TRAIT(CMD_BUILD_ROAD,       CmdB
 
DEF_CMD_TRAIT(CMD_BUILD_ROAD_DEPOT, CmdBuildRoadDepot, CMD_AUTO | CMD_NO_WATER,             CMDT_LANDSCAPE_CONSTRUCTION)
 
DEF_CMD_TRAIT(CMD_CONVERT_ROAD,     CmdConvertRoad,    0,                                   CMDT_LANDSCAPE_CONSTRUCTION)
 

	
 
CommandCallback CcPlaySound_CONSTRUCTION_OTHER;
 
CommandCallback CcBuildRoadTunnel;
 
CommandCallback CcRoadDepot;
 
CommandCallback CcRoadStop;
 

	
 
#endif /* ROAD_CMD_H */
src/script/CMakeLists.txt
Show inline comments
 
@@ -5,6 +5,7 @@ if(OPTION_TOOLS_ONLY)
 
endif()
 

	
 
add_files(
 
    script_cmd.h
 
    script_config.cpp
 
    script_config.hpp
 
    script_fatalerror.hpp
src/script/script_cmd.h
Show inline comments
 
new file 100644
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file script_cmd.h Command definitions related to scripts. */
 

	
 
#ifndef SCRIPT_CMD_H
 
#define SCRIPT_CMD_H
 

	
 
#include "../command_type.h"
 

	
 
CommandCallback CcAI;
 
CommandCallback CcGame;
 

	
 
#endif /* SCRIPT_CMD_H */
src/terraform_cmd.h
Show inline comments
 
@@ -18,4 +18,8 @@ CommandProc CmdLevelLand;
 
DEF_CMD_TRAIT(CMD_TERRAFORM_LAND, CmdTerraformLand, CMD_ALL_TILES | CMD_AUTO,               CMDT_LANDSCAPE_CONSTRUCTION)
 
DEF_CMD_TRAIT(CMD_LEVEL_LAND,     CmdLevelLand,     CMD_ALL_TILES | CMD_AUTO | CMD_NO_TEST, CMDT_LANDSCAPE_CONSTRUCTION) // test run might clear tiles multiple times, in execution that only happens once
 

	
 
CommandCallback CcPlaySound_EXPLOSION;
 
CommandCallback CcPlaceSign;
 
CommandCallback CcTerraform;
 

	
 
#endif /* TERRAFORM_CMD_H */
src/terraform_gui.cpp
Show inline comments
 
@@ -31,7 +31,9 @@
 
#include "hotkeys.h"
 
#include "engine_base.h"
 
#include "terraform_gui.h"
 
#include "terraform_cmd.h"
 
#include "zoom_func.h"
 
#include "rail_cmd.h"
 

	
 
#include "widgets/terraform_widget.h"
 

	
src/town_cmd.h
Show inline comments
 
@@ -32,4 +32,7 @@ DEF_CMD_TRAIT(CMD_TOWN_SET_TEXT,    CmdT
 
DEF_CMD_TRAIT(CMD_EXPAND_TOWN,      CmdExpandTown,     CMD_DEITY,                CMDT_LANDSCAPE_CONSTRUCTION)
 
DEF_CMD_TRAIT(CMD_DELETE_TOWN,      CmdDeleteTown,     CMD_OFFLINE,              CMDT_LANDSCAPE_CONSTRUCTION)
 

	
 
CommandCallback CcFoundTown;
 
CommandCallback CcFoundRandomTown;
 

	
 
#endif /* TOWN_CMD_H */
src/train_cmd.h
Show inline comments
 
@@ -25,4 +25,6 @@ DEF_CMD_TRAIT(CMD_MOVE_RAIL_VEHICLE,    
 
DEF_CMD_TRAIT(CMD_FORCE_TRAIN_PROCEED,     CmdForceTrainProceed,     0, CMDT_VEHICLE_MANAGEMENT)
 
DEF_CMD_TRAIT(CMD_REVERSE_TRAIN_DIRECTION, CmdReverseTrainDirection, 0, CMDT_VEHICLE_MANAGEMENT)
 

	
 
CommandCallback CcBuildWagon;
 

	
 
#endif /* TRAIN_CMD_H */
src/tunnelbridge_cmd.h
Show inline comments
 
@@ -18,4 +18,6 @@ CommandProc CmdBuildTunnel;
 
DEF_CMD_TRAIT(CMD_BUILD_BRIDGE, CmdBuildBridge, CMD_DEITY | CMD_AUTO | CMD_NO_WATER, CMDT_LANDSCAPE_CONSTRUCTION)
 
DEF_CMD_TRAIT(CMD_BUILD_TUNNEL, CmdBuildTunnel, CMD_DEITY | CMD_AUTO,                CMDT_LANDSCAPE_CONSTRUCTION)
 

	
 
CommandCallback CcBuildBridge;
 

	
 
#endif /* TUNNELBRIDGE_CMD_H */
src/vehicle_cmd.h
Show inline comments
 
@@ -36,4 +36,7 @@ DEF_CMD_TRAIT(CMD_MASS_START_STOP,      
 
DEF_CMD_TRAIT(CMD_DEPOT_SELL_ALL_VEHICLES, CmdDepotSellAllVehicles, 0,             CMDT_VEHICLE_CONSTRUCTION)
 
DEF_CMD_TRAIT(CMD_DEPOT_MASS_AUTOREPLACE,  CmdDepotMassAutoReplace, 0,             CMDT_VEHICLE_CONSTRUCTION)
 

	
 
CommandCallback CcBuildPrimaryVehicle;
 
CommandCallback CcStartStopVehicle;
 

	
 
#endif /* VEHICLE_CMD_H */
src/vehicle_gui.cpp
Show inline comments
 
@@ -36,6 +36,7 @@
 
#include "station_base.h"
 
#include "tilehighlight_func.h"
 
#include "zoom_func.h"
 
#include "depot_cmd.h"
 

	
 
#include "safeguards.h"
 

	
0 comments (0 inline, 0 general)