OpenTTD Source 20250312-master-gcdcc6b491d
|
Command definitions related to engines. More...
#include "command_type.h"
Go to the source code of this file.
Functions | |
CommandCost | CmdWantEnginePreview (DoCommandFlags flags, EngineID engine_id) |
Accept an engine prototype. | |
CommandCost | CmdEngineCtrl (DoCommandFlags flags, EngineID engine_id, CompanyID company_id, bool allow) |
Allow or forbid a specific company to use an engine. | |
CommandCost | CmdRenameEngine (DoCommandFlags flags, EngineID engine_id, const std::string &text) |
Rename an engine. | |
CommandCost | CmdSetVehicleVisibility (DoCommandFlags flags, EngineID engine_id, bool hide) |
Set the visibility of an engine. | |
Command definitions related to engines.
Definition in file engine_cmd.h.
CommandCost CmdEngineCtrl | ( | DoCommandFlags | 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 1058 of file engine.cpp.
References _current_company, CMD_ERROR, DisableEngineForCompany(), EnableEngineForCompany(), Execute, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_engine_pool >::IsValidID(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::IsValidID(), OWNER_DEITY, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().
CommandCost CmdRenameEngine | ( | DoCommandFlags | 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 1221 of file engine.cpp.
References CMD_ERROR, Execute, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_engine_pool >::GetIfValid(), IsUniqueEngineName(), MarkWholeScreenDirty(), MAX_LENGTH_ENGINE_NAME_CHARS, Engine::name, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), and Utf8StringLength().
CommandCost CmdSetVehicleVisibility | ( | DoCommandFlags | 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 1019 of file engine.cpp.
References _current_company, AddRemoveEngineFromAutoreplaceAndBuildWindows(), CMD_ERROR, Engine::company_hidden, Execute, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_engine_pool >::GetIfValid(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index, IsEngineBuildable(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), and Engine::type.
CommandCost CmdWantEnginePreview | ( | DoCommandFlags | 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 1040 of file engine.cpp.
References _current_company, AcceptEnginePreview(), CMD_ERROR, ExclusivePreview, Execute, Engine::flags, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_engine_pool >::GetIfValid(), Engine::preview_company, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().