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

Method OnPaint

src/toolbar_gui.cpp:2345–2353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2343 }
2344
2345 void OnPaint() override
2346 {
2347 this->SetWidgetDisabledState(WID_TE_DATE_BACKWARD, _settings_game.game_creation.starting_year <= CalendarTime::MIN_YEAR);
2348 this->SetWidgetDisabledState(WID_TE_DATE_FORWARD, _settings_game.game_creation.starting_year >= CalendarTime::MAX_YEAR);
2349 this->SetWidgetDisabledState(WID_TE_ROADS, !GetRoadTypes(true).Any(GetMaskForRoadTramType(RTT_ROAD)));
2350 this->SetWidgetDisabledState(WID_TE_TRAMS, !GetRoadTypes(true).Any(GetMaskForRoadTramType(RTT_TRAM)));
2351
2352 this->DrawWidgets();
2353 }
2354
2355 std::string GetWidgetString(WidgetID widget, StringID stringid) const override
2356 {

Callers

nothing calls this directly

Calls 5

GetRoadTypesFunction · 0.85
GetMaskForRoadTramTypeFunction · 0.85
AnyMethod · 0.80
DrawWidgetsMethod · 0.80

Tested by

no test coverage detected