(FScreen screen0)
| 845 | } |
| 846 | |
| 847 | private static void setCurrentScreen(FScreen screen0) { |
| 848 | String toNewScreen = screen0 != null ? screen0.toString() : ""; |
| 849 | String previousScreen = currentScreen != null ? currentScreen.toString() : ""; |
| 850 | //update gameInProgress for preload decks |
| 851 | gameInProgress = toNewScreen.toLowerCase().contains("match") || previousScreen.toLowerCase().contains("match"); |
| 852 | //dispose card textures handled by assetmanager |
| 853 | boolean dispose = toNewScreen.toLowerCase().contains("homescreen") && disposeTextures; |
| 854 | try { |
| 855 | endKeyInput(); //end key input before switching screens |
| 856 | ForgeAnimation.endAll(); //end all active animations before switching screens |
| 857 | currentScreen = screen0; |
| 858 | if (currentScreen != null) { |
| 859 | currentScreen.setSize(screenWidth, screenHeight); |
| 860 | currentScreen.onActivate(); |
| 861 | } |
| 862 | else if(isMobileAdventureMode) { |
| 863 | switchToLast(); |
| 864 | } |
| 865 | } catch (Exception ex) { |
| 866 | graphics.end(); |
| 867 | //check if sentry is enabled, if not it will call the gui interface but here we end the graphics so we only send it via sentry.. |
| 868 | if (BugReporter.isSentryEnabled()) |
| 869 | BugReporter.reportException(ex); |
| 870 | } finally { |
| 871 | if (dispose) |
| 872 | ImageCache.getInstance().disposeTextures(); |
| 873 | } |
| 874 | } |
| 875 | |
| 876 | @Override |
| 877 | public void render() { |
no test coverage detected