fixed fonts + more customizable stuff
This commit is contained in:
+9
-1
@@ -154,7 +154,9 @@
|
||||
<haxedef name="HXCPP_DEBUG_LINK" if="release" />
|
||||
<haxedef name="hscriptPos" /> <!-- for logging -->
|
||||
|
||||
<!-- ENGINE SETTINGS !-->
|
||||
<!--
|
||||
ENGINE SETTINGS
|
||||
!-->
|
||||
|
||||
<!-- Comment this out to disable titlescreen.xml !-->
|
||||
<haxedef name="TITLESCREEN_XML" />
|
||||
@@ -167,4 +169,10 @@
|
||||
|
||||
<!-- Comment this out to disable softcoded states and state scripting !-->
|
||||
<haxedef name="SOFTCODED_STATES" />
|
||||
|
||||
<!-- Comment this out to disable usage of source assets when using lime test windows !-->
|
||||
<haxedef name="USE_SOURCE_ASSETS" />
|
||||
|
||||
<!-- Comment this out to use the default OpenFL assets system for the assets/ folder. !-->
|
||||
<haxedef name="USE_ADAPTED_ASSETS" />
|
||||
</project>
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
1333
|
||||
1340
|
||||
@@ -0,0 +1,35 @@
|
||||
package funkin.mods;
|
||||
|
||||
import lime.utils.AssetLibrary;
|
||||
|
||||
/**
|
||||
* Used to prevent crashes
|
||||
*/
|
||||
class ModdableAssetsFolder extends ModsFolderLibrary {
|
||||
public var oldLibrary:AssetLibrary;
|
||||
|
||||
public override function exists(id:String, type:String) {
|
||||
if (!id.startsWith("assets/"))
|
||||
return oldLibrary.exists(id, type);
|
||||
return super.exists(id, type);
|
||||
}
|
||||
|
||||
public override function getAsset(id:String, type:String) {
|
||||
if (!id.startsWith("assets/"))
|
||||
return oldLibrary.getAsset(id, type);
|
||||
return super.getAsset(id, type);
|
||||
}
|
||||
|
||||
public function new(folder:String, libName:String, oldLib:AssetLibrary) {
|
||||
super(folder, libName);
|
||||
oldLibrary = oldLib;
|
||||
trace(Type.getClassName(Type.getClass(oldLibrary)));
|
||||
}
|
||||
|
||||
private override function __parseAsset(asset:String):Bool {
|
||||
var prefix = 'assets/';
|
||||
if (!asset.startsWith(prefix)) return false;
|
||||
_parsedAsset = asset.substr(prefix.length);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -111,10 +111,11 @@ class ModsFolder {
|
||||
return lib;
|
||||
}
|
||||
|
||||
public static function loadLibraryFromFolder(libName:String, folder:String, force:Bool = false) {
|
||||
public static function loadLibraryFromFolder(libName:String, folder:String, force:Bool = false, useOldWhenMissing:Bool = false) {
|
||||
var oldLib = useOldWhenMissing ? Assets.getLibrary(libName) : null;
|
||||
var lib = prepareLibrary(libName, force);
|
||||
@:privateAccess
|
||||
lib.__proxy = new ModsFolderLibrary(folder, libName);
|
||||
lib.__proxy = useOldWhenMissing ? new ModdableAssetsFolder(folder, libName, oldLib) : new ModsFolderLibrary(folder, libName);
|
||||
Assets.registerLibrary(libName, lib);
|
||||
return lib;
|
||||
}
|
||||
|
||||
@@ -125,14 +125,18 @@ class Main extends Sprite
|
||||
|
||||
#if sys
|
||||
if (Sys.args().contains("-livereload")) {
|
||||
#if USE_SOURCE_ASSETS
|
||||
trace("Used lime test windows. Switching into source assets.");
|
||||
ModsFolder.loadLibraryFromFolder('sourceassets', './../../../../assets/');
|
||||
@:privateAccess
|
||||
Paths.__useSourceAssets = true;
|
||||
ModsFolder.loadLibraryFromFolder('default', './../../../../assets/', true, true);
|
||||
#end
|
||||
|
||||
var buildNum:Int = Std.parseInt(File.getContent("./../../../../buildnumber.txt"));
|
||||
buildNum++;
|
||||
File.saveContent("./../../../../buildnumber.txt", Std.string(buildNum));
|
||||
} else {
|
||||
#if USE_ADAPTED_ASSETS
|
||||
ModsFolder.loadLibraryFromFolder('default', './assets/', true, true);
|
||||
#end
|
||||
}
|
||||
#end
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ class Paths
|
||||
* Currently is set to `mp3` for web targets, and `ogg` for other targets.
|
||||
*/
|
||||
inline public static var SOUND_EXT = #if web "mp3" #else "ogg" #end;
|
||||
private static var __useSourceAssets = false;
|
||||
|
||||
public static function getPath(file:String, type:AssetType, library:Null<String>, skipModsVerification:Bool = false)
|
||||
{
|
||||
@@ -32,16 +31,16 @@ class Paths
|
||||
if (library != null)
|
||||
return getLibraryPath(file, library);
|
||||
|
||||
return getPreloadPath(file);
|
||||
return getAssetsPath(file);
|
||||
}
|
||||
|
||||
static public function video(key:String) {
|
||||
return getPath('videos/$key.mp4', BINARY, null);
|
||||
}
|
||||
|
||||
static public function getLibraryPath(file:String, library = "preload")
|
||||
static public function getLibraryPath(file:String, library = "default")
|
||||
{
|
||||
return if (library == "preload" || library == "default") getPreloadPath(file); else getLibraryPathForce(file, library);
|
||||
return if (library == "preload" || library == "default") getAssetsPath(file); else getLibraryPathForce(file, library);
|
||||
}
|
||||
|
||||
inline static function getLibraryPathForce(file:String, library:String)
|
||||
@@ -50,9 +49,9 @@ class Paths
|
||||
return '$library:assets/$library/$file';
|
||||
}
|
||||
|
||||
inline static function getPreloadPath(file:String)
|
||||
inline static function getAssetsPath(file:String)
|
||||
{
|
||||
return (__useSourceAssets) ? getLibraryPathForce(file, 'sourceassets') : 'assets/$file';
|
||||
return 'assets/$file';
|
||||
}
|
||||
|
||||
inline static public function file(file:String, type:AssetType = TEXT, ?library:String)
|
||||
|
||||
Reference in New Issue
Block a user