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

Function distanceSpeedDropdown

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

0x004C0FB3

Source from the content-addressed store, hash-verified

1689
1690 // 0x004C0FB3
1691 static void distanceSpeedDropdown([[maybe_unused]] const Window& self, int16_t itemIndex)
1692 {
1693 if (itemIndex == -1)
1694 {
1695 return;
1696 }
1697
1698 auto& cfg = Config::get();
1699 cfg.measurementFormat = Config::MeasurementFormat(itemIndex);
1700
1701 // 0x004C0FC2
1702 cfg.heightMarkerOffset = 0;
1703 if (!cfg.showHeightAsUnits)
1704 {
1705 cfg.heightMarkerOffset = cfg.measurementFormat == Config::MeasurementFormat::imperial ? 1 : 2;
1706 }
1707
1708 Config::write();
1709 Gfx::invalidateScreen();
1710 }
1711
1712 // 0x004C0FFA
1713 static void heightsLabelsMouseDown(const Window& self)

Callers 1

onDropdownFunction · 0.85

Calls 4

MeasurementFormatEnum · 0.85
writeFunction · 0.85
invalidateScreenFunction · 0.85
getFunction · 0.50

Tested by

no test coverage detected