MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / heightsLabelsDropdown

Function heightsLabelsDropdown

src/OpenLoco/src/Ui/Windows/Options.cpp:1730–1749  ·  view source on GitHub ↗

0x004C106C

Source from the content-addressed store, hash-verified

1728
1729 // 0x004C106C
1730 static void heightsLabelsDropdown([[maybe_unused]] const Window& self, int16_t index)
1731 {
1732 if (index == -1)
1733 {
1734 return;
1735 }
1736
1737 auto& cfg = Config::get();
1738 cfg.showHeightAsUnits = index == 0;
1739
1740 // 0x004C0FC2
1741 cfg.heightMarkerOffset = 0;
1742 if (!cfg.showHeightAsUnits)
1743 {
1744 cfg.heightMarkerOffset = cfg.measurementFormat == Config::MeasurementFormat::imperial ? 1 : 2;
1745 }
1746
1747 Config::write();
1748 Gfx::invalidateScreen();
1749 }
1750
1751 // 0x004C1195
1752 static void onUpdate(Window& self)

Callers 1

onDropdownFunction · 0.85

Calls 3

writeFunction · 0.85
invalidateScreenFunction · 0.85
getFunction · 0.50

Tested by

no test coverage detected