-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.lua
More file actions
39 lines (31 loc) · 792 Bytes
/
user.lua
File metadata and controls
39 lines (31 loc) · 792 Bytes
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
ui.user = {}
ui.user.list = {}
for i = 1, 32 do
ui.user.list[i] = ui.funcs.deepcopy(ui.config.userPrototype)
end
function ui.user.getObjects(id)
local tbl = {}
if id then
if ui.user.list[id] then
table.insert(tbl, ui.user.list[id].objects)
end
else
for i = 1, 32 do
table.insert(tbl, ui.user.list[i].objects)
end
end
return tbl
end
function ui.user.remove(id)
for k, v in pairs(ui.user.getObjects(id)) do
for a, b in pairs(v) do
for c, d in pairs(b) do
d.remove()
end
end
end
ui.user.list[id] = ui.funcs.deepcopy(ui.config.userPrototype)
end
function ui.user.getObjectId(id, object)
return #ui.user.list[id].objects[object] + 1
end