[Mobile] Fix annoying overlay between Quest Commander matches

- Only load the overlay when generating the Quest outside the match/duels
This commit is contained in:
Anthony Calosa
2020-12-07 12:14:16 +08:00
parent 3ba79ea606
commit ff7638e2fc
2 changed files with 15 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ package forge.screens.match.winlose;
import forge.game.GameView;
import forge.quest.QuestWinLoseController;
import forge.screens.home.HomeScreen;
/**
* <p>
@@ -44,6 +45,10 @@ public class QuestWinLose extends ControlWinLose {
@Override
public final void showRewards() {
//set loading overlay again
if (HomeScreen.instance.getQuestWorld().contains("XandomX")) {
HomeScreen.instance.updateQuestWorld(HomeScreen.instance.getQuestWorld().replace("XandomX","Random"));
}
controller.showRewards();
}
@@ -60,4 +65,13 @@ public class QuestWinLose extends ControlWinLose {
controller.actionOnQuit();
super.actionOnQuit();
}
@Override
public void actionOnContinue() {
//prevent loading overlay to show on continuing match... TODO: refactor this to a better implementation
if (HomeScreen.instance.getQuestWorld().contains("Random")) {
HomeScreen.instance.updateQuestWorld(HomeScreen.instance.getQuestWorld().replace("Random","XandomX"));
}
super.actionOnContinue();
}
}

View File

@@ -75,7 +75,7 @@ public class QuestDuelsScreen extends QuestLaunchScreen {
FThreads.invokeInEdtLater(new Runnable() {
@Override
public void run() {
LoadingOverlay.show("Loading Random Quest", new Runnable() {
LoadingOverlay.show(Localizer.getInstance().getMessage("lblLoadingCurrentQuest"), new Runnable() {
@Override
public void run() {
generateDuels();