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

Function audioDeviceMouseDown

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

0x004C043D

Source from the content-addressed store, hash-verified

1155
1156 // 0x004C043D
1157 static void audioDeviceMouseDown(const Window& self)
1158 {
1159 const auto& devices = Audio::getDevices();
1160 if (devices.size() != 0)
1161 {
1162 auto& dropdown = self.widgets[Widx::audio_device];
1163 Dropdown::show(self.x + dropdown.left, self.y + dropdown.top, dropdown.width() - 4, dropdown.height(), self.getColour(WindowColour::secondary), devices.size(), 0x80);
1164 for (size_t i = 0; i < devices.size(); i++)
1165 {
1166 auto name = devices[i].c_str();
1167 Dropdown::add(i, StringIds::dropdown_stringid, { StringIds::stringptr, name });
1168 }
1169
1170 auto currentDevice = Audio::getCurrentDevice();
1171 if (currentDevice != std::numeric_limits<size_t>().max())
1172 {
1173 Dropdown::setItemSelected((int16_t)currentDevice);
1174 }
1175 }
1176 }
1177
1178 // 0x004C04CA
1179 static void audioDeviceDropdown(const Window& self, int16_t itemIndex)

Callers 1

onMouseDownFunction · 0.85

Calls 8

showFunction · 0.85
getCurrentDeviceFunction · 0.85
setItemSelectedFunction · 0.85
getColourMethod · 0.80
addFunction · 0.50
sizeMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected