This commit is contained in:
m 2022-03-11 16:28:55 -06:00
parent afbde29d4b
commit 5210a93224

View File

@ -8,10 +8,12 @@ game:addlocalizedstring("LUA_MENU_STATS", "Stats")
game:addlocalizedstring("LUA_MENU_STATS_DESC", "Edit player stats settings.")
game:addlocalizedstring("LUA_MENU_UNLOCKALL_ITEMS", "Unlock All Items")
game:addlocalizedstring("LUA_MENU_UNLOCKALL_ITEMS_DESC", "Whether items should be locked based on the player's stats or always unlocked.")
game:addlocalizedstring("LUA_MENU_UNLOCKALL_ITEMS_DESC",
"Whether items should be locked based on the player's stats or always unlocked.")
game:addlocalizedstring("LUA_MENU_UNLOCKALL_CLASSES", "Unlock All Classes")
game:addlocalizedstring("LUA_MENU_UNLOCKALL_CLASSES_DESC", "Whether classes should be locked based on the player's stats or always unlocked.")
game:addlocalizedstring("LUA_MENU_UNLOCKALL_CLASSES_DESC",
"Whether classes should be locked based on the player's stats or always unlocked.")
game:addlocalizedstring("LUA_MENU_PRESTIGE", "Prestige")
game:addlocalizedstring("LUA_MENU_PRESTIGE_DESC", "Edit prestige level.")
@ -88,7 +90,8 @@ LUI.MenuBuilder.registerType("menu_stats", function(a1, a2)
menu:setClass(LUI.Options)
menu.controller = a2.exclusiveController
local itemsbutton = menu:AddButtonVariant(luiglobals.GenericButtonSettings.Variants.Select, "@LUA_MENU_UNLOCKALL_ITEMS", "@LUA_MENU_UNLOCKALL_ITEMS_DESC", function()
local itemsbutton = menu:AddButtonVariant(luiglobals.GenericButtonSettings.Variants.Select,
"@LUA_MENU_UNLOCKALL_ITEMS", "@LUA_MENU_UNLOCKALL_ITEMS_DESC", function()
return IsEnabled("cg_unlockall_items")
end, function()
ToggleEnable("cg_unlockall_items")
@ -96,7 +99,8 @@ LUI.MenuBuilder.registerType("menu_stats", function(a1, a2)
ToggleEnable("cg_unlockall_items")
end)
local classesbutton = menu:AddButtonVariant(luiglobals.GenericButtonSettings.Variants.Select, "@LUA_MENU_UNLOCKALL_CLASSES", "@LUA_MENU_UNLOCKALL_CLASSES_DESC", function()
local classesbutton = menu:AddButtonVariant(luiglobals.GenericButtonSettings.Variants.Select,
"@LUA_MENU_UNLOCKALL_CLASSES", "@LUA_MENU_UNLOCKALL_CLASSES_DESC", function()
return IsEnabled("cg_unlockall_classes")
end, function()
ToggleEnable("cg_unlockall_classes")
@ -161,7 +165,8 @@ function prestigeeditbutton(menu, callback)
Engine.SetDvarFromString("ui_prestige_level", prestige .. "")
menu:AddButtonVariant(luiglobals.GenericButtonSettings.Variants.Select, "@LUA_MENU_PRESTIGE", "@LUA_MENU_PRESTIGE_DESC", function()
menu:AddButtonVariant(luiglobals.GenericButtonSettings.Variants.Select, "@LUA_MENU_PRESTIGE",
"@LUA_MENU_PRESTIGE_DESC", function()
return Engine.GetDvarString("ui_prestige_level")
end, function()
GoDirection("ui_prestige_level", "prestige", "down", callback)
@ -189,7 +194,8 @@ function rankeditbutton(menu, callback)
Engine.SetDvarFromString("ui_rank_level_", rank .. "")
menu:AddButtonVariant(luiglobals.GenericButtonSettings.Variants.Select, "@LUA_MENU_RANK", "@LUA_MENU_RANK_DESC", function()
menu:AddButtonVariant(luiglobals.GenericButtonSettings.Variants.Select, "@LUA_MENU_RANK", "@LUA_MENU_RANK_DESC",
function()
-- show 1 more level than it actually is (ex: rank "0" is really rank 1)
local rank = Engine.GetDvarString("ui_rank_level_")
rank = tonumber(rank) + 1