Codechange: make WindowClass a scoped enum

This commit is contained in:
Rubidium
2026-05-20 21:39:04 +02:00
committed by rubidium42
parent a9a2965131
commit bcda4a72ee
134 changed files with 1361 additions and 1249 deletions
+3 -3
View File
@@ -657,7 +657,7 @@ protected:
/** Notify the industry chain window to stop sending newly selected industries. */
static void BreakIndustryChainLink()
{
InvalidateWindowClassesData(WC_INDUSTRY_CARGOES, NUM_INDUSTRYTYPES);
InvalidateWindowClassesData(WindowClass::IndustryCargoes, NUM_INDUSTRYTYPES);
}
static inline Point SmallmapRemapCoords(int x, int y)
@@ -2061,7 +2061,7 @@ static constexpr std::initializer_list<NWidgetPart> _nested_smallmap_widgets = {
/** Window definition for the smallmap window. */
static WindowDesc _smallmap_desc(
WindowPosition::Automatic, "smallmap", 484, 314,
WC_SMALLMAP, WC_NONE,
WindowClass::SmallMap, WindowClass::None,
{},
_nested_smallmap_widgets
);
@@ -2092,7 +2092,7 @@ bool ScrollMainWindowTo(int x, int y, int z, bool instant)
if (res) return res;
SmallMapWindow *w = dynamic_cast<SmallMapWindow*>(FindWindowById(WC_SMALLMAP, 0));
SmallMapWindow *w = dynamic_cast<SmallMapWindow*>(FindWindowById(WindowClass::SmallMap, 0));
if (w != nullptr) w->SmallMapCenterOnCurrentPos();
return res;