felony_rework-port/patches-extra/modloader.patch

44 lines
1.1 KiB
Diff

--- loadfiles.lua 2023-11-13 00:55:37.873746068 +0100
+++ loadfiles_modded.lua 2023-11-13 00:54:23.913742488 +0100
@@ -303,6 +303,30 @@
Menu.ShowMain = 0
end
end
+UserLuaMediaPath = MediaPath .. "\\UserLuaScripts"
+function user_open(filename)
+
+ print("[NOTE] loading user file '" .. filename .. "'")
+
+ local error, f = ScriptLoader.ri_dofilefromdisk(UserLuaMediaPath .. filename)
+
+ if type(f) == "string" then
+ print("\t" .. f)
+ return true, nil
+ elseif type(f) == "function" then
+ f()
+ return true, nil
+ elseif type(f) == "table" then
+ return true, f
+ elseif f == nil then
+ print("\t" .. error)
+ return false, nil
+ else
+ print("Unknown return type???")
+ end
+
+ return false
+end
function _flagGameReadyForLaunch_callback(_autoTestSuite)
return function()
if debugOpen then
@@ -312,6 +336,9 @@
AutoTest.setTestSuite(_autoTestSuite)
end
end
+
+ user_open("modloader.lua")
+
waitForStartScreen()
GameLauncher.SetGameState("Game Started")
Network.setEmulationConfigID(6)