Some better hscript error reporting when using source folder
This commit is contained in:
@@ -24,7 +24,7 @@ using StringTools;
|
||||
interface ModsAssetLibrary {
|
||||
public var prefix:String;
|
||||
public var libName:String;
|
||||
|
||||
|
||||
#if MOD_SUPPORT
|
||||
public var _parsedAsset:String;
|
||||
|
||||
@@ -35,7 +35,7 @@ interface ModsAssetLibrary {
|
||||
private function __parseAsset(asset:String):Bool;
|
||||
|
||||
public function getFiles(folder:String):Array<String>;
|
||||
|
||||
|
||||
public function getFolders(folder:String):Array<String>;
|
||||
#end
|
||||
}
|
||||
@@ -27,7 +27,7 @@ class ModsFolder {
|
||||
* INTERNAL - Only use when editing source mods!!
|
||||
*/
|
||||
@:dox(hide) public static var onModSwitch:FlxTypedSignal<String->Void> = new FlxTypedSignal<String->Void>();
|
||||
|
||||
|
||||
/**
|
||||
* Current mod folder. Will affect `Paths`.
|
||||
*/
|
||||
@@ -49,12 +49,12 @@ class ModsFolder {
|
||||
* Initialises `mods` folder by adding callbacks and such.
|
||||
*/
|
||||
public static function init() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Switches mod - unloads all the other mods, then load this one.
|
||||
* @param libName
|
||||
* @param libName
|
||||
*/
|
||||
public static function switchMod(mod:String) {
|
||||
Options.lastLoadedMod = currentModFolder = mod;
|
||||
|
||||
@@ -18,7 +18,7 @@ class GlobalScript {
|
||||
|
||||
Conductor.onBeatHit.add(beatHit);
|
||||
Conductor.onStepHit.add(stepHit);
|
||||
|
||||
|
||||
FlxG.signals.focusGained.add(function() {
|
||||
call("focusGained");
|
||||
});
|
||||
|
||||
@@ -66,7 +66,7 @@ class HScript extends Script {
|
||||
var expr:Expr = null;
|
||||
try {
|
||||
if (code != null && code.trim() != "")
|
||||
expr = parser.parseString(code);
|
||||
expr = parser.parseString(code, cl.join("/") + "." + hxExt);
|
||||
} catch(e:Error) {
|
||||
_errorHandler(e);
|
||||
} catch(e) {
|
||||
|
||||
@@ -144,7 +144,7 @@ class AssetsLibraryList extends AssetLibrary {
|
||||
if (!__defaultLibraries.contains(l))
|
||||
l.unload();
|
||||
}
|
||||
|
||||
|
||||
public function reset() {
|
||||
unloadLibraries();
|
||||
|
||||
|
||||
@@ -253,14 +253,14 @@ class Paths
|
||||
@:privateAccess
|
||||
if (lib.__proxy != null) library = lib.__proxy;
|
||||
}
|
||||
|
||||
|
||||
var content:Array<String> = [];
|
||||
#if MOD_SUPPORT
|
||||
if (library is funkin.mods.ModsAssetLibrary) {
|
||||
// easy task, can immediately scan for files!
|
||||
var lib = cast(library, funkin.mods.ModsAssetLibrary);
|
||||
content = lib.getFiles(libThing.symbolName);
|
||||
if (addPath)
|
||||
if (addPath)
|
||||
for(i in 0...content.length)
|
||||
content[i] = '$folderPath${content[i]}';
|
||||
} else #end {
|
||||
|
||||
Reference in New Issue
Block a user