1
1
_G .VoidUI = _G .VoidUI or {}
2
+ VoidUI .Warning = 0
2
3
VoidUI .mod_path = ModPath
3
4
VoidUI .options_path = SavePath .. " VoidUI.txt"
4
5
VoidUI .options = {}
@@ -141,6 +142,7 @@ function VoidUI:DefaultConfig()
141
142
scoreboard_playtime = true ,
142
143
scoreboard_ping = true ,
143
144
trophies = true ,
145
+ save_warning = false ,
144
146
scoreboard_skins = 2 ,
145
147
scoreboard_kills = 3 ,
146
148
ping_frequency = 2 ,
@@ -229,17 +231,21 @@ Hooks:Add("MenuManagerInitialize", "MenuManagerInitialize_VoidUI", function(menu
229
231
if scoreboard then
230
232
scoreboard ._items_list [1 ]:set_value (item :value ())
231
233
end
234
+ if VoidUI .Warning == 0 then VoidUI .Warning = 1 end
232
235
end
233
236
MenuCallbackHandler .basic_option_clbk = function (self , item )
234
237
VoidUI .options [item :parameters ().name ] = item :value ()
238
+ if VoidUI .Warning == 0 then VoidUI .Warning = 1 end
235
239
VoidUI :UpdateMenu ()
236
240
end
237
241
MenuCallbackHandler .toggle_option_clbk = function (self , item )
238
242
VoidUI .options [item :parameters ().name ] = (item :value () == " on" and true or false )
243
+ if VoidUI .Warning == 0 then VoidUI .Warning = 1 end
239
244
VoidUI :UpdateMenu ()
240
245
end
241
246
242
247
MenuCallbackHandler .callback_VoidUI_reset = function (self , item )
248
+ VoidUI .Warning = 0
243
249
local buttons = {
244
250
[1 ] = {
245
251
text = managers .localization :text (" dialog_yes" ),
@@ -265,9 +271,30 @@ Hooks:Add("MenuManagerInitialize", "MenuManagerInitialize_VoidUI", function(menu
265
271
}
266
272
QuickMenu :new ( managers .localization :text (" VoidUI_reset_title" ), managers .localization :text (" VoidUI_reset_confirm" ), buttons , true )
267
273
end
268
-
269
274
MenuCallbackHandler .VoidUI_save = function (self , item )
270
275
VoidUI :Save ()
276
+ end
277
+
278
+ MenuCallbackHandler .VoidUI_warning_save = function (self , item )
279
+ VoidUI :Save ()
280
+ if managers .hud and not VoidUI .options .save_warning and VoidUI .Warning == 1 then
281
+ local buttons = {
282
+ [1 ] = {
283
+ text = managers .localization :text (" dialog_ok" ),
284
+ callback = function (self , item )
285
+ VoidUI .Warning = 2
286
+ end
287
+ },
288
+ [2 ] = {
289
+ text = managers .localization :text (" VoidUI_warning_confirm" ),
290
+ callback = function (self , item )
291
+ VoidUI .options .save_warning = true
292
+ VoidUI :Save ()
293
+ end
294
+ }
295
+ }
296
+ QuickMenu :new (managers .localization :text (" VoidUI_warning_title" ), managers .localization :text (" VoidUI_warning_desc" ), buttons , true )
297
+ end
271
298
end
272
299
273
300
VoidUI :DefaultConfig ()
0 commit comments