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

Method checkThemeDir

forge-gui-mobile/src/forge/assets/FSkin.java:92–110  ·  view source on GitHub ↗
(FileHandle themeDir, String themeName)

Source from the content-addressed store, hash-verified

90 return missing == 0;
91 }
92 private static void checkThemeDir(FileHandle themeDir, String themeName) {
93 if (themeDir == null || !themeDir.exists() || !themeDir.isDirectory()) {
94 System.err.println("Skin not found. Defaulting to fallback_skin.");
95 useFallbackDir();
96 } else {
97 if (!isThemeValid(themeDir, themeName, false)) {
98 System.err.println(themeName + " theme is missing some files to work properly.");
99 final FileHandle def = Gdx.files.absolute(ForgeConstants.DEFAULT_SKINS_DIR);
100 if (def.exists() && def.isDirectory() && isThemeValid(def, "", true)) {
101 FSkinFont.deleteCachedFiles();
102 //use default skin if valid
103 preferredDir = def;
104 saveSkinName(FModel.getPreferences(), "Default");
105 } else {
106 useFallbackDir();
107 }
108 }
109 }
110 }
111 private static void useFallbackDir() {
112 preferredDir = GuiBase.isAndroid() ? Gdx.files.internal("fallback_skin") : Gdx.files.classpath("fallback_skin");
113 }

Callers 1

loadLightMethod · 0.95

Calls 5

useFallbackDirMethod · 0.95
isThemeValidMethod · 0.95
deleteCachedFilesMethod · 0.95
saveSkinNameMethod · 0.95
getPreferencesMethod · 0.95

Tested by

no test coverage detected