Repository navigation
Conversation
Broaden the existing disable_first_popup from a single first-only interstitial to suppress all ad/interstitial popups via InterstitialViewController.AboutToShow. Add hooks for store pack offer popups (ShopSceneManager.ShowPlcOfferPopup), login streak popups (LoginStreakManager.TryShowStreakPopupForGameSessionStarted), and tutorial/hint popups (TutorialManager.ShowTutorialScreen, both no-arg and 2-arg overloads) behind a new disable_tutorials config setting. Both settings default to false and are documented in all four localized example config files (en, de, fr, nl).
…calling CloseWhenReady
|
Love that you fixed it, great job. Not sure we can merge this as my initial attempt at this was purely to suppress that first one that used to pop up when you signed in. It didn't suppress the rest, but now there's quite a few at times. I feel this one becomes border-line for suppressing them all, so I'll not just say no. Instead, I'll ask for the opinions of our other regular contributors (feel free to add your own) ... @Guffawaffle @lightbull-stfc @darbyjack @Bloody142 @ChronoXNL |
|
I'd almost rather have a setting to show the first one only and then suppress it afterwards? |
|
Agree with @a5ehren, I think blocking the reoccuring would be more okay. On game start (which will be quite often) it can still popup. but blocking the reoccuring probably would be already satisfying for most. |
|
Seems reasonable, is added ✅ |
|
I'm still a bit skeptical on this. Net, you have communication lines, I think I'd ask for approval first. This will be popular but maybe we can use it as a collab with scopes to find a balance that works for both the player and the company? Not sure, just concerned that scopes would frown upon it. I do like the direction of show first, not rest though and I think this could gain traction with scopes. |
Fix
disable_first_popupinterstitial suppression and add store offer popup suppressionBackground
The
disable_first_popupsetting was added in PR #37 to suppress the first ad/interstitial popup. It was disabled in PR #139 with the message "temporarily ignore the disable_first_popup option, as it does not work" and hardcoded toif (false ...). The feature has been dead code ondevsince.Why the original approach didn't work
The original hook intercepted
InterstitialViewController.AboutToShowand calledCloseWhenReady()instead of callingoriginal():How this PR fixes it
The hook now calls
original()first to let the popup initialize properly, then immediately closes it:original()runs unconditionally → the view controller goes through its full initialization lifecycle, no empty screen, no unready-state crash.CloseWhenReady()runs after initialization → closes the popup immediately after it appears, so the user never sees it.isFirstInterstitialone-shot flag is removed → suppression applies to all interstitials, not just the first.Additional changes
ShopSceneManager.ShowPlcOfferPopupthat drops the call whendisable_first_popupis enabled. This popup type doesn't require lifecycle initialization, so skipping the call entirely is safe.ShopSceneManagerlookup — the class was being resolved twice; now resolved once asstatic.disable_first_popupcomment changed from "Prevent the first popup advert" to "Prevent ad/interstitial popups from appearing" to reflect that it now suppresses all such popups, not just the first.How to verify
disable_first_popup = false(default) — all popups appear as before.disable_first_popup = true, restart:InterstitialViewController_AboutToShow: suppressing interstitial popupin debug logs).ShopSceneManager_ShowPlcOfferPopup: suppressing PLC offer popup).Risks
CloseWhenReady()is still called on every interstitial — while calling it afteroriginal()avoids the uninitialized-state crash, it has not been runtime-verified against all popup types. The setting is still marked⚠️ EXPERIMENTALin the config and defaults tofalse.disable_first_popupsemantics broadened — the setting previously (when it worked) only suppressed the first interstitial; it now suppresses all interstitials and store offers. The config comment has been updated accordingly.