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

Function languageMouseDown

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

Source from the content-addressed store, hash-verified

1506 }
1507
1508 static void languageMouseDown(const Window& self)
1509 {
1510 const auto lds = Localisation::getLanguageDescriptors();
1511 uint8_t numLanguages = static_cast<uint8_t>(lds.size());
1512
1513 auto& dropdown = self.widgets[Widx::language];
1514 Dropdown::show(self.x + dropdown.left, self.y + dropdown.top, dropdown.width() - 4, dropdown.height(), self.getColour(WindowColour::secondary), numLanguages - 1, 0x80);
1515
1516 std::string& current_language = Config::get().language;
1517
1518 for (uint8_t index = 1; index < numLanguages; index++)
1519 {
1520 auto& ld = lds[index];
1521 Dropdown::add(index - 1, StringIds::dropdown_stringptr, (char*)ld.nativeName.c_str());
1522
1523 if (ld.locale == current_language)
1524 {
1525 Dropdown::setItemSelected(index - 1);
1526 }
1527 }
1528 }
1529
1530 static void languageDropdown(Window& self, int16_t itemIndex)
1531 {

Callers 1

onMouseDownFunction · 0.85

Calls 9

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

Tested by

no test coverage detected