()
| 168 | return localizer; |
| 169 | } |
| 170 | @Override |
| 171 | public void create() { |
| 172 | //install our error handler |
| 173 | ExceptionHandler.registerErrorHandling(); |
| 174 | //log version and system info |
| 175 | GuiBase.logHWInfo(); |
| 176 | // closeSplashScreen() is called early on non-Windows OS so it will not crash, LWJGL3 bug on AWT Splash. |
| 177 | if (OperatingSystem.isWindows()) |
| 178 | getDeviceAdapter().closeSplashScreen(); |
| 179 | |
| 180 | GuiBase.setIsAndroid(Gdx.app.getType() == Application.ApplicationType.Android); |
| 181 | |
| 182 | ((GuiMobile) GuiBase.getInterface()).captureGlThread(); |
| 183 | |
| 184 | if (!GuiBase.isAndroid() || (androidVersion > 25 && totalDeviceRAM > 3400)) { |
| 185 | allowCardBG = true; |
| 186 | } |
| 187 | assets = new Assets(); |
| 188 | graphics = new Graphics(); |
| 189 | splashScreen = new SplashScreen(); |
| 190 | frameRate = new FrameRate(); |
| 191 | animationBatch = new SpriteBatch(); |
| 192 | inputProcessor = new MainInputProcessor(); |
| 193 | |
| 194 | Gdx.input.setInputProcessor(inputProcessor); |
| 195 | /* |
| 196 | Set CatchBackKey here and exit the app when you hit the |
| 197 | back button while the textures,fonts,etc are still loading, |
| 198 | to prevent rendering issue when you try to restart |
| 199 | the app again (seems it doesnt dispose correctly...?!?) |
| 200 | */ |
| 201 | Gdx.input.setCatchKey(Keys.BACK, true); |
| 202 | destroyThis = true; //Prevent back() |
| 203 | if (Files.exists(Paths.get(ForgeConstants.DEFAULT_SKINS_DIR+ForgeConstants.ADV_TEXTURE_BG_FILE))) |
| 204 | selector = getForgePreferences().getPref(FPref.UI_SELECTOR_MODE); |
| 205 | |
| 206 | //screenWidth and screenHeight should be set initially and only change upon restarting the app |
| 207 | screenWidth = Gdx.app.getGraphics().getWidth(); |
| 208 | screenHeight = Gdx.app.getGraphics().getHeight(); |
| 209 | // Desktop default: auto-detect from initial window/backbuffer aspect ratio |
| 210 | if (!GuiBase.isAndroid() && desktopAutoOrientation) { |
| 211 | isPortraitMode = screenHeight > screenWidth; |
| 212 | } |
| 213 | //update landscape mode preference if it doesn't match what the app loaded as |
| 214 | if (getForgePreferences().getPrefBoolean(FPref.UI_LANDSCAPE_MODE) != isLandscapeMode()) { |
| 215 | getForgePreferences().setPref(FPref.UI_LANDSCAPE_MODE, isLandscapeMode()); |
| 216 | getForgePreferences().save(); |
| 217 | } |
| 218 | |
| 219 | String skinName; |
| 220 | if (FileUtil.doesFileExist(ForgeConstants.MAIN_PREFS_FILE)) { |
| 221 | skinName = getForgePreferences().getPref(FPref.UI_SKIN); |
| 222 | } else { |
| 223 | skinName = "default"; //use default skin if preferences file doesn't exist yet |
| 224 | } |
| 225 | if (!initialized) |
| 226 | FSkin.loadLight(skinName, getSplashScreen()); |
| 227 |
nothing calls this directly
no test coverage detected