OpenTTD Source
20241121-master-g67a0fccfad
|
Command definitions related to engines. More...
#include "command_type.h"
Go to the source code of this file.
Functions | |
CommandCost | CmdWantEnginePreview (DoCommandFlag flags, EngineID engine_id) |
Accept an engine prototype. More... | |
CommandCost | CmdEngineCtrl (DoCommandFlag flags, EngineID engine_id, CompanyID company_id, bool allow) |
Allow or forbid a specific company to use an engine. More... | |
CommandCost | CmdRenameEngine (DoCommandFlag flags, EngineID engine_id, const std::string &text) |
Rename an engine. More... | |
CommandCost | CmdSetVehicleVisibility (DoCommandFlag flags, EngineID engine_id, bool hide) |
Set the visibility of an engine. More... | |
Command definitions related to engines.
Definition in file engine_cmd.h.
CommandCost CmdEngineCtrl | ( | DoCommandFlag | flags, |
EngineID | engine_id, | ||
CompanyID | company_id, | ||
bool | allow | ||
) |
Allow or forbid a specific company to use an engine.
flags | operation to perform |
engine_id | engine id |
company_id | Company to allow/forbid the use of an engine. |
allow | false to forbid, true to allow. |
Definition at line 1022 of file engine.cpp.
References _current_company, CMD_ERROR, DC_EXEC, DisableEngineForCompany(), EnableEngineForCompany(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::IsValidID(), and OWNER_DEITY.
CommandCost CmdRenameEngine | ( | DoCommandFlag | flags, |
EngineID | engine_id, | ||
const std::string & | text | ||
) |
Rename an engine.
flags | operation to perform |
engine_id | engine ID to rename |
text | the new name or an empty string when resetting to the default |
Definition at line 1184 of file engine.cpp.
References CMD_ERROR, DC_EXEC, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::GetIfValid(), IsUniqueEngineName(), MarkWholeScreenDirty(), MAX_LENGTH_ENGINE_NAME_CHARS, Engine::name, return_cmd_error, and Utf8StringLength().
CommandCost CmdSetVehicleVisibility | ( | DoCommandFlag | flags, |
EngineID | engine_id, | ||
bool | hide | ||
) |
Set the visibility of an engine.
flags | Operation to perform. |
engine_id | Engine id.. |
hide | Set for hidden, unset for visible. |
Definition at line 983 of file engine.cpp.
References _current_company, AddRemoveEngineFromAutoreplaceAndBuildWindows(), AssignBit(), CMD_ERROR, Engine::company_hidden, DC_EXEC, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::GetIfValid(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, IsEngineBuildable(), MAX_COMPANIES, and Engine::type.
CommandCost CmdWantEnginePreview | ( | DoCommandFlag | flags, |
EngineID | engine_id | ||
) |
Accept an engine prototype.
XXX - it is possible that the top-company changes while you are waiting to accept the offer? Then it becomes invalid
flags | operation to perform |
engine_id | engine-prototype offered |
Definition at line 1004 of file engine.cpp.
References _current_company, AcceptEnginePreview(), CMD_ERROR, DC_EXEC, ENGINE_EXCLUSIVE_PREVIEW, Engine::flags, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::GetIfValid(), and Engine::preview_company.