17 #include "viewport_kdtree.h"
22 #include "table/strings.h"
110 if (result.
Failed())
return;
Common return value for all commands.
bool Failed() const
Did this command fail?
void Remove(const T &element)
Remove a single element from the tree, if it exists.
Functions related to commands.
static const CommandCost CMD_ERROR
Define a default return value for a failed command.
DoCommandFlag
List of flags for a command.
@ DC_EXEC
execute the given command
Commands
List of commands.
CompanyID _current_company
Company currently doing an action.
Functions related to companies.
@ OWNER_DEITY
The object is owned by a superuser / goal script.
void MarkDirty(ZoomLevel maxzoom=ZOOM_LVL_MAX) const
Mark the sign dirty in all viewports.
int GetSlopePixelZ(int x, int y, bool ground_vehicle)
Return world Z coordinate of a given point of a tile.
Functions related to OTTD's landscape.
static debug_inline uint TileY(TileIndex tile)
Get the Y component of a tile.
static debug_inline uint TileX(TileIndex tile)
Get the X component of a tile.
A number of safeguards to prevent using unsafe methods.
bool CompanyCanRenameSign(const Sign *si)
Check if the current company can rename a given sign.
std::tuple< CommandCost, SignID > CmdPlaceSign(DoCommandFlag flags, TileIndex tile, const std::string &text)
Place a sign at the given coordinates.
void PlaceProc_Sign(TileIndex tile)
PlaceProc function, called when someone pressed the button if the sign-tool is selected.
void CcPlaceSign(Commands, const CommandCost &result, SignID new_sign)
Callback function that is called after a sign is placed.
CommandCost CmdRenameSign(DoCommandFlag flags, SignID sign_id, const std::string &text)
Rename a sign.
Command definitions related to signs.
Functions related to signs.
void ShowRenameSignWindow(const Sign *si)
Show the window to change the text of a sign.
uint16_t SignID
The type of the IDs of signs.
static const SignID INVALID_SIGN
Sentinel for an invalid sign.
static const uint MAX_LENGTH_SIGN_NAME_CHARS
The maximum length of a sign name in characters including '\0'.
Definition of base types and functions in a cross-platform compatible way.
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...
Functions related to low-level strings.
Tindex index
Index of this pool item.
static Titem * Get(size_t index)
Returns Titem with given index.
static bool CanAllocateItem(size_t n=1)
Helper functions so we can use PoolItem::Function() instead of _poolitem_pool.Function()
static Titem * GetIfValid(size_t index)
Returns Titem with given index.
void UpdateVirtCoord()
Update the coordinate of one sign.
bool kdtree_valid
Are the sign data valid for use with the _viewport_sign_kdtree?
static const uint TILE_SIZE
Tile size in world coordinates.
Functions related to tile highlights.
void ResetObjectToPlace()
Reset the cursor and mouse mode handling back to default (normal cursor, only clicking in windows).
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-...
Window functions not directly related to making/drawing windows.
@ WC_SIGN_LIST
Sign list; Window numbers: