Java Code Examples for com.watabou.noosa.Game#softPaused()

The following examples show how to use com.watabou.noosa.Game#softPaused() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WndMovieTheatre.java    From remixed-dungeon with GNU General Public License v3.0 5 votes vote down vote up
private void showAd() {
	hide();

	Game.softPaused = true;
	Dungeon.save();

	Game.instance().runOnUiThread(() -> {
		AdsUtils.removeTopBanner();
		Ads.showRewardVideo(this);
	});
}
 
Example 2
Source File: WndSaveSlotSelect.java    From remixed-dungeon with GNU General Public License v3.0 5 votes vote down vote up
private void showAd(String slotName) {
    hide();
    slot = slotName;

    Game.softPaused = true;

    if (RemixedDungeon.donated() < 1) {
        Ads.displaySaveAndLoadAd(new ReturnOnlyOnce(this));
    } else {
        returnToWork(true);
    }
}
 
Example 3
Source File: WndSaveSlotSelect.java    From remixed-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void returnToWork(boolean res) {
    Game.softPaused = false;

    Game.pushUiTask(() -> {
        if (!saving) {
            SaveUtils.loadGame(slot, Dungeon.hero.getHeroClass());
        } else {
            if (RemixedDungeon.donated() == 0 && RemixedDungeon.canDonate()) {

                if (Math.random() < 0.1) {
                    Game.pushUiTask(() -> {
                        Iap iap = Game.instance().iap;
                        if (iap != null && iap.isReady() || BuildConfig.DEBUG) {
                            EventCollector.logEvent(EventCollector.SAVE_ADS_EXPERIMENT, "DialogShown");
                            Hero.doOnNextAction = () -> Game.addToScene(new WndDontLikeAds());
                        } else {
                            EventCollector.logEvent(EventCollector.SAVE_ADS_EXPERIMENT, "DialogNotShownIapNotReady");
                        }
                    });
                }

            }
        }

    });
}
 
Example 4
Source File: GameScene.java    From remixed-dungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public synchronized void pause() {
    if(!Game.softPaused) {
        Dungeon.save();
    }
}