forked from ItsikNox/RageUI
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRMenu.lua
More file actions
111 lines (96 loc) · 1.96 KB
/
RMenu.lua
File metadata and controls
111 lines (96 loc) · 1.96 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
104
105
106
107
108
109
110
111
---
--- @author Dylan MALANDAIN
--- @version 2.0.0
--- @since 2020
---
--- RageUI Is Advanced UI Libs in LUA for make beautiful interface like RockStar GAME.
---
---
--- Commercial Info.
--- Any use for commercial purposes is strictly prohibited and will be punished.
---
--- @see RageUI
---
---@class RageUI
RageUI = {}
---@class Item
RageUI.Item = setmetatable({}, RageUI.Item)
---@class Window
RageUI.Window = setmetatable({}, RageUI.Window)
---@class Panel
RageUI.Panel = setmetatable({}, RageUI.Panel)
---@class RMenu
RMenu = setmetatable({}, RMenu)
---@type table
local TotalMenus = {}
---Add
---@param Type string
---@param Name string
---@param Menu table
---@return RMenu
---@public
function RMenu.Add(Type, Name, Menu)
if RMenu[Type] == nil then
RMenu[Type] = {}
end
RMenu[Type][Name] = {
Menu = Menu
}
table.insert(TotalMenus, Menu)
end
---Get
---@param Type string
---@param Name string
---@return RageUIMenus
---@public
function RMenu:Get(Type, Name)
if self[Type] ~= nil and self[Type][Name] ~= nil then
return self[Type][Name].Menu
end
end
---GetType
---@param Type string
---@return table
---@public
function RMenu:GetType(Type)
if self[Type] ~= nil then
return self[Type]
end
end
---Settings
---@param Type string
---@param Name string
---@param Settings string
---@param Value any optional
---@return void
---@public
function RMenu:Settings(Type, Name, Settings, Value)
if Value ~= nil then
self[Type][Name][Settings] = Value
else
return self[Type][Name][Settings]
end
end
---Delete
---@param Type string
---@param Name string
---@return void
---@public
function RMenu:Delete(Type, Name)
self[Type][Name] = nil
collectgarbage()
end
---DeleteType
---@param Type string
---@return void
---@public
function RMenu:DeleteType(Type)
self[Type] = nil
collectgarbage()
end
---GetMenus
---@return table
---@public
function RMenu:GetMenus()
return TotalMenus
end