Paths
| Kind | class |
| Package | backend |
| Full name | backend.Paths |
| Source | source/backend/Paths.hx |
| Metadata | @:access(openfl.display.BitmapData) |
@:nullSafety // not yet
Public fields
| Name | Type | Static | Default | Notes |
|---|---|---|---|---|
SOUND_EXT | — | yes | #if (web || flash) "mp3" #else "ogg" #end | — |
VIDEO_EXT | — | yes | "mp4" | — |
IMAGE_EXT | — | yes | "png" | — |
defaultNoteSprite | FlxSprite | yes | — | — |
noteSkinFramesMap | Map<String, FlxFramesCollection> | yes | new Map() | — |
noteSkinAnimsMap | Map<String, FlxAnimationController> | yes | new Map() | — |
splashSkinFramesMap | Map<String, FlxFramesCollection> | yes | new Map() | — |
splashSkinAnimsMap | Map<String, FlxAnimationController> | yes | new Map() | — |
splashConfigs | Map<String, objects.NoteSplash.NoteSplashConfig> | yes | new Map() | — |
splashAnimCountMap | Map<String, Int> | yes | new Map() | — |
defaultSkin | — | yes | 'noteskins/NOTE_assets' + NoteHelpers.getNoteSkinPostfix() | — |
dumpExclusions | Array<String> | yes | [ | — |
localTrackedAssets | Array<String> | yes | [] | define the locally tracked assets |
currentLevel | String | yes | — | #if !html5 openfl.Assets.cache.clear("songs"); #end |
currentTrackedAssets | Map<String, FlxGraphic> | yes | [] | #if !html5 openfl.Assets.cache.clear("songs"); #end · Loads images. |
warnedMissingAssets | Map<String, Bool> | yes | [] | #if !html5 openfl.Assets.cache.clear("songs"); #end · because the trace is so damn annoying sometimes |
currentTrackedSounds | Map<String, Sound> | yes | [] | #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file); · completely rewritten asset loading? fuck! |
Public methods
initDefaultSkin
static function initDefaultSkin(?noteSkin:String, inEditor:Bool = false)
Function that initializes the first note. This way, we can recycle the notes
| Parameter | Type | Default |
|---|---|---|
noteSkin (optional) | String | — |
inEditor (optional) | Bool | false |
initNote
static function initNote(?noteSkin:String)
| Parameter | Type | Default |
|---|---|---|
noteSkin (optional) | String | — |
initSplash
static function initSplash(?splashSkin:String)
Note Splash initialization
| Parameter | Type | Default |
|---|---|---|
splashSkin (optional) | String | — |
addAnimAndCheck
static function addAnimAndCheck(name:String, anim:String, framerate:Int = 24, loop:Bool = false)
| Parameter | Type | Default |
|---|---|---|
name | String | — |
anim | String | — |
framerate (optional) | Int | 24 |
loop (optional) | Bool | false |
initSplashConfig
static function initSplashConfig(skin:String)
| Parameter | Type | Default |
|---|---|---|
skin | String | — |
excludeAsset
static function excludeAsset(key:String)
| Parameter | Type | Default |
|---|---|---|
key | String | — |
gc
static inline function gc(major:Bool = false, repeat:Int = 1)
| Parameter | Type | Default |
|---|---|---|
major (optional) | Bool | false |
repeat (optional) | Int | 1 |
clearUnusedMemory
static function clearUnusedMemory()
/ haya I love you for the base cache dump I took to the max
clearStoredMemory
static function clearStoredMemory(cleanUnused:Bool = false)
| Parameter | Type | Default |
|---|---|---|
cleanUnused (optional) | Bool | false |
setCurrentLevel
static function setCurrentLevel(name:String)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
| Parameter | Type | Default |
|---|---|---|
name | String | — |
getPath
static function getPath(file:String, type:AssetType = TEXT, library:Null<String> = null, modsAllowed:Bool = false):String
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
| Parameter | Type | Default |
|---|---|---|
file | String | — |
type (optional) | AssetType | TEXT |
library (optional) | Null<String> | null |
modsAllowed (optional) | Bool | false |
readDirectory
static inline function readDirectory(path:String):Array<String>
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
| Parameter | Type | Default |
|---|---|---|
path | String | — |
getLibraryPath
static function getLibraryPath(file:String, library = "preload")
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
| Parameter | Type | Default |
|---|---|---|
file | String | — |
library (optional) | Dynamic | "preload" |
getPreloadPath
static inline function getPreloadPath(file:String = '')
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
| Parameter | Type | Default |
|---|---|---|
file (optional) | String | '' |
getSharedPath
static inline function getSharedPath(file:String = '')
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
| Parameter | Type | Default |
|---|---|---|
file (optional) | String | '' |
file
static inline function file(file:String, type:AssetType = TEXT, ?library:String)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
| Parameter | Type | Default |
|---|---|---|
file | String | — |
type (optional) | AssetType | TEXT |
library (optional) | String | — |
txt
static inline function txt(key:String, ?library:String)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
library (optional) | String | — |
xml
static inline function xml(key:String, ?library:String)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
library (optional) | String | — |
json
static inline function json(key:String, ?library:String)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
library (optional) | String | — |
shaderFragment
static inline function shaderFragment(key:String, ?library:String)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
library (optional) | String | — |
shaderVertex
static inline function shaderVertex(key:String, ?library:String)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
library (optional) | String | — |
lua
static inline function lua(key:String, ?library:String)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
library (optional) | String | — |
video
static function video(key:String, library:String = null)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
Video loading (part of it)
| Parameter | Type | Default |
|---|---|---|
key | String | — |
library (optional) | String | null |
sound
static function sound(key:String, ?library:String):Sound
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
Sound loading.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
library (optional) | String | — |
soundRandom
static inline function soundRandom(key:String, min:Int, max:Int, ?library:String)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
Random sound loading.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
min | Int | — |
max | Int | — |
library (optional) | String | — |
music
static inline function music(key:String, ?library:String):Sound
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
Music loading. Loads anything in assets/data/music, OR mods/data/music (if mods are allowed)
| Parameter | Type | Default |
|---|---|---|
key | String | — |
library (optional) | String | — |
voices
static function voices(song:String, difficulty:String = '', postfix:String = null):Any
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
Loads the Voices. Crucial for generateSong
| Parameter | Type | Default |
|---|---|---|
song | String | — |
difficulty (optional) | String | '' |
postfix (optional) | String | null |
inst
static function inst(song:String, difficulty:String = ''):Any
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
Loads the instrumental. Crucial for generateSong
| Parameter | Type | Default |
|---|---|---|
song | String | — |
difficulty (optional) | String | '' |
instExists
static function instExists(song:String, difficulty:String = ''):Bool
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
Whether the instrumental for a song can actually be resolved.
inst() hands back a loaded Sound on native builds (an asset URL on
web), never a path -- so FileSystem.exists(Paths.inst(...)) was false for
every song. Freeplay's "JS Engine Anti-Crash Tool" did exactly that, so
picking any song popped a bogus (and, on Windows, modal/blocking) "this
song has no JSON or audio" dialog, and mod songs such as bf-clicker never
got to load their scripts. Use this Bool helper for existence
checks and keep inst() for actually loading the audio.
| Parameter | Type | Default |
|---|---|---|
song | String | — |
difficulty (optional) | String | '' |
voicesExists
static function voicesExists(song:String, difficulty:String = ''):Bool
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
Whether the vocal track for a song can actually be resolved.
Same rationale as instExists -- voices() returns a Sound, not a path.
| Parameter | Type | Default |
|---|---|---|
song | String | — |
difficulty (optional) | String | '' |
playMenuMusic
static function playMenuMusic(force:Bool = false, volume:Float = 1):Void
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
| Parameter | Type | Default |
|---|---|---|
force (optional) | Bool | false |
volume (optional) | Float | 1 |
songEvents
static function songEvents(song:String, ?difficulty:String, onlyEventsString:Bool = false):String
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
For song events.
| Parameter | Type | Default |
|---|---|---|
song | String | — |
difficulty (optional) | String | — |
onlyEventsString (optional) | Bool | false |
imagePath
static inline function imagePath(key:String, ?folder:String):String
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
folder (optional) | String | — |
imageExists
static inline function imageExists(key:String, ?folder:String):Bool
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
folder (optional) | String | — |
image
static function image(key:String, parentFolder:String = null):FlxGraphic
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
parentFolder (optional) | String | null |
cacheBitmap
static function cacheBitmap(key:String, parentFolder:String = null, ?bitmap:BitmapData):FlxGraphic
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
parentFolder (optional) | String | null |
bitmap (optional) | BitmapData | — |
getTextFromFile
static function getTextFromFile(key:String, ignoreMods:Bool = false):String
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file);.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
ignoreMods (optional) | Bool | false |
font
static inline function font(key:String)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file);.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
fileExists
static function fileExists(key:String, type:AssetType, ignoreMods:Bool = false)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file);.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
type | AssetType | — |
ignoreMods (optional) | Bool | false |
exists
static inline function exists(key:String, type:AssetType = null, ?library:String)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file);.
temp shit lol
| Parameter | Type | Default |
|---|---|---|
key | String | — |
type (optional) | AssetType | null |
library (optional) | String | — |
existsPath
static inline function existsPath(key:String, type:AssetType = null, ?library:String)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file);.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
type (optional) | AssetType | null |
library (optional) | String | — |
getContent
static inline function getContent(path:String)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file);.
| Parameter | Type | Default |
|---|---|---|
path | String | — |
getAtlas
static function getAtlas(key:String, parentFolder:String = null):FlxAtlasFrames
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file);.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
parentFolder (optional) | String | null |
getMultiAtlas
static function getMultiAtlas(keys:Array<String>, parentFolder:String = null):FlxAtlasFrames
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file);.
| Parameter | Type | Default |
|---|---|---|
keys | Array<String> | — |
parentFolder (optional) | String | null |
getSparrowAtlas
static inline function getSparrowAtlas(key:String, parentFolder:String = null):FlxAtlasFrames
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file);.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
parentFolder (optional) | String | null |
getPackerAtlas
static inline function getPackerAtlas(key:String, parentFolder:String = null):FlxAtlasFrames
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file);.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
parentFolder (optional) | String | null |
getAsepriteAtlas
static inline function getAsepriteAtlas(key:String, parentFolder:String = null, allowGPU:Bool = true):FlxAtlasFrames
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file);.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
parentFolder (optional) | String | null |
allowGPU (optional) | Bool | true |
formatToSongPath
static inline function formatToSongPath(path:String)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file);.
| Parameter | Type | Default |
|---|---|---|
path | String | — |
returnSound
static function returnSound(path:String, key:String, ?library:String, stream:Bool = false)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file);.
Returns sounds which is useful for all the sfx
| Parameter | Type | Default |
|---|---|---|
path | String | — |
key | String | — |
library (optional) | String | — |
stream (optional) | Bool | false |
mods
static inline function mods(key:String = '')
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file); + #if MODS_ALLOWED.
Loads mods.
| Parameter | Type | Default |
|---|---|---|
key (optional) | String | '' |
modsFont
static inline function modsFont(key:String)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file); + #if MODS_ALLOWED.
Loads fonts in mods/fonts.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
modsJson
static inline function modsJson(key:String)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file); + #if MODS_ALLOWED.
Loads jsons in mods/data.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
modsVideo
static inline function modsVideo(key:String)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file); + #if MODS_ALLOWED.
Loads videos in mods/videos.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
modsSounds
static inline function modsSounds(path:String, key:String)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file); + #if MODS_ALLOWED.
Loads sounds in mods/sounds.
| Parameter | Type | Default |
|---|---|---|
path | String | — |
key | String | — |
modsImages
static inline function modsImages(key:String)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file); + #if MODS_ALLOWED.
Loads images in mods/images.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
modsXml
static inline function modsXml(key:String)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file); + #if MODS_ALLOWED.
Loads xml files in mods/images.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
modsTxt
static inline function modsTxt(key:String)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file); + #if MODS_ALLOWED.
Loads txt files in mods/images.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
modsImagesJson
static inline function modsImagesJson(key:String)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file); + #if MODS_ALLOWED.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
playModMusic
static function playModMusic(file:String, fallback:String, volume:Float = 1):Void
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file); + #if MODS_ALLOWED.
| Parameter | Type | Default |
|---|---|---|
file | String | — |
fallback | String | — |
volume (optional) | Float | 1 |
modFolders
static function modFolders(key:String)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file); + #if MODS_ALLOWED.
| Parameter | Type | Default |
|---|---|---|
key | String | — |
getBackupFilePath
static function getBackupFilePath(songPath:String, diff:String):String
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file); + #if MODS_ALLOWED.
| Parameter | Type | Default |
|---|---|---|
songPath | String | — |
diff | String | — |
loadAnimateAtlas
static function loadAnimateAtlas(spr:FlxAnimate, folderOrImg:Dynamic, spriteJson:Dynamic = null, animationJson:Dynamic = null)
Only compiled when #if !html5 openfl.Assets.cache.clear("songs"); #end + #if MODS_ALLOWED if (FileSystem.exists(file)) bitmap = BitmapData.fromFile(file); + #if flxanimate.
| Parameter | Type | Default |
|---|---|---|
spr | FlxAnimate | — |
folderOrImg | Dynamic | — |
spriteJson (optional) | Dynamic | null |
animationJson (optional) | Dynamic | null |
Internals
Private / internal members
| Field | Type | Static |
|---|---|---|
splashFrames | FlxFramesCollection | yes |
splashAnimation | FlxAnimationController | yes |
| Method |
|---|
static inline function destroyGraphic(graphic:FlxGraphic) |
static inline function getLibraryPathForce(file:String, library:String, ?level:String) |
static function songAudioExists(song:String, file:String, difficulty:String = ''):Bool |