MCPcopy Create free account
hub / github.com/Card-Forge/forge / setCurrentScreen

Method setCurrentScreen

forge-gui-mobile/src/forge/Forge.java:847–874  ·  view source on GitHub ↗
(FScreen screen0)

Source from the content-addressed store, hash-verified

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() {

Callers 2

backMethod · 0.95
openScreenMethod · 0.95

Calls 12

endKeyInputMethod · 0.95
endAllMethod · 0.95
switchToLastMethod · 0.95
isSentryEnabledMethod · 0.95
reportExceptionMethod · 0.95
getInstanceMethod · 0.95
disposeTexturesMethod · 0.80
containsMethod · 0.65
toStringMethod · 0.45
setSizeMethod · 0.45
onActivateMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected