OpenTTD Source 20260208-master-g43af8e94d0
signs_func.h File Reference

Functions related to signs. More...

#include "signs_type.h"
#include "tile_type.h"

Go to the source code of this file.

Functions

void UpdateAllSignVirtCoords ()
 Update the coordinates of all signs.
void PlaceProc_Sign (TileIndex tile)
 PlaceProc function, called when someone pressed the button if the sign-tool is selected.
bool CompanyCanEditSign (const Sign *si)
 Check if the current company can rename or move a given sign.
void ShowRenameSignWindow (const Sign *si)
 Show the window to change the text of a sign.
void HandleClickOnSign (const Sign *si)
 Handle clicking on a sign.
void DeleteRenameSignWindow (SignID sign)
 Close the sign window associated with the given sign.
WindowShowSignList ()
 Open the sign list window.

Detailed Description

Functions related to signs.

Definition in file signs_func.h.

Function Documentation

◆ CompanyCanEditSign()

bool CompanyCanEditSign ( const Sign * si)

Check if the current company can rename or move a given sign.

Parameters
*siThe sign in question.
Returns
true if the sign can be renamed or moved, else false.

Definition at line 62 of file signs.cpp.

References _current_company, and OWNER_DEITY.

Referenced by CmdMoveSign(), CmdRenameSign(), and HandleClickOnSign().

◆ DeleteRenameSignWindow()

void DeleteRenameSignWindow ( SignID sign)

Close the sign window associated with the given sign.

Parameters
signThe sign to close the window for.

Definition at line 654 of file signs_gui.cpp.

References Window::Close(), FindWindowById(), WC_QUERY_STRING, and WN_QUERY_STRING_SIGN.

Referenced by Sign::~Sign().

◆ HandleClickOnSign()

void HandleClickOnSign ( const Sign * si)

Handle clicking on a sign.

Parameters
siThe sign that was clicked on.

Definition at line 625 of file signs_gui.cpp.

References _ctrl_pressed, _local_company, CompanyCanEditSign(), OWNER_DEITY, RenameSign(), and ShowRenameSignWindow().

◆ PlaceProc_Sign()

void PlaceProc_Sign ( TileIndex tile)

PlaceProc function, called when someone pressed the button if the sign-tool is selected.

Parameters
tileon which to place the sign

Definition at line 149 of file signs_cmd.cpp.

References CcPlaceSign().

Referenced by MainToolbarWindow::OnPlaceObject(), ScenarioEditorToolbarWindow::OnPlaceObject(), and TerraformToolbarWindow::OnPlaceObject().

◆ ShowRenameSignWindow()

void ShowRenameSignWindow ( const Sign * si)

Show the window to change the text of a sign.

Parameters
siThe sign to show the window for.

Definition at line 642 of file signs_gui.cpp.

References CloseWindowByClass(), and WC_QUERY_STRING.

Referenced by CcPlaceSign(), and HandleClickOnSign().

◆ ShowSignList()

Window * ShowSignList ( )

Open the sign list window.

Returns
newly opened sign list window, or nullptr if the window could not be opened.

Definition at line 375 of file signs_gui.cpp.

References AllocateWindowDescFront().

Referenced by MenuClickMap(), MainToolbarWindow::OnHotkey(), and SignListWindow::SignListGlobalHotkeys().

◆ UpdateAllSignVirtCoords()

void UpdateAllSignVirtCoords ( )

Update the coordinates of all signs.

Definition at line 50 of file signs.cpp.

Referenced by UpdateAllVirtCoords().