-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathBootstrap_NN.lua
More file actions
69 lines (56 loc) · 2.07 KB
/
Bootstrap_NN.lua
File metadata and controls
69 lines (56 loc) · 2.07 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
57
58
59
60
61
62
63
64
65
66
67
---@type _,br,NilName
local _,br,nn = ...
local JSON = nn.Utils.JSON
---@class br.Intialization
---@field __index br.Intialization
---@field Startup fun(self: br.Intialization): nil @Starts up the BRLite application
br.Intialization = br.Intialization or {}
function br.Intialization:Startup()
self.__index = self
br.Logging:Log("BRLite Initialization Starting TOC: " .. br.clientTOC)
local Includefile = "/scripts/BRLite/include.json"
local IncludeData = nn.ReadFile(Includefile)
if not IncludeData then
br.Logging:Log("ERROR: Unable to read include file: " .. Includefile)
return
end
local inclusions = JSON.decode(IncludeData)
-- Unlocker specific Includes
local unlocker = "UNLOCKER-" .. br.unlocker
if inclusions[unlocker] then
for _, file in pairs(inclusions[unlocker]) do
if not nn.FileExists("/scripts/BRLite/" .. file) then
br.Logging:Log("ERROR: Include file not found: " .. file)
return
end
nn:Require("/scripts/BRLite/" .. file,br,nn)
end
end
--- EARLY INCLUDES
for _, file in pairs(inclusions["EARLY"]) do
if not nn.FileExists("/scripts/BRLite/" .. file) then
br.Logging:Log("ERROR: Include file not found: " .. file)
return
end
nn:Require("/scripts/BRLite/" .. file,br,nn)
end
--TOC Specific Includes
local toc = "TOC-" .. br.clientTOC
if inclusions[toc] then
for _, file in pairs(inclusions[toc]) do
if not nn.FileExists("/scripts/BRLite/" .. file) then
br.Logging:Log("ERROR: Include file not found: " .. file)
return
end
nn:Require("/scripts/BRLite/" .. file,br,nn)
end
end
--- LATE INCLUDES
for _, file in pairs(inclusions["LATE"]) do
if not nn.FileExists("/scripts/BRLite/" .. file) then
br.Logging:Log("ERROR: Include file not found: " .. file)
return
end
nn:Require("/scripts/BRLite/" .. file,br,nn)
end
end