-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.scar
38 lines (32 loc) · 1.27 KB
/
init.scar
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
local version = "0.3.0"
---@type ScarModule[]
local modules = loadfile("replay-enhancements\\scar\\modules.scar")()
---@type ReplayEnhancementsConfig
local config = loadfile("replay-enhancements\\config.scar")()
-- init template
-- dofile("replay-enhancements\\init.scar")
function ReplayEnhancements_Init()
-- in-game SCAR VM
if __replayenhancements_loader == "autotest" then
for _, module in ipairs(modules) do
-- Tests load "common" and "tests" scopes
if module.scope == "mod" then
loadfile(module.filepath)()
end
end
-- in-game console SCAR VM
else
for _, module in ipairs(modules) do
if module.scope == "common" or module.scope == "mod" then
-- Any string manipulation (catenation, string.format) seems to reduce escaped directory separators
Scar_DoString(string.format([[loadfile("%s")()]], module.filepath:gsub("\\", "\\\\")))
end
end
bind("CONTROL+D", [[Scar_DoString("ReplayEnhancements_RemoveClosestEventIndicator()")]])
end
print(string.format("Replay enhancements version %s initialized!", version))
if config.enable_debug then
print("Debugging is enabled!")
end
end
ReplayEnhancements_Init()