22 #include "table/strings.h" 56 si->z = GetSlopePixelZ(x, y);
120 if (result.
Failed())
return;
void CcPlaceSign(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2)
Callback function that is called after a sign is placed.
CommandCost CmdRenameSign(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Rename a sign.
static Titem * GetIfValid(size_t index)
Returns Titem with given index.
static const uint MAX_LENGTH_SIGN_NAME_CHARS
The maximum length of a sign name in characters including '\0'.
CommandCost CmdPlaceSign(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Place a sign at the given coordinates.
static Titem * Get(size_t index)
Returns Titem with given index.
static const CommandCost CMD_ERROR
Define a default return value for a failed command.
Sign list; Window numbers:
static uint TileX(TileIndex tile)
Get the X component of a tile.
Tindex index
Index of this pool item.
Common return value for all commands.
Functions related to signs.
static const uint TILE_SIZE
Tile size in world coordinates.
void MarkDirty(ZoomLevel maxzoom=ZOOM_LVL_MAX) const
Mark the sign dirty in all viewports.
The object is owned by a superuser / goal script.
Functions related to low-level strings.
void ShowRenameSignWindow(const Sign *si)
Show the window to change the text of a sign.
DoCommandFlag
List of flags for a command.
Definition of base types and functions in a cross-platform compatible way.
A number of safeguards to prevent using unsafe methods.
SignID _new_sign_id
The last built sign.
char * stredup(const char *s, const char *last)
Create a duplicate of the given string.
bool DoCommandP(const CommandContainer *container, bool my_cmd)
Shortcut for the long DoCommandP when having a container with the data.
bool Failed() const
Did this command fail?
void UpdateVirtCoord()
Update the coordinate of one sign.
#define return_cmd_error(errcode)
Returns from a function with a specific StringID as error.
execute the given command
Functions related to companies.
static bool StrEmpty(const char *s)
Check if a string buffer is empty.
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...
CompanyByte _current_company
Company currently doing an action.
uint32 TileIndex
The index/ID of a Tile.
static uint TileY(TileIndex tile)
Get the Y component of a tile.
static bool CanAllocateItem(size_t n=1)
Helper functions so we can use PoolItem::Function() instead of _poolitem_pool.Function() ...
Functions related to OTTD's landscape.
Functions related to commands.
uint16 SignID
The type of the IDs of signs.
static void free(const void *ptr)
Version of the standard free that accepts const pointers.
#define CMD_MSG(x)
Used to combine a StringID with the command.
void ResetObjectToPlace()
Reset the cursor and mouse mode handling back to default (normal cursor, only clicking in windows)...
Functions related to tile highlights.
Window functions not directly related to making/drawing windows.
void PlaceProc_Sign(TileIndex tile)
PlaceProc function, called when someone pressed the button if the sign-tool is selected.
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-...