OpenTTD Source
20240917-master-g9ab0a47812
|
Go to the documentation of this file.
17 #include "viewport_kdtree.h"
22 #include "table/strings.h"
110 if (result.
Failed())
return;
static debug_inline uint TileY(TileIndex tile)
Get the Y component of a tile.
@ OWNER_DEITY
The object is owned by a superuser / goal script.
void InvalidateWindowData(WindowClass cls, WindowNumber number, int data, bool gui_scope)
Mark window data of the window of a given class and specific window number as invalid (in need of re-...
static Titem * Get(size_t index)
Returns Titem with given index.
static Titem * GetIfValid(size_t index)
Returns Titem with given index.
static const CommandCost CMD_ERROR
Define a default return value for a failed command.
Tindex index
Index of this pool item.
static const uint MAX_LENGTH_SIGN_NAME_CHARS
The maximum length of a sign name in characters including '\0'.
@ WC_SIGN_LIST
Sign list; Window numbers:
std::tuple< CommandCost, SignID > CmdPlaceSign(DoCommandFlag flags, TileIndex tile, const std::string &text)
Place a sign at the given coordinates.
static const uint TILE_SIZE
Tile size in world coordinates.
uint16_t SignID
The type of the IDs of signs.
@ DC_EXEC
execute the given command
int GetSlopePixelZ(int x, int y, bool ground_vehicle)
Return world Z coordinate of a given point of a tile.
DoCommandFlag
List of flags for a command.
void Remove(const T &element)
Remove a single element from the tree, if it exists.
size_t Utf8StringLength(const char *s)
Get the length of an UTF-8 encoded string in number of characters and thus not the number of bytes th...
Common return value for all commands.
void UpdateVirtCoord()
Update the coordinate of one sign.
bool Failed() const
Did this command fail?
void MarkDirty(ZoomLevel maxzoom=ZOOM_LVL_MAX) const
Mark the sign dirty in all viewports.
static const SignID INVALID_SIGN
Sentinel for an invalid sign.
bool CompanyCanRenameSign(const Sign *si)
Check if the current company can rename a given sign.
CompanyID _current_company
Company currently doing an action.
bool kdtree_valid
Are the sign data valid for use with the _viewport_sign_kdtree?
static bool CanAllocateItem(size_t n=1)
Helper functions so we can use PoolItem::Function() instead of _poolitem_pool.Function()
void PlaceProc_Sign(TileIndex tile)
PlaceProc function, called when someone pressed the button if the sign-tool is selected.
void ShowRenameSignWindow(const Sign *si)
Show the window to change the text of a sign.
CommandCost CmdRenameSign(DoCommandFlag flags, SignID sign_id, const std::string &text)
Rename a sign.
Commands
List of commands.
static debug_inline uint TileX(TileIndex tile)
Get the X component of a tile.
void ResetObjectToPlace()
Reset the cursor and mouse mode handling back to default (normal cursor, only clicking in windows).
void CcPlaceSign(Commands, const CommandCost &result, SignID new_sign)
Callback function that is called after a sign is placed.