OpenTTD Source 20260531-master-g0e951f3528
depot_cmd.h File Reference

Command definitions related to depots. More...

#include "command_type.h"
#include "depot_type.h"
#include "vehicle_type.h"

Go to the source code of this file.

Functions

CommandCost CmdRenameDepot (DoCommandFlags flags, DepotID depot_id, const std::string &text)
 Rename a depot.
void CcCloneVehicle (Commands, const CommandCost &result, VehicleID veh_id)
 This is the Callback method after the cloning attempt of a vehicle.

Detailed Description

Command definitions related to depots.

Definition in file depot_cmd.h.

Function Documentation

◆ CcCloneVehicle()

void CcCloneVehicle ( Commands ,
const CommandCost & result,
VehicleID veh_id )

This is the Callback method after the cloning attempt of a vehicle.

Parameters
resultthe result of the cloning command
veh_idcloned vehicle ID

Definition at line 128 of file depot_gui.cpp.

References CommandCost::Failed(), and ShowVehicleViewWindow().

Referenced by VehicleViewWindow::OnClick(), and DepotWindow::OnVehicleSelect().

◆ CmdRenameDepot()

CommandCost CmdRenameDepot ( DoCommandFlags flags,
DepotID depot_id,
const std::string & text )

Rename a depot.

Parameters
flagstype of operation
depot_idid of depot
textthe new name or an empty string when resetting to the default
Returns
the cost of this operation or an error

Definition at line 46 of file depot_cmd.cpp.

References CheckTileOwnership(), CMD_ERROR, Execute, CommandCost::Failed(), GetDepotVehicleType(), GetTileOwner(), GetWindowClassForVehicleType(), IsUniqueDepotName(), MakeDefaultName(), MAX_LENGTH_DEPOT_NAME_CHARS, SetWindowClassesDirty(), SetWindowDirty(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), VehicleListIdentifier::ToWindowNumber(), Utf8StringLength(), and VL_DEPOT_LIST.