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

Function onClose

src/OpenLoco/src/Ui/Windows/ObjectSelectionWindow.cpp:1633–1657  ·  view source on GitHub ↗

0x004739DD

Source from the content-addressed store, hash-verified

1631
1632 // 0x004739DD
1633 static void onClose([[maybe_unused]] Window& self)
1634 {
1635 auto& selection = ObjectManager::getCurrentSelectionList();
1636 ObjectManager::unloadUnselectedSelectionListObjects(selection.objectFlags);
1637 ObjectManager::loadSelectionListObjects(selection.objectFlags);
1638 ObjectManager::reloadAll();
1639 ObjectManager::freeTemporaryObject();
1640
1641 if (!SceneManager::isEditorMode())
1642 {
1643 // Make new selection available in-game.
1644 ObjectManager::updateYearly2();
1645 ObjectManager::updateTerraformObjects();
1646 Gfx::loadCurrency();
1647 Gfx::loadDefaultPalette();
1648 Gfx::invalidateScreen();
1649 CompanyManager::determineAvailableVehicles();
1650 WindowManager::invalidate(WindowType::buildVehicle);
1651
1652 // Stop being modal and unpause game.
1653 WindowManager::setCurrentModalType(WindowType::undefined);
1654 SceneManager::unsetPauseFlag(PauseFlags::objectSelection);
1655 }
1656 ObjectManager::freeSelectionList();
1657 }
1658
1659 // 0x00473A04
1660 static void onUpdate(Window& self)

Callers

nothing calls this directly

Calls 15

loadSelectionListObjectsFunction · 0.85
reloadAllFunction · 0.85
freeTemporaryObjectFunction · 0.85
isEditorModeFunction · 0.85
updateYearly2Function · 0.85
updateTerraformObjectsFunction · 0.85
loadCurrencyFunction · 0.85
loadDefaultPaletteFunction · 0.85
invalidateScreenFunction · 0.85
setCurrentModalTypeFunction · 0.85
unsetPauseFlagFunction · 0.85

Tested by

no test coverage detected