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

Function frameLimitMouseDown

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

Source from the content-addressed store, hash-verified

396#pragma mark - Frame limit dropdown
397
398 static void frameLimitMouseDown(const Window& self, [[maybe_unused]] WidgetIndex_t wi)
399 {
400 auto& dropdown = self.widgets[Widx::frame_limit];
401 Dropdown::show(self.x + dropdown.left, self.y + dropdown.top, dropdown.width(), dropdown.height(), self.getColour(WindowColour::secondary), 3, 0x80);
402
403 Dropdown::add(0, StringIds::dropdown_stringid, StringIds::frameRateLimitInternal);
404 Dropdown::add(1, StringIds::dropdown_stringid, StringIds::frameRateLimitVsync);
405 Dropdown::add(2, StringIds::dropdown_stringid, StringIds::frameRateLimitUnrestricted);
406
407 auto activeItem = 0U;
408 if (Config::get().uncapFPS)
409 {
410 activeItem = Config::get().display.vsync ? 1 : 2;
411 }
412
413 Dropdown::setItemSelected(activeItem);
414 }
415
416 static void frameLimitDropdown(const Window& self, int16_t itemIndex)
417 {

Callers 1

onMouseDownFunction · 0.85

Calls 7

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

Tested by

no test coverage detected