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

Method afterDbLoaded

forge-gui-mobile/src/forge/Forge.java:394–458  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

392 }
393 }
394 protected void afterDbLoaded() {
395 if (GuiBase.isAndroid() && autoCache)
396 getSplashScreen().getProgressBar().setDescription(getLocalizer().getMessage("lblFinishingStartup") + "\nDetected RAM: " + totalDeviceRAM + "MB. Cache size: " + cacheSize);
397 else
398 getSplashScreen().getProgressBar().setDescription(getLocalizer().getMessage("lblFinishingStartup"));
399 //override transition & title bg
400 try {
401 FileHandle transitionFile = Config.instance().getFile("ui/transition.png");
402 FileHandle titleBGFile = isLandscapeMode() ? Config.instance().getFile("ui/title_bg.png") : Config.instance().getFile("ui/title_bg_portrait.png");
403 FileHandle vsIcon = Config.instance().getFile("ui/vs.png");
404 if (vsIcon.exists())
405 getAssets().fallback_skins().put("vs", new Texture(vsIcon));
406 if (transitionFile.exists())
407 getAssets().fallback_skins().put("transition", new Texture(transitionFile));
408 if (titleBGFile.exists())
409 getAssets().fallback_skins().put("title", new Texture(titleBGFile));
410 AdventureScreen.preload();
411 } catch (Exception e) {
412 e.printStackTrace();
413 }
414 destroyThis = false; //Allow back()
415 Gdx.input.setCatchKey(Keys.MENU, true);
416
417 afterDBloaded = true;
418 //adjust height modifier
419 adjustHeightModifier(getScreenWidth(), getScreenHeight());
420
421 FThreads.invokeInBackgroundThread(() -> FThreads.invokeInEdtLater(() -> {
422 //load skin full
423 FSkin.loadFull(splashScreen);
424 FThreads.invokeInBackgroundThread(() -> {
425 //load Drafts
426 preloadBoosterDrafts();
427 FThreads.invokeInEdtLater(() -> {
428 if (selector.equals("Adventure")) {
429 //preload adventure resources to speedup startup if selector is adventure. Needs in edt when setting up worldstage
430 loadAdventureResources(false);
431 isMobileAdventureMode = true;
432 }
433 //selection transition
434 setTransitionScreen(new TransitionScreen(() -> {
435 if (createNewAdventureMap) {
436 openAdventure();
437 clearSplashScreen();
438 } else {
439 if (selector.equals("Classic")) {
440 openHomeDefault();
441 clearSplashScreen();
442 } else if (selector.equals("Adventure")) {
443 openAdventure();
444 clearSplashScreen();
445 } else if (splashScreen != null) {
446 splashScreen.setShowModeSelector(true);
447 } else {//default mode in case splashscreen is null at some point as seen on resume..
448 openHomeDefault();
449 clearSplashScreen();
450 }
451 }

Callers

nothing calls this directly

Calls 15

isAndroidMethod · 0.95
getSplashScreenMethod · 0.95
getLocalizerMethod · 0.95
instanceMethod · 0.95
isLandscapeModeMethod · 0.95
getAssetsMethod · 0.95
preloadMethod · 0.95
adjustHeightModifierMethod · 0.95
getScreenWidthMethod · 0.95
getScreenHeightMethod · 0.95
invokeInEdtLaterMethod · 0.95

Tested by

no test coverage detected