-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathNativeUI.lua
More file actions
244 lines (207 loc) · 7.05 KB
/
NativeUI.lua
File metadata and controls
244 lines (207 loc) · 7.05 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
--[[
_ _ _ _ _ _ ___ _
| \ | | __ _| |_(_)_ _____| | | |_ _| | _ _ __ _
| \| |/ _` | __| \ \ / / _ \ | | || || | | | | |/ _` |
| |\ | (_| | |_| |\ V / __/ |_| || || |__| |_| | (_| |
|_| \_|\__,_|\__|_| \_/ \___|\___/|___|_____\__,_|\__,_|~GTA:O UI Menu
Owner : Frazzle
Git : iTexZoz/NativeUILua
=Releases history 2018 - 2019
[1.0]
-Initial comit
[1.0.1]
-Fixed __resource.lua
[1.0.2]
-Fixed the NativeUI.* functions not working as intended
[1.0.3]
-Fixed a typo that prevented safezone scaling
[1.0.4]
-Fixed mouse tracking that broke after fixing my safezone type..
[1.0.5 ]
-Added support for all resolutions!
[1.0.6]
-Fixed item events
-Added a Colours table filled with the HUD colours
-Fixed mouse on resolutions below 1280x720
-Added text colour and highlight colour options to the :RightLabel() on UIMenuItem
[1.0.7]
-Conflicting function name
[1.0.8]
-Fixed resolution scaling on resolutions > 1920x1080
[1.0.9]
-Removed all mentions of a function that is no longer used and breaks the script
[1.1.0]
-Fixed scaling on 3840x1080
[2.0.0]
-Lots of bug fixes
-Panels
-Windows
[2.1.0]
-More bug fixes related to resolution and positioning.
-Added UIMenuProgressItem item
[2.1.1]
-Diverses résolutions de bugs (comme les UIMenuColouredItem)
-Divers ajouts tel que le UIMenuSliderHeritageItem et bien d'autres...
-Quelques résolutions de problèmes mineurs au niveau de l'interface tel que les "arrowleft" / "arrowright" de UIMenuListItem.
-Quelques ajouts de configurations supplémentaires pour certains éléments.
-Un exemple complet de toutes les features disponibles dans cette version.
-Modifications de certains bruits sonores du menu lors de l'utilisation des sliders.
-Modification possible de la couleur/opacité de la banière du menu et des sliders.
-Possibilité d'ajouter des badges et des labels sur les submenus.
-Possibilité de modifier la couleur/opacité du background et de la barre de progression.
[2.1.2]
...
--TODO Ajout d'un systeme d'actualisation de badge dynamique, (comme warmenu)
--TODO Ajout de badge custome possible.
--TODO Resoudre des problémes mineurs sur l'interface.
--TODO ...
]]--
NativeUI = {}
---CreatePool
function NativeUI.CreatePool()
return MenuPool.New()
end
---CreateMenu
---@param Title string
---@param Subtitle string
---@param X number
---@param Y number
---@param TxtDictionary string
---@param TxtName string
---@param Heading number
---@param R number
---@param G number
---@param B number
---@param A number
function NativeUI.CreateMenu(Title, Subtitle, X, Y, TxtDictionary, TxtName, Heading, R, G, B, A)
return UIMenu.New(Title, Subtitle, X, Y, TxtDictionary, TxtName, Heading, R, G, B, A)
end
---CreateItem
---@param Text string
---@param Description string
function NativeUI.CreateItem(Text, Description)
return UIMenuItem.New(Text, Description)
end
---CreateColouredItem
---@param Text string
---@param Description string
---@param MainColour table
---@param HighlightColour table
function NativeUI.CreateColouredItem(Text, Description, MainColour, HighlightColour)
return UIMenuColouredItem.New(Text, Description, MainColour, HighlightColour)
end
---CreateCheckboxItem
---@param Text string
---@param Check boolean
---@param Description string
function NativeUI.CreateCheckboxItem(Text, Check, Description)
return UIMenuCheckboxItem.New(Text, Check, Description)
end
---CreateListItem
---@param Text string
---@param Items number
---@param Index table
---@param Description string
function NativeUI.CreateListItem(Text, Items, Index, Description)
return UIMenuListItem.New(Text, Items, Index, Description)
end
---CreateSliderItem
---@param Text string
---@param Items number
---@param Index table
---@param Description string
---@param Divider boolean
---@param SliderColors table
---@param BackgroundSliderColors table
function NativeUI.CreateSliderItem(Text, Items, Index, Description, Divider, SliderColors, BackgroundSliderColors)
return UIMenuSliderItem.New(Text, Items, Index, Description, Divider, SliderColors, BackgroundSliderColors)
end
---CreateSliderHeritageItem
---@param Text string
---@param Items number
---@param Index table
---@param Description string
---@param SliderColors table
---@param BackgroundSliderColors table
function NativeUI.CreateSliderHeritageItem(Text, Items, Index, Description, SliderColors, BackgroundSliderColors)
return UIMenuSliderHeritageItem.New(Text, Items, Index, Description, SliderColors, BackgroundSliderColors)
end
---CreateProgressItem
---@param Text string
---@param Items number
---@param Index table
---@param Description number
---@param Counter boolean
function NativeUI.CreateProgressItem(Text, Items, Index, Description, Counter)
return UIMenuProgressItem.New(Text, Items, Index, Description, Counter)
end
---CreateHeritageWindow
---@param Mum number
---@param Dad number
function NativeUI.CreateHeritageWindow(Mum, Dad)
return UIMenuHeritageWindow.New(Mum, Dad)
end
---CreateGridPanel
---@param TopText string
---@param LeftText string
---@param RightText string
---@param BottomText string
function NativeUI.CreateGridPanel(TopText, LeftText, RightText, BottomText)
return UIMenuGridPanel.New(TopText, LeftText, RightText, BottomText)
end
---CreateColourPanel
---@param Title string
---@param Colours table
function NativeUI.CreateColourPanel(Title, Colours)
return UIMenuColourPanel.New(Title, Colours)
end
---CreatePercentagePanel
---@param MinText string
---@param MaxText string
function NativeUI.CreatePercentagePanel(MinText, MaxText)
return UIMenuPercentagePanel.New(MinText, MaxText)
end
---CreateSprite
---@param TxtDictionary string
---@param TxtName string
---@param X number
---@param Y number
---@param Width number
---@param Height number
---@param Heading number
---@param R number
---@param G number
---@param B number
---@param A number
function NativeUI.CreateSprite(TxtDictionary, TxtName, X, Y, Width, Height, Heading, R, G, B, A)
return Sprite.New(TxtDictionary, TxtName, X, Y, Width, Height, Heading, R, G, B, A)
end
---CreateRectangle
---@param X number
---@param Y number
---@param Width number
---@param Height number
---@param R number
---@param G number
---@param B number
---@param A number
function NativeUI.CreateRectangle(X, Y, Width, Height, R, G, B, A)
return UIResRectangle.New(X, Y, Width, Height, R, G, B, A)
end
---CreateText
---@param Text string
---@param X number
---@param Y number
---@param Scale number
---@param R number
---@param G number
---@param B number
---@param A number
---@param Font number
---@param Alignment number
---@param DropShadow number
---@param Outline number
---@param WordWrap number
function NativeUI.CreateText(Text, X, Y, Scale, R, G, B, A, Font, Alignment, DropShadow, Outline, WordWrap)
return UIResText.New(Text, X, Y, Scale, R, G, B, A, Font, Alignment, DropShadow, Outline, WordWrap)
end