public static void classicFont(boolean value) { ModdingMode.setClassicTextRenderingMode(value); Preferences.INSTANCE.put(Preferences.KEY_CLASSIC_FONT, value); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); sharedpreferences = getSharedPreferences(MyPREFERENCES, Context.MODE_PRIVATE); SharedPreferences.Editor editor = sharedpreferences.edit(); int countShowAds = sharedpreferences.getInt("countShowAds", 0); // String placeModFilesHere = "placeModFilesHere"; PixelDungeon.moddingMode(false); ModdingMode.mode(PixelDungeon.moddingMode()); /* if(!FileSystem.getExternalStorageFile(placeModFilesHere).exists()) { try { FileSystem.getExternalStorageFile(placeModFilesHere).createNewFile(); } catch (IOException e) { GLog.i(e.getMessage()); e.printStackTrace(); } } */ PixelDungeon.instance().initIap(); if (PixelDungeon.uiLanguage().equals("ko")) { PixelDungeon.classicFont(false); } ModdingMode.setClassicTextRenderingMode(PixelDungeon.classicFont()); useLocale(uiLanguage()); updateImmersiveMode(); DisplayMetrics metrics = new DisplayMetrics(); instance().getWindowManager().getDefaultDisplay().getMetrics(metrics); boolean landscape = metrics.widthPixels > metrics.heightPixels; if (Preferences.INSTANCE.getBoolean(Preferences.KEY_LANDSCAPE, false) != landscape) { landscape(!landscape); } Music.INSTANCE.enable(music()); Sample.INSTANCE.enable(soundFx()); secondQuickslot(); if (PixelDungeon.version() != Game.versionCode) { switchScene(WelcomeScene.class); } if (countShowAds >= 2) { final ConnectivityManager conMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); final NetworkInfo activeNetwork = conMgr.getActiveNetworkInfo(); if (activeNetwork != null && activeNetwork.isConnected()) { Intent intent = new Intent(this, Ads.class); startActivity(intent); } editor.putInt("countShowAds", 0); } else { if (countShowAds == 0) { editor.putInt("countShowAds", 1); } else { editor.putInt("countShowAds", countShowAds + 1); } } editor.commit(); }
public static boolean classicFont() { boolean val = Preferences.INSTANCE.getBoolean(Preferences.KEY_CLASSIC_FONT, true); ModdingMode.setClassicTextRenderingMode(val); return val; }