Used to group multiple scripts together, and easily be able to call them.
Constructor
Variables
Methods
add(script:Script):Void
Adds a script to the pack, and sets the parent/this of the script.
call(func:String, ?parameters:Array<Dynamic>):Dynamic
Calls a function on every single script. Only calls on scripts that are active.
Parameters:
func | Function to call |
---|---|
parameters | Parameters to pass to the function |
contains(path:String):Bool
Checks if the script pack contains a script with a specific path.
Parameters:
path | Path to check |
---|
inlineevent<T>(func:String, event:T):T
Sends an event to every single script, and returns the event.
Parameters:
func | Function to call |
---|---|
event | Event (will be the first parameter of the function) |
Returns:
(modified by scripts)
get(val:String):Dynamic
Gets the first script that has a variable with a specific name.
Parameters:
val | Name of the variable |
---|
importScript(path:String):Script
Imports a script by path.
Parameters:
path | Path to the script |
---|
Throws:
Error | if the script does not exist |
---|
insert(pos:Int, script:Script):Void
Inserts a script into the pack, and sets the parent/this of the script.
remove(script:Script):Void
Removes a script from the pack. Does not reset the parent/this.
Inherited Variables
Defined by Script
remappedNames:Map<String, String> = []
Remapped filenames. Used for trace messages, to show what mod the script is from.
Inherited Methods
Defined by Script
error(text:String, ?additionalInfo:Dynamic):Void
Shows an error from this script.
Parameters:
text | Text of the error (ex: Null Object Reference). |
---|---|
additionalInfo | Additional information you could provide. |
loadFromString(code:String):Script
Loads the code from a string, doesn't really work after the script has been loaded
Parameters:
code | The code. |
---|
onCreate(path:String):Void
Called when the script is created.
Parameters:
path | Path to the script |
---|
setPublicMap(map:Map<String, Dynamic>):Void
HSCRIPT ONLY FOR NOW Sets the "public" variables map for ScriptPack