-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.lua
More file actions
103 lines (79 loc) · 1.94 KB
/
api.lua
File metadata and controls
103 lines (79 loc) · 1.94 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
-- SPDX-FileCopyrightText: 2026 barny
-- SPDX-License-Identifier: Artistic-2.0
local lib = LibAbilities or {}
local function GetCache()
return lib._state.cache
end
local function GetCallbacks()
return lib._state.callbacks
end
local cache = GetCache()
local callbacks = GetCallbacks()
local sl = cache.skillLines
local a = cache.abilities
local sa = cache.actionSlots
local wa = cache.weaponAbilities
--------------------
---- Public API ----
--------------------
function lib.GetAllData()
return cache
end
function lib.GetSkillLineData()
return sl
end
function lib.GetAbilityData()
return a
end
function lib.GetSlottedAbilities()
return sa
end
function lib.GetWeaponAbilities()
return wa
end
function lib.GetAvailableSkillLines()
return sl.skillLineIds
end
function lib.GetAvailableSkillLineNames()
return sl.skillLineNames
end
function lib.GetAvailableClassSkillLines()
return sl.classSkillLineIds
end
function lib.GetCurrentSkillLineClassIds()
return sl.activeSkillLineClassIds
end
function lib.GetCurrentSkillLineClasses()
return sl.activeSkillLineClasses
end
function lib.GetAvailableAbilities()
return a.availableAbilities
end
function lib.GetAvailableActiveAbilities()
return a.availableActiveAbilities
end
function lib.GetAvailablePassives()
return a.availablePassives
end
function lib.GetAvailableUltimates()
return a.availableUltimates
end
function lib.IsSkillLineAvailable(skillLineId)
return sl.skillLineIds[skillLineId] and true or false
end
function lib.IsAbilityAvailable(abilityId)
return a.availableAbilities[abilityId] and true or false
end
function lib.IsPlayerSubclassing()
return not sl.isPureClass
end
function lib.IsAbilitySlotted(abilityId)
return sa.list[abilityId] and true or false
end
------------------------------
-- CALLBACKS
------------------------------
function lib.RegisterCallback(eventName, func)
if not callbacks[eventName] then callbacks[eventName] = {} end
table.insert(callbacks[eventName], func)
end