/** * Loads the skin given by the current skin directory. * If the directory is invalid, the default skin will be loaded. */ public static void loadSkin() { File skinDir = getSkinDir(); if (skinDir == null) // invalid skin name skinName = Skin.DEFAULT_SKIN_NAME; // set skin and modify resource locations ResourceLoader.removeAllResourceLocations(); if (skinDir == null) skin = new Skin(null); else { // load the skin skin = SkinLoader.loadSkin(skinDir); ResourceLoader.addResourceLocation(new FileSystemLocation(skinDir)); } ResourceLoader.addResourceLocation(new ClasspathLocation()); ResourceLoader.addResourceLocation(new FileSystemLocation(new File("."))); ResourceLoader.addResourceLocation(new FileSystemLocation(new File("./res/"))); }
/** * Loads the skin given by the current skin directory. * If the directory is invalid, the default skin will be loaded. */ public void loadSkin() { File skinDir = getCurrentSkinDirectory(); if (skinDir == null) { // invalid skin name usedSkinName = Skin.DEFAULT_SKIN_NAME; } // create available skins list File[] dirs = SkinLoader.getSkinDirectories(config.skinRootDir); availableSkinDirectories = new String[dirs.length + 1]; availableSkinDirectories[0] = Skin.DEFAULT_SKIN_NAME; for (int i = 0; i < dirs.length; i++) { availableSkinDirectories[i + 1] = dirs[i].getName(); } // set skin and modify resource locations ResourceLoader.removeAllResourceLocations(); if (skinDir == null) { skin = new Skin(null); } else { // load the skin skin = SkinLoader.loadSkin(skinDir); ResourceLoader.addResourceLocation(new FileSystemLocation(skinDir)); } ResourceLoader.addResourceLocation(new ClasspathLocation()); ResourceLoader.addResourceLocation(new FileSystemLocation(new File("."))); ResourceLoader.addResourceLocation(new FileSystemLocation(new File("./res/"))); }