-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.lua
41 lines (33 loc) · 784 Bytes
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--funny require() hack so it can be used with luamod. Go to the init file for start stuff.
local json = require("json")
local function isLuaDebugEnabled()
return package ~= nil
end
local function initGlobalVariable()
if EEVEEMOD == nil then
EEVEEMOD = {}
end
if EEVEEMOD.Src == nil then
EEVEEMOD.Src = {}
end
end
local function unloadEverything()
for k, v in pairs(EEVEEMOD.Src) do
package.loaded[k] = nil
end
end
local vanillaRequire = require
local function patchedRequire(file)
EEVEEMOD.Src[file] = true
return vanillaRequire(file)
end
if isLuaDebugEnabled() then
initGlobalVariable()
unloadEverything()
require = patchedRequire
end
local modInit = require("EeveeReunitedInit")
modInit:init(json)
if isLuaDebugEnabled() then
require = vanillaRequire
end