mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Merge pull request #3352 from kevlahnota/newmaster2
restrict menus when DuelScene or RewardScene is loading
This commit is contained in:
@@ -62,6 +62,7 @@ public class Forge implements ApplicationListener {
|
||||
static Batch animationBatch;
|
||||
static TextureRegion lastScreenTexture;
|
||||
private static boolean sceneWasSwapped = false;
|
||||
public static boolean restrictAdvMenus = false;
|
||||
private static Clipboard clipboard;
|
||||
private static IDeviceAdapter deviceAdapter;
|
||||
private static int screenWidth;
|
||||
@@ -1060,7 +1061,6 @@ public class Forge implements ApplicationListener {
|
||||
}
|
||||
|
||||
public static Scene switchToLast() {
|
||||
|
||||
if (lastScene.size != 0) {
|
||||
storeScreen();
|
||||
currentScene = lastScene.get(lastScene.size - 1);
|
||||
|
||||
@@ -151,6 +151,7 @@ public class DuelScene extends ForgeScene {
|
||||
}
|
||||
Runnable endRunnable = null;
|
||||
void afterGameEnd(String enemyName, boolean winner) {
|
||||
Forge.restrictAdvMenus = winner;
|
||||
endRunnable = () -> Gdx.app.postRunnable(()-> {
|
||||
if (GameScene.instance().isNotInWorldMap()) {
|
||||
SoundSystem.instance.pause();
|
||||
|
||||
@@ -133,6 +133,7 @@ public class RewardScene extends UIScene {
|
||||
}
|
||||
//save RAM
|
||||
ImageCache.unloadCardTextures(true);
|
||||
Forge.restrictAdvMenus = false;
|
||||
Forge.switchToLast();
|
||||
}
|
||||
public void reactivateInputs() {
|
||||
|
||||
@@ -156,12 +156,16 @@ public class GameHUD extends Stage {
|
||||
private void openMap() {
|
||||
if (console.isVisible())
|
||||
return;
|
||||
if (Forge.restrictAdvMenus)
|
||||
return;
|
||||
Forge.switchScene(MapViewScene.instance());
|
||||
}
|
||||
|
||||
private void logbook() {
|
||||
if (console.isVisible())
|
||||
return;
|
||||
if (Forge.restrictAdvMenus)
|
||||
return;
|
||||
Forge.switchScene(QuestLogScene.instance(Forge.getCurrentScene()));
|
||||
}
|
||||
|
||||
@@ -484,12 +488,16 @@ public class GameHUD extends Stage {
|
||||
private void openDeck() {
|
||||
if (console.isVisible())
|
||||
return;
|
||||
if (Forge.restrictAdvMenus)
|
||||
return;
|
||||
Forge.switchScene(DeckSelectScene.instance());
|
||||
}
|
||||
|
||||
private void openInventory() {
|
||||
if (console.isVisible())
|
||||
return;
|
||||
if (Forge.restrictAdvMenus)
|
||||
return;
|
||||
WorldSave.getCurrentSave().header.createPreview();
|
||||
Forge.switchScene(InventoryScene.instance());
|
||||
}
|
||||
@@ -525,6 +533,8 @@ public class GameHUD extends Stage {
|
||||
private void menu() {
|
||||
if (console.isVisible())
|
||||
return;
|
||||
if (Forge.restrictAdvMenus)
|
||||
return;
|
||||
gameStage.openMenu();
|
||||
}
|
||||
|
||||
|
||||
@@ -376,7 +376,8 @@ public abstract class GameStage extends Stage {
|
||||
}
|
||||
|
||||
public void openMenu() {
|
||||
|
||||
if (Forge.restrictAdvMenus)
|
||||
return;
|
||||
WorldSave.getCurrentSave().header.createPreview();
|
||||
Forge.switchScene(StartScene.instance());
|
||||
}
|
||||
|
||||
@@ -1125,6 +1125,7 @@ public class MapStage extends GameStage {
|
||||
int duration = mob.getData().boss ? 400 : 200;
|
||||
if (Controllers.getCurrent() != null && Controllers.getCurrent().canVibrate())
|
||||
Controllers.getCurrent().startVibration(duration, 1);
|
||||
Forge.restrictAdvMenus = true;
|
||||
startPause(0.8f, () -> {
|
||||
Forge.setCursor(null, Forge.magnifyToggle ? "1" : "2");
|
||||
SoundSystem.instance.play(SoundEffectType.ManaBurn, false);
|
||||
|
||||
@@ -116,6 +116,7 @@ public class WorldStage extends GameStage implements SaveFileContent {
|
||||
int duration = mob.getData().boss ? 400 : 200;
|
||||
if (Controllers.getCurrent() != null && Controllers.getCurrent().canVibrate())
|
||||
Controllers.getCurrent().startVibration(duration, 1);
|
||||
Forge.restrictAdvMenus = true;
|
||||
startPause(0.8f, () -> {
|
||||
Forge.setCursor(null, Forge.magnifyToggle ? "1" : "2");
|
||||
SoundSystem.instance.play(SoundEffectType.ManaBurn, false);
|
||||
|
||||
Reference in New Issue
Block a user