forked from SpectralPack/Cryptlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
56 lines (50 loc) · 1.91 KB
/
main.lua
File metadata and controls
56 lines (50 loc) · 1.91 KB
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
56
SMODS.Atlas {
key = "modicon",
path = "crylib_icon.png",
px = 34,
py = 34,
}:register()
Spectrallib = {}
SMODS.current_mod.reset_game_globals = function (run_start)
if run_start then
G.GAME.SuitBuffs = {}
for k in pairs(SMODS.Suits) do
G.GAME.SuitBuffs[k] = { level = 1, chips = 0, mult = 0 }
end
G.GAME.SuitBuffs.suitless = { level = 1, chips = 0, mult = 0 }
end
end
local files = {
{path = "other_utils"},
{path = "blind_functions"},
{path = "modpage_ui"},
{path = "Cryptlib/main", redirect = "Cryptid"},
{path = "Cryptlib/talisman", redirect = "Cryptid"}, -- this is probably not needed with amulet existing but back compat so shrug
{path = "Cryptlib/manipulate", redirect = "Cryptid"},
{path = "Cryptlib/forcetrigger", redirect = "Cryptid"},
{path = "Cryptlib/utilities", redirect = "Cryptid"},
{path = "Cryptlib/content_sets", redirect = "Cryptid"},
{path = "Cryptlib/ascended", redirect = "Cryptid"},
{path = "Cryptlib/unredeem", redirect = "Cryptid"},
{path = "Cryptlib/colours"}, -- this doesn't have an equivalent in cryptid currently
{path = "Entropy/utils", redirect = "Entropy"},
{path = "Entropy/hand_stuff", redirect = "Entropy"},
{path = "Entropy/suit_levels", redirect = "Entropy"},
{path = "Entropy/return_values", redirect = "Entropy"},
{path = "Entropy/deck_redeeming", redirect = "Entropy"},
{path = "Entropy/card_buttons", redirect = "Entropy"},
}
for i, v in pairs(files) do
if v.redirect then
_G[v.redirect] = _G[v.redirect] or {}
setmetatable(Spectrallib, {
__newindex = function(table, key, value)
rawset(table, key, value)
_G[v.redirect][key] = value
end
})
end
local file, err = SMODS.load_file(v.path..".lua")
if file then file()
else error("Error in file: "..v.path.." "..err) end
end