Merge remote-tracking branch 'upstream/master'

This commit is contained in:
CCTV-1
2021-02-03 08:26:22 +08:00
130 changed files with 1649 additions and 195 deletions

View File

@@ -202,6 +202,12 @@ public class Forge implements ApplicationListener {
ImageCache.preloadCache(filteredkeys);
}
public static void openHomeScreen(boolean openNewGameMenu) {
openScreen(HomeScreen.instance);
if(openNewGameMenu)
HomeScreen.instance.openNewGamMenu();
}
private void afterDbLoaded() {
stopContinuousRendering(); //save power consumption by disabling continuous rendering once assets loaded
@@ -210,7 +216,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(false);
splashScreen = null;
boolean isLandscapeMode = isLandscapeMode();

View File

@@ -135,6 +135,10 @@ public class HomeScreen extends FScreen {
QuestWorld = questWorld;
}
public void openNewGamMenu(){
NewGameMenu.getPreferredScreen().open();
}
public boolean getQuestCommanderMode() {
return QuestCommander;
}

View File

@@ -77,14 +77,22 @@ 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();
}
if (openHomeScreen)
Forge.openHomeScreen(true);
}
/**