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

Method OnClick

src/town_gui.cpp:1750–1773  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1748 }
1749
1750 void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override
1751 {
1752 switch (widget) {
1753 case WID_BH_PROTECT_TOGGLE:
1754 BuildHouseWindow::house_protected = !BuildHouseWindow::house_protected;
1755 this->SetWidgetLoweredState(WID_BH_PROTECT_TOGGLE, BuildHouseWindow::house_protected);
1756
1757 SndClickBeep();
1758 this->SetDirty();
1759 break;
1760
1761 case WID_BH_REPLACE_TOGGLE:
1762 BuildHouseWindow::replace = !BuildHouseWindow::replace;
1763 this->SetWidgetLoweredState(WID_BH_REPLACE_TOGGLE, BuildHouseWindow::replace);
1764
1765 SndClickBeep();
1766 this->SetDirty();
1767 break;
1768
1769 default:
1770 this->PickerWindow::OnClick(pt, widget, click_count);
1771 break;
1772 }
1773 }
1774
1775 void OnInvalidateData(int data = 0, bool gui_scope = true) override
1776 {

Callers

nothing calls this directly

Calls 3

SndClickBeepFunction · 0.85
SetWidgetLoweredStateMethod · 0.80
SetDirtyMethod · 0.45

Tested by

no test coverage detected