|
OpenTTD Source 20260208-master-g43af8e94d0
|
Command definitions related to signs. More...
Go to the source code of this file.
Functions | |
| std::tuple< CommandCost, SignID > | CmdPlaceSign (DoCommandFlags flags, TileIndex tile, const std::string &text) |
| Place a sign at the given coordinates. | |
| CommandCost | CmdRenameSign (DoCommandFlags flags, SignID sign_id, const std::string &text, Colours text_colour) |
| Rename a sign. | |
| CommandCost | CmdMoveSign (DoCommandFlags flags, SignID sign_id, TileIndex tile) |
| Move a sign to the given coordinates. | |
| void | CcPlaceSign (Commands, const CommandCost &result, SignID new_sign) |
| Callback function that is called after a sign is placed. | |
Command definitions related to signs.
Definition in file signs_cmd.h.
| void CcPlaceSign | ( | Commands | , |
| const CommandCost & | result, | ||
| SignID | new_sign ) |
Callback function that is called after a sign is placed.
| result | of the operation |
| new_sign | ID of the placed sign. |
Definition at line 135 of file signs_cmd.cpp.
References CommandCost::Failed(), ResetObjectToPlace(), and ShowRenameSignWindow().
Referenced by PlaceProc_Sign().
| CommandCost CmdMoveSign | ( | DoCommandFlags | flags, |
| SignID | sign_id, | ||
| TileIndex | tile ) |
Move a sign to the given coordinates.
Ownership of signs has no meaning/effect whatsoever except for eyecandy.
| flags | type of operation |
| sign_id | index of the sign to be moved |
| tile | tile to place the sign at |
Definition at line 108 of file signs_cmd.cpp.
References _current_company, CMD_ERROR, CompanyCanEditSign(), Execute, GetSlopePixelZ(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TILE_SIZE, TileX(), TileY(), and Sign::UpdateVirtCoord().
| std::tuple< CommandCost, SignID > CmdPlaceSign | ( | DoCommandFlags | flags, |
| TileIndex | tile, | ||
| const std::string & | text ) |
Place a sign at the given coordinates.
Ownership of sign has no effect whatsoever except for the colour the sign gets for easy recognition, but everybody is able to rename/remove it.
| tile | tile to place sign at |
| flags | type of operation |
| text | contents of the sign |
Definition at line 35 of file signs_cmd.cpp.
References _current_company, CMD_ERROR, Execute, GetSlopePixelZ(), InvalidateWindowData(), MAX_LENGTH_SIGN_NAME_CHARS, OWNER_DEITY, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TILE_SIZE, TileX(), TileY(), Sign::UpdateVirtCoord(), Utf8StringLength(), and WC_SIGN_LIST.
| CommandCost CmdRenameSign | ( | DoCommandFlags | flags, |
| SignID | sign_id, | ||
| const std::string & | text, | ||
| Colours | text_colour ) |
Rename a sign.
If the new name of the sign is empty, we assume the user wanted to delete it. So delete it. Ownership of signs has no meaning/effect whatsoever except for eyecandy
| flags | type of operation |
| sign_id | index of the sign to be renamed/removed |
| text | the new name or an empty string when resetting to the default |
| text_colour | colour of the sign's text. Only relevant for OWNER_DEITY. Use INVALID_COLOUR to keep the current colour. |
Definition at line 68 of file signs_cmd.cpp.
References _current_company, CMD_ERROR, CompanyCanEditSign(), Execute, InvalidateWindowData(), TrackedViewportSign::kdtree_valid, ViewportSign::MarkDirty(), MAX_LENGTH_SIGN_NAME_CHARS, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), Sign::UpdateVirtCoord(), Utf8StringLength(), and WC_SIGN_LIST.