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

Function languageDropdown

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

Source from the content-addressed store, hash-verified

1528 }
1529
1530 static void languageDropdown(Window& self, int16_t itemIndex)
1531 {
1532 if (itemIndex == -1)
1533 {
1534 self.invalidate();
1535 return;
1536 }
1537
1538 const auto lds = Localisation::getLanguageDescriptors();
1539 const auto& ld = lds[itemIndex + 1];
1540 Config::get().language = ld.locale;
1541 Config::write();
1542 Localisation::loadLanguageFile();
1543 // Reloading the objects will force objects to load the new language
1544 ObjectManager::reloadAll();
1545 Gfx::invalidateScreen();
1546
1547 // Rebuild the scenario index to use the new language.
1548 ScenarioManager::loadIndex(true);
1549 }
1550
1551 // 0x004C0C73
1552 static void currencyMouseDown(const Window& self)

Callers 1

onDropdownFunction · 0.85

Calls 8

getLanguageDescriptorsFunction · 0.85
writeFunction · 0.85
loadLanguageFileFunction · 0.85
reloadAllFunction · 0.85
invalidateScreenFunction · 0.85
getFunction · 0.50
loadIndexFunction · 0.50
invalidateMethod · 0.45

Tested by

no test coverage detected