[Mobile] add Shahrazad support

This commit is contained in:
Anthony Calosa
2021-02-03 03:37:44 +08:00
parent 5b80f48461
commit 524ac3ae0c
6 changed files with 42 additions and 6 deletions

View File

@@ -202,6 +202,10 @@ public class Forge implements ApplicationListener {
ImageCache.preloadCache(filteredkeys);
}
public static void openHomeScreen() {
openScreen(HomeScreen.instance);
}
private void afterDbLoaded() {
stopContinuousRendering(); //save power consumption by disabling continuous rendering once assets loaded
@@ -210,7 +214,7 @@ public class Forge implements ApplicationListener {
SoundSystem.instance.setBackgroundMusic(MusicPlaylist.MENUS); //start background music
destroyThis = false; //Allow back()
Gdx.input.setCatchKey(Keys.MENU, true);
openScreen(HomeScreen.instance);
openHomeScreen();
splashScreen = null;
boolean isLandscapeMode = isLandscapeMode();

View File

@@ -77,14 +77,23 @@ public class ControlWinLose {
/** Action performed when "quit" button is pressed in default win/lose UI. */
public void actionOnQuit() {
boolean openHomeScreen = false;
// Reset other stuff
saveOptions();
try { MatchController.getHostedMatch().endCurrentGame();
try {
if(MatchController.getHostedMatch().subGameCount > 0) {
openHomeScreen = true;
MatchController.getHostedMatch().subGameCount--;
}
MatchController.getHostedMatch().endCurrentGame();
} catch (NullPointerException e) {}
view.hide();
if(humancount == 0) {
Forge.back();
}
//todo Refresh the layout
if (openHomeScreen)
Forge.openHomeScreen();
}
/**