FunkinLua
| Kind | class |
| Package | psychlua |
| Full name | psychlua.FunkinLua |
| Source | source/psychlua/FunkinLua.hx |
Public fields
| Name | Type | Static | Default | Notes |
|---|---|---|---|---|
Function_Stop | Dynamic | yes | "##PSYCHLUA_FUNCTIONSTOP" | — |
Function_Continue | Dynamic | yes | "##PSYCHLUA_FUNCTIONCONTINUE" | — |
Function_StopLua | Dynamic | yes | "##PSYCHLUA_FUNCTIONSTOPLUA" | — |
lua | State | no | null | #if LUA_ALLOWED · public var errorHandler:String->Void; |
camTarget | FlxCamera | no | — | — |
scriptName | String | no | '' | — |
modFolder | String | no | null | — |
closed | Bool | no | false | — |
sandboxed | Bool | no | false | Runtime half of the softmod sandbox; populated before Lua is created. |
securityModName | String | no | null | — |
securityAllowlist | Array<String> | no | [] | — |
hscript | HScript | no | null | #if HSCRIPT_ALLOWED |
callbacks | Map<String, Dynamic> | no | [] | — |
customFunctions | Map<String, Dynamic> | yes | [] | — |
registeredFunctions | Map<String, Dynamic> | yes | [] | — |
lastCalledFunction | String | no | '' | #if LUA_ALLOWED + #if ACHIEVEMENTS_ALLOWED Achievements.addLuaCallbacks(lua); #end + #if HSCRIPT_ALLOWED HScript.implement(this); #end |
lastCalledScript | FunkinLua | yes | null | #if LUA_ALLOWED + #if ACHIEVEMENTS_ALLOWED Achievements.addLuaCallbacks(lua); #end + #if HSCRIPT_ALLOWED HScript.implement(this); #end |
Public methods
new (constructor)
function new(scriptName:String, ?scriptCode:String)
| Parameter | Type | Default |
|---|---|---|
scriptName | String | — |
scriptCode (optional) | String | — |
reportSecurityRuntime
function reportSecurityRuntime(capability:String, line:Int = 0):String
Only compiled when #if LUA_ALLOWED + #if ACHIEVEMENTS_ALLOWED Achievements.addLuaCallbacks(lua); #end + #if HSCRIPT_ALLOWED HScript.implement(this); #end.
Log a runtime guard failure to both the mod console and the process log.
| Parameter | Type | Default |
|---|---|---|
capability | String | — |
line (optional) | Int | 0 |
reportSecurityFinding
function reportSecurityFinding(context:String, finding:ScriptSecurityFinding):Void
Only compiled when #if LUA_ALLOWED + #if ACHIEVEMENTS_ALLOWED Achievements.addLuaCallbacks(lua); #end + #if HSCRIPT_ALLOWED HScript.implement(this); #end.
| Parameter | Type | Default |
|---|---|---|
context | String | — |
finding | ScriptSecurityFinding | — |
allowsSecurityRule
inline function allowsSecurityRule(rule:String):Bool
Only compiled when #if LUA_ALLOWED + #if ACHIEVEMENTS_ALLOWED Achievements.addLuaCallbacks(lua); #end + #if HSCRIPT_ALLOWED HScript.implement(this); #end.
| Parameter | Type | Default |
|---|---|---|
rule | String | — |
allowClassAccess
function allowClassAccess(className:String):Bool
Only compiled when #if LUA_ALLOWED + #if ACHIEVEMENTS_ALLOWED Achievements.addLuaCallbacks(lua); #end + #if HSCRIPT_ALLOWED HScript.implement(this); #end.
| Parameter | Type | Default |
|---|---|---|
className | String | — |
addLocalCallback
function addLocalCallback(name:String, myFunction:Dynamic)
Only compiled when #if LUA_ALLOWED + #if ACHIEVEMENTS_ALLOWED Achievements.addLuaCallbacks(lua); #end + #if HSCRIPT_ALLOWED HScript.implement(this); #end.
| Parameter | Type | Default |
|---|---|---|
name | String | — |
myFunction | Dynamic | — |
registerFunction
static function registerFunction(name:String, func:Dynamic):Void
Only compiled when #if LUA_ALLOWED + #if ACHIEVEMENTS_ALLOWED Achievements.addLuaCallbacks(lua); #end + #if HSCRIPT_ALLOWED HScript.implement(this); #end.
| Parameter | Type | Default |
|---|---|---|
name | String | — |
func | Dynamic | — |
setVarInArray
static function setVarInArray(instance:Dynamic, variable:String, value:Dynamic):Any
Only compiled when #if LUA_ALLOWED + #if ACHIEVEMENTS_ALLOWED Achievements.addLuaCallbacks(lua); #end + #if HSCRIPT_ALLOWED HScript.implement(this); #end.
REFACTOR: stateless helpers moved to LuaUtils; kept as forwarding statics for external callers
| Parameter | Type | Default |
|---|---|---|
instance | Dynamic | — |
variable | String | — |
value | Dynamic | — |
getVarInArray
static function getVarInArray(instance:Dynamic, variable:String):Any
Only compiled when #if LUA_ALLOWED + #if ACHIEVEMENTS_ALLOWED Achievements.addLuaCallbacks(lua); #end + #if HSCRIPT_ALLOWED HScript.implement(this); #end.
| Parameter | Type | Default |
|---|---|---|
instance | Dynamic | — |
variable | String | — |
getShader
function getShader(obj:String):FlxRuntimeShader
Only compiled when #if LUA_ALLOWED + #if ACHIEVEMENTS_ALLOWED Achievements.addLuaCallbacks(lua); #end + #if HSCRIPT_ALLOWED HScript.implement(this); #end + #if SHADERS_ALLOWED.
| Parameter | Type | Default |
|---|---|---|
obj | String | — |
call
function call(func:String, args:Array<Dynamic>):Dynamic
Only compiled when #if LUA_ALLOWED + #if ACHIEVEMENTS_ALLOWED Achievements.addLuaCallbacks(lua); #end + #if HSCRIPT_ALLOWED HScript.implement(this); #end.
| Parameter | Type | Default |
|---|---|---|
func | String | — |
args | Array<Dynamic> | — |
getPropertyLoopThingWhatever
static function getPropertyLoopThingWhatever(killMe:Array<String>, checkForTextsToo:Bool = true, getProperty:Bool = true):Dynamic
Only compiled when #if LUA_ALLOWED + #if ACHIEVEMENTS_ALLOWED Achievements.addLuaCallbacks(lua); #end + #if HSCRIPT_ALLOWED HScript.implement(this); #end.
| Parameter | Type | Default |
|---|---|---|
killMe | Array<String> | — |
checkForTextsToo (optional) | Bool | true |
getProperty (optional) | Bool | true |
getObjectDirectly
static function getObjectDirectly(objectName:String, checkForTextsToo:Bool = true):Dynamic
Only compiled when #if LUA_ALLOWED + #if ACHIEVEMENTS_ALLOWED Achievements.addLuaCallbacks(lua); #end + #if HSCRIPT_ALLOWED HScript.implement(this); #end.
| Parameter | Type | Default |
|---|---|---|
objectName | String | — |
checkForTextsToo (optional) | Bool | true |
set
function set(variable:String, data:Dynamic)
Only compiled when #if LUA_ALLOWED + #if ACHIEVEMENTS_ALLOWED Achievements.addLuaCallbacks(lua); #end + #if HSCRIPT_ALLOWED HScript.implement(this); #end.
| Parameter | Type | Default |
|---|---|---|
variable | String | — |
data | Dynamic | — |
stop
function stop()
Only compiled when #if LUA_ALLOWED + #if ACHIEVEMENTS_ALLOWED Achievements.addLuaCallbacks(lua); #end + #if HSCRIPT_ALLOWED HScript.implement(this); #end.
getInstance
static inline function getInstance()
Only compiled when #if LUA_ALLOWED + #if ACHIEVEMENTS_ALLOWED Achievements.addLuaCallbacks(lua); #end + #if HSCRIPT_ALLOWED HScript.implement(this); #end.
REFACTOR: body moved to LuaUtils; kept as forwarding static for external callers
Internals
Private / internal members
| Field | Type | Static |
|---|---|---|
storedFilters | Map<String, ShaderFilter> | yes |
_missingCalls | Map<String, Bool> | no |
| Method |
|---|
static inline function getTextObject(name:String):FlxText |
function initLuaShader(name:String, glslVersion:Int = 120) |
function getGroupStuff(leArray:Dynamic, variable:String) |
function loadFrames(spr:FlxSprite, image:String, spriteType:String) |
function setGroupStuff(leArray:Dynamic, variable:String, value:Dynamic) |
function resetTextTag(tag:String) |
function resetSpriteTag(tag:String) |
function cancelTween(tag:String) |
function tweenPrepare(tag:String, vars:String) |
function cancelTimer(tag:String) |
static function addAnimByIndices(obj:String, name:String, prefix:String, indices:String, framerate:Int = 24, loop:Bool = false) |