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

Function audioDeviceDropdown

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

0x004C04CA

Source from the content-addressed store, hash-verified

1177
1178 // 0x004C04CA
1179 static void audioDeviceDropdown(const Window& self, int16_t itemIndex)
1180 {
1181 if (itemIndex != -1)
1182 {
1183 Audio::setDevice(itemIndex);
1184
1185 // Start playing the title screen music again if applicable (Fix for #2689)
1186 auto& config = Config::get();
1187 if (SceneManager::isTitleMode() && config.audio.playTitleMusic)
1188 {
1189 Audio::playMusic(Environment::PathId::css5, config.audio.mainVolume, true);
1190 }
1191
1192 WindowManager::invalidateWidget(self.type, self.number, Widx::audio_device);
1193 }
1194 }
1195
1196 static void playTitleMusicOnMouseUp(Window& self)
1197 {

Callers 1

onDropdownFunction · 0.85

Calls 5

setDeviceFunction · 0.85
isTitleModeFunction · 0.85
invalidateWidgetFunction · 0.85
playMusicFunction · 0.70
getFunction · 0.50

Tested by

no test coverage detected