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:
Jeffrey Han
2015-05-23 23:48:28 -04:00
parent fe8c6a6f02
commit 40e4495030
8 changed files with 791 additions and 24 deletions

View File

@@ -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))