Initial skin loader implementation.
- Skins are now loaded from subdirectories of the root "Skins" directory, and can be changed in-game (but requires a restart). - Changed the default skin directory to the osu! directory, if available. This implements a full parser for skin.ini (excluding CTB/Mania elements) based on the current wiki information. None of the settings have been implemented yet. Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
@@ -177,11 +177,14 @@ public class SoundController {
|
||||
*/
|
||||
private static String getSoundFileName(String filename) {
|
||||
String wav = String.format("%s.wav", filename), mp3 = String.format("%s.mp3", filename);
|
||||
File skinWAV = new File(Options.getSkinDir(), wav), skinMP3 = new File(Options.getSkinDir(), mp3);
|
||||
if (skinWAV.isFile())
|
||||
return skinWAV.getAbsolutePath();
|
||||
if (skinMP3.isFile())
|
||||
return skinMP3.getAbsolutePath();
|
||||
File skinDir = Options.getSkin().getDirectory();
|
||||
if (skinDir != null) {
|
||||
File skinWAV = new File(skinDir, wav), skinMP3 = new File(skinDir, mp3);
|
||||
if (skinWAV.isFile())
|
||||
return skinWAV.getAbsolutePath();
|
||||
if (skinMP3.isFile())
|
||||
return skinMP3.getAbsolutePath();
|
||||
}
|
||||
if (ResourceLoader.resourceExists(wav))
|
||||
return wav;
|
||||
if (ResourceLoader.resourceExists(mp3))
|
||||
|
||||
Reference in New Issue
Block a user