@@ -543,6 +543,10 @@ class $modify(DMPlayerObject, PlayerObject) {
543543#include < Geode/modify/PauseLayer.hpp>
544544class $modify(DMPauseLayer, PauseLayer) {
545545
546+ struct Fields {
547+ std::optional<EventListener<geode::Popup<geode::Mod*>::CloseEventFilter>> m_listener;
548+ };
549+
546550 void customSetup () override {
547551
548552 PauseLayer::customSetup ();
@@ -554,11 +558,28 @@ class $modify(DMPauseLayer, PauseLayer) {
554558 CircleBaseSize::MediumAlt
555559 );
556560 sprite->setScale (0 .6f );
557- auto button = CCMenuItemExt::createSpriteExtra (
558- sprite, [](CCNode*){
559- auto playLayer = static_cast <DMPlayLayer*>(PlayLayer::get ());
560561
561- geode::openSettingsPopup (Mod::get (), true );
562+ auto button = CCMenuItemExt::createSpriteExtra (
563+ sprite, [this ](CCNode*){
564+ auto popup = geode::openSettingsPopup (Mod::get (), true );
565+
566+ this ->m_fields ->m_listener = {PopupBypass::listenForCloseOn (popup)};
567+
568+ this ->m_fields ->m_listener ->bind ([](geode::Popup<geode::Mod*>::CloseEvent* e) {
569+ auto playLayer = static_cast <DMPlayLayer*>(PlayLayer::get ());
570+ auto storeLocalStr = Mod::get ()->getSettingValue <std::string>(" store-local-2" );
571+ auto useLocal = storeLocalStr == " Always" ? true : storeLocalStr == " Never" ? false :
572+ playLayer->m_level ->m_stars >= 10 ;
573+
574+ if (playLayer->m_fields ->m_useLocal == useLocal) return ;
575+
576+ constexpr auto message = " <co>\" Use Local Deats\" has changed.</c>\n "
577+ " For this change to take effect, you need to <cl>quit and rejoin "
578+ " the level</c>." ;
579+ FLAlertLayer::create (
580+ " Settings changed" , message, " OK"
581+ )->show ();
582+ });
562583 }
563584 );
564585
0 commit comments