h2-mod/data/cdata/ui_scripts/patches/unlockall.lua

34 lines
1.4 KiB
Lua
Raw Normal View History

2022-11-06 20:13:36 -05:00
if (Engine.InFrontend()) then
local levelselectmenu = LUI.sp_menus.LevelSelectMenu
levelselectmenu.DisplayUnlockAllFooterPrompt = function(f79_arg0, f79_arg1)
2022-11-06 20:16:24 -05:00
if Engine.GetDvarBool("profileMenuOption_hasUnlockedAll_SP") then
2022-11-06 20:13:36 -05:00
f79_arg0:AddHelp({
name = "add_button_helper_text",
button_ref = "button_alt2",
2022-11-06 20:16:24 -05:00
helper_text = Engine.Localize("@LUA_MENU_CANCEL_UNLOCK_CAPS"),
2022-11-06 20:13:36 -05:00
side = "right",
clickable = true
2022-11-06 20:16:24 -05:00
}, levelselectmenu.SetUnlockAll)
2022-11-06 20:13:36 -05:00
else
f79_arg0:AddHelp({
name = "add_button_helper_text",
button_ref = "button_alt2",
2022-11-06 20:16:24 -05:00
helper_text = Engine.Localize("@LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE"),
2022-11-06 20:13:36 -05:00
side = "right",
clickable = true
2022-11-06 20:16:24 -05:00
}, levelselectmenu.UnlockAllPopup)
2022-11-06 20:13:36 -05:00
end
end
levelselectmenu.UnlockAllPopup = function(f70_arg0, f70_arg1)
LUI.FlowManager.RequestAddMenu(nil, "request_yesno_popup_generic", true, f70_arg1.controller, nil, {
popup_title = Engine.Localize("@LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE"),
yes_action = levelselectmenu.SetUnlockAll,
message_text = Engine.Localize("@MENU_COMPLETED_CHEAT") .. ". " ..
Engine.Localize("@LUA_MENU_CAMPAIGN_UNLOCKED_ALL_DESC")
})
end
end
CoD.AllowUnlockAllInShip = true