forked from Starmapo/FNF-PsychEngine-Extra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SkinData.hx
41 lines (40 loc) · 1.57 KB
/
SkinData.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
class SkinData {
public static function getNoteFile(file:String, folder:String, ?skin:String) {
if (skin == null) skin = ClientPrefs.noteSkin;
skin = Paths.formatToSongPath(skin);
var path = 'noteskins/$skin/$folder/$file';
//trace(path);
if (!Paths.existsPath('images/$path.png', IMAGE)) {
path = 'noteskins/default/$folder/$file';
//trace(path);
}
if (!Paths.existsPath('images/$path.png', IMAGE)) {
path = 'noteskins/default/base/$file';
//trace(path);
}
if (!Paths.existsPath('images/$path.png', IMAGE)) {
path = (folder == 'pixel' && Paths.existsPath('images/pixelUI/$file.png', IMAGE) ? 'pixelUI' : '') + file;
//trace(path);
}
return path;
}
public static function getUIFile(file:String, folder:String, ?skin:String) {
if (skin == null) skin = ClientPrefs.uiSkin;
skin = Paths.formatToSongPath(skin);
var path = 'uiskins/$skin/$folder/$file';
//trace(path);
if (!Paths.existsPath('images/$path.png', IMAGE)) {
path = 'uiskins/default/$folder/$file';
//trace(path);
}
if (!Paths.existsPath('images/$path.png', IMAGE)) {
path = 'uiskins/default/base/$file';
//trace(path);
}
if (!Paths.existsPath('images/$path.png', IMAGE)) {
path = (folder == 'pixel' && Paths.existsPath('images/pixelUI/$file.png', IMAGE) ? 'pixelUI' : '') + file;
//trace(path);
}
return path;
}
}