OpenTTD Source
1.11.0-beta2
|
Go to the documentation of this file.
17 #include "viewport_kdtree.h"
21 #include "table/strings.h"
55 si->z = GetSlopePixelZ(x, y);
119 if (result.
Failed())
return;
#define CMD_MSG(x)
Used to combine a StringID with the command.
uint32 TileIndex
The index/ID of a Tile.
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-...
CommandCost CmdRenameSign(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Rename a sign.
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:
static const uint TILE_SIZE
Tile size in world coordinates.
static uint TileY(TileIndex tile)
Get the Y component of a tile.
@ DC_EXEC
execute the given command
DoCommandFlag
List of flags for a command.
static uint TileX(TileIndex tile)
Get the X component of a tile.
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...
#define return_cmd_error(errcode)
Returns from a function with a specific StringID as error.
Common return value for all commands.
bool DoCommandP(const CommandContainer *container, bool my_cmd)
Shortcut for the long DoCommandP when having a container with the data.
void CcPlaceSign(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd)
Callback function that is called after a sign is placed.
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.
SignID _new_sign_id
The last built sign.
static bool StrEmpty(const char *s)
Check if a string buffer is empty.
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.
@ OWNER_DEITY
The object is owned by a superuser / goal script.
CommandCost CmdPlaceSign(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Place a sign at the given coordinates.
char * stredup(const char *s, const char *last)
Create a duplicate of the given string.
void ShowRenameSignWindow(const Sign *si)
Show the window to change the text of a sign.
void ResetObjectToPlace()
Reset the cursor and mouse mode handling back to default (normal cursor, only clicking in windows).
@ CMD_PLACE_SIGN
place a sign
uint16 SignID
The type of the IDs of signs.