-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
85 lines (72 loc) · 2.1 KB
/
init.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
-- Interface to access the entire Bartmoss suite.
local Bartmoss = {
app = {
name = "Bartmoss Suite",
version = "0.9.0"
}
}
local Logger = require("utility/logger")
local System = require("game/system")
local GameHandler = require("handler/game")
local PlayerHandler = require("handler/player")
local ItemHandler = require("handler/item")
local EquipmentHandler = require("handler/equipment")
local OutfitHack = require("quickhacks/outfits")
local InventoryHack = require("quickhacks/inventory")
local CustomHack = require("quickhacks/custom")
local InspectTool = require("tools/inspect")
local UI = require("ui/ui")
function Bartmoss:New()
-- Do inheritance things.
local I = {}
setmetatable(I, self)
self.__index = self
-- Load modules into memory.
I.Logger = Logger:New()
I.System = System:New()
I.Utility = require("utility/utility")
I.Glossary = require("data/glossary")
I.Handler = {
Game = GameHandler:New(),
Player = PlayerHandler:New(),
Items = ItemHandler:New(),
Equipment = EquipmentHandler:New()
}
I.Quickhacks = {
Outfit = OutfitHack:New(),
Inventory = InventoryHack:New(),
Custom = CustomHack:New()
}
I.Tools = {
Inspect = InspectTool:New()
}
I.UI = UI:New(self.app)
-- Local overload functions.
local function OverloadInit()
I.UI:Init()
end
local function OverloadUpdate(delta)
I.UI:Update(delta)
end
local function OverloadOpen()
I.UI:Open()
end
local function OverloadClose()
I.UI:Close()
end
local function OverloadDraw()
I.UI:Draw()
end
local function OverloadShutdown()
I.UI:Shutdown()
end
-- Attach user interface events.
registerForEvent("onInit", OverloadInit)
registerForEvent("onUpdate", OverloadUpdate)
registerForEvent("onOverlayOpen", OverloadOpen)
registerForEvent("onOverlayClose", OverloadClose)
registerForEvent("onDraw", OverloadDraw)
registerForEvent("onShutdown", OverloadShutdown)
return I
end
return Bartmoss:New()