Added initial support for loading user skins.
- "Skins" directory is created in the root folder, and reads files directly from there (for now). NOT ALL FILES ARE SUPPORTED.
- To change the path (e.g. to an installed skin), edit the path in the configuration file.
Other changes:
- Renamed some files: directories now begin with a capital letter (to match osu! naming), and '.osu_tmp' renamed to '.opsu_tmp'.
- Disabled mouse grabbing, as this does not seem to work properly for touchscreen devices. (partial revert of ab487c5)
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
@@ -131,21 +131,30 @@ public class Utils {
|
||||
Log.error("Failed to set the cursor.", e);
|
||||
}
|
||||
|
||||
// load cursor images
|
||||
// load cursor images (TODO: cleanup)
|
||||
boolean skinCursor = new File(Options.getSkinDir(), "cursor.png").isFile();
|
||||
if (Options.isNewCursorEnabled()) {
|
||||
// load new cursor type
|
||||
try {
|
||||
// if skin cursor exists but middle part does not, don't load default middle
|
||||
if (skinCursor && !new File(Options.getSkinDir(), "cursormiddle.png").isFile())
|
||||
;
|
||||
else {
|
||||
cursorMiddle = new Image("cursormiddle.png");
|
||||
cursor = new Image("cursor.png");
|
||||
cursorTrail = new Image("cursortrail.png");
|
||||
} catch (Exception e) {
|
||||
// optional
|
||||
}
|
||||
}
|
||||
if (cursorMiddle == null) {
|
||||
// load old cursor type
|
||||
cursor = new Image("cursor2.png");
|
||||
cursorTrail = new Image("cursortrail2.png");
|
||||
// default is stored as *2.png, but load skin cursor if it exists
|
||||
if (skinCursor)
|
||||
cursor = new Image("cursor.png");
|
||||
else
|
||||
cursor = new Image("cursor2.png");
|
||||
if (new File(Options.getSkinDir(), "cursortrail.png").isFile())
|
||||
cursorTrail = new Image("cursortrail.png");
|
||||
else
|
||||
cursorTrail = new Image("cursortrail2.png");
|
||||
}
|
||||
|
||||
// create fonts
|
||||
|
||||
Reference in New Issue
Block a user