MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / HandleClickOnSign

Function HandleClickOnSign

src/signs_gui.cpp:572–583  ·  view source on GitHub ↗

* Handle clicking on a sign. * @param si The sign that was clicked on. */

Source from the content-addressed store, hash-verified

570 * @param si The sign that was clicked on.
571 */
572void HandleClickOnSign(const Sign *si)
573{
574 /* If we can't edit the sign, don't even open the rename GUI. */
575 if (!CompanyCanEditSign(si)) return;
576
577 if (_ctrl_pressed && (si->owner == _local_company || (si->owner == OWNER_DEITY && _game_mode == GM_EDITOR))) {
578 RenameSign(si->index, "");
579 return;
580 }
581
582 ShowRenameSignWindow(si);
583}
584
585/**
586 * Show the window to change the text of a sign.

Callers 1

CheckClickOnViewportSignFunction · 0.85

Calls 3

CompanyCanEditSignFunction · 0.85
RenameSignFunction · 0.85
ShowRenameSignWindowFunction · 0.85

Tested by

no test coverage detected