-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcoresystem.lua
55 lines (51 loc) · 1.08 KB
/
coresystem.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
if TheFixes then
return
end
TheFixes = {
-- mods/The Fixes/
ModPath = ModPath,
fire_dot = true,
gambler = true,
cops_reload = true,
instant_quit = true,
last_msg_id = '',
language = 1,
_hooks = {},
_cache = {}
}
function TheFixes:CheckHook(hook)
if self._hooks[hook] then
return true
end
self._hooks[hook] = true
return false
end
function TheFixes:CheckLoadHook(hook)
if not Global.load_level then
return true
end
if self._hooks[hook] then
return true
end
self._hooks[hook] = true
return false
end
local function LoadSettings()
local file = io.open(SavePath .. 'The Fixes.txt', "r")
if file then
for k, v in pairs(json.decode(file:read("*all")) or {}) do
if TheFixes[k] ~= nil then
TheFixes[k] = v
elseif k == 'override' and type(v) == 'table' then
TheFixesPreventer = TheFixesPreventer or {}
TheFixesPreventerOverride = TheFixesPreventerOverride or {}
for k2, v2 in pairs(v) do
TheFixesPreventer[k2] = v2 or nil
TheFixesPreventerOverride[k2] = v2
end
end
end
file:close()
end
end
LoadSettings()