Add 'Unlock All' button in SP (#358)

* Add 'Unlock All' button in SP

* Add 'Unlock All' button in SP
* Hide useless 'Leaderboard' button

* cleanup and format

* fix errors i think

* Revert "fix errors i think"

This reverts commit bbd0287d6fa7a3fd8b4f487b1331250f39522b28.

* Revert "cleanup and format"

This reverts commit a0aeced689e10d0855510784d5cc1ba0aa7362ad.

Co-authored-by: fed <58637860+fedddddd@users.noreply.github.com>
Co-authored-by: m <mjkzyalt@gmail.com>
This commit is contained in:
Vlad 2022-11-21 00:11:10 +03:00 committed by GitHub
parent 9bacdda31c
commit 4e1e3ab028
15 changed files with 100 additions and 10 deletions

View File

@ -1,5 +1,6 @@
if (game:issingleplayer()) then if (game:issingleplayer()) then
return require("sp_unlockall")
return
end end
if (Engine.InFrontend()) then if (Engine.InFrontend()) then

View File

@ -0,0 +1,53 @@
if Engine.InFrontend() then
local levelselectmenu = LUI.sp_menus.LevelSelectMenu
levelselectmenu.SetupInfoBoxRightForArcadeMode = function(f44_arg0, f44_arg1)
return false
end
LUI.LevelSelect.AddLevelListButtons = function(f50_arg0, f50_arg1)
for f50_local0 = 1, #f50_arg1, 1 do
if not Engine.GetDvarBool("arcademode") or not f50_arg1[f50_local0].narativeLevel then
f50_arg0:AddLevelListEntry(f50_local0, f50_arg1[f50_local0])
end
end
if not Engine.GetDvarBool("arcademode") then
if Engine.GetDvarBool("profileMenuOption_hasUnlockedAll_SP") then
f50_arg0:AddHelp({
name = "add_button_helper_text",
button_ref = "button_alt2",
helper_text = Engine.Localize("@LUA_MENU_CANCEL_UNLOCK_CAPS"),
side = "right",
clickable = true
}, levelselectmenu.SetUnlockAll)
else
f50_arg0:AddHelp({
name = "add_button_helper_text",
button_ref = "button_alt2",
helper_text = Engine.Localize("@LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE"),
side = "right",
clickable = true
}, levelselectmenu.UnlockAllPopup)
end
end
end
levelselectmenu.UnlockAllPopup = function(f56_arg0, f56_arg1)
LUI.FlowManager.RequestAddMenu(nil, "request_yesno_popup_generic", true, f56_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
levelselectmenu.SetUnlockAll = function(f57_arg0, f57_arg1)
Engine.SetDvarBool("profileMenuOption_hasUnlockedAll_SP",
not Engine.GetDvarBool("profileMenuOption_hasUnlockedAll_SP"))
Engine.SetDvarBool("mis_cheat", not Engine.GetDvarBool("mis_cheat"))
Engine.ExecNow("profile_menuDvarsFinish")
Engine.Exec("updategamerprofile")
local f57_local0 = LUI.FlowManager.GetTopOpenAndVisibleMenuName()
LUI.FlowManager.RequestAddMenu(nil, f57_local0, true, f57_arg1.controller, true,
LUI.LevelSelect.FindActData(f57_local0), {
reload = true
})
end
end

View File

@ -1,4 +1,6 @@
{ {
"LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "Unlock All Missions and Intel",
"LUA_MENU_CANCEL_UNLOCK_CAPS": "Cancel Unlock All Missions",
"LUA_MENU_CHOOSE_LANGUAGE": "Choose your language", "LUA_MENU_CHOOSE_LANGUAGE": "Choose your language",
"MENU_APPLY_LANGUAGE_SETTINGS": "Apply language settings?" "MENU_APPLY_LANGUAGE_SETTINGS": "Apply language settings?"
} }

View File

@ -1,4 +1,6 @@
{ {
"LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "Unlock All Missions and Intel",
"LUA_MENU_CANCEL_UNLOCK_CAPS": "Cancel Unlock All Missions",
"LUA_MENU_CHOOSE_LANGUAGE": "Choose your language", "LUA_MENU_CHOOSE_LANGUAGE": "Choose your language",
"MENU_APPLY_LANGUAGE_SETTINGS": "Apply language settings?" "MENU_APPLY_LANGUAGE_SETTINGS": "Apply language settings?"
} }

View File

@ -6,6 +6,9 @@
"LUA_MENU_RED_DOT_BRIGHTNESS": "Luminosité du point rouge", "LUA_MENU_RED_DOT_BRIGHTNESS": "Luminosité du point rouge",
"LUA_MENU_RED_DOT_BRIGHTNESS_DESC": "Ajustez la luminosité du point rouge des réticules.", "LUA_MENU_RED_DOT_BRIGHTNESS_DESC": "Ajustez la luminosité du point rouge des réticules.",
"LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "Débloquer toutes les missions",
"LUA_MENU_CANCEL_UNLOCK_CAPS": "Annuler déblocage",
"MENU_MODS": "MODS", "MENU_MODS": "MODS",
"MENU_MODS_DESC": "Charger les mods installés.", "MENU_MODS_DESC": "Charger les mods installés.",
"LUA_MENU_MOD_DESC_DEFAULT": "Charger &&1.", "LUA_MENU_MOD_DESC_DEFAULT": "Charger &&1.",
@ -52,7 +55,7 @@
"MPHUD_LATENCY": "Latence: ", "MPHUD_LATENCY": "Latence: ",
"MPHUD_LATENCY_MS": " ms", "MPHUD_LATENCY_MS": " ms",
"LUA_MENU_TELEMETRY": "TÉLÉMÉTRIE", "LUA_MENU_TELEMETRY": "TÉLÉMÉTRIE",
"LOCALE_ENGLISH": "Anglais", "LOCALE_ENGLISH": "Anglais",
"LOCALE_ENGLISH_SAFE": "Anglais (sécuritaire)", "LOCALE_ENGLISH_SAFE": "Anglais (sécuritaire)",
"LOCALE_FRENCH": "Français", "LOCALE_FRENCH": "Français",

View File

@ -11,5 +11,7 @@
"LOCALE_RUSSIAN": "Russisch", "LOCALE_RUSSIAN": "Russisch",
"LOCALE_SIMPLIFIED_CHINESE": "Vereinfachtes Chinesisch", "LOCALE_SIMPLIFIED_CHINESE": "Vereinfachtes Chinesisch",
"LOCALE_SPANISH": "Spanisch", "LOCALE_SPANISH": "Spanisch",
"LOCALE_TRADITIONAL_CHINESE": "Traditionelles Chinesisch" "LOCALE_TRADITIONAL_CHINESE": "Traditionelles Chinesisch",
"LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "Alle Missionen freischalten",
"LUA_MENU_CANCEL_UNLOCK_CAPS": "Freischalten abbrechen"
} }

View File

@ -1,4 +1,7 @@
{ {
"LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "Sblocca tutte le missioni",
"LUA_MENU_CANCEL_UNLOCK_CAPS": "Annulla sblocco",
"MENU_MODS_DESC": "Abilita mod installate.", "MENU_MODS_DESC": "Abilita mod installate.",
"LUA_MENU_MOD_DESC_DEFAULT": "Abilita &&1.", "LUA_MENU_MOD_DESC_DEFAULT": "Abilita &&1.",
"LUA_MENU_MOD_DESC": "&&1\nAutore: &&2\nVersione: &&3", "LUA_MENU_MOD_DESC": "&&1\nAutore: &&2\nVersione: &&3",

View File

@ -11,5 +11,8 @@
"LOCALE_RUSSIAN": "ロシア語", "LOCALE_RUSSIAN": "ロシア語",
"LOCALE_SIMPLIFIED_CHINESE": "簡体字中国語", "LOCALE_SIMPLIFIED_CHINESE": "簡体字中国語",
"LOCALE_SPANISH": "スペイン語", "LOCALE_SPANISH": "スペイン語",
"LOCALE_TRADITIONAL_CHINESE": "繁体字中国語" "LOCALE_TRADITIONAL_CHINESE": "繁体字中国語",
"LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "全ミッションをアンロック",
"LUA_MENU_CANCEL_UNLOCK_CAPS": "アンロックをキャンセル"
} }

View File

@ -11,5 +11,8 @@
"LOCALE_RUSSIAN": "러시아어", "LOCALE_RUSSIAN": "러시아어",
"LOCALE_SIMPLIFIED_CHINESE": "중국어(간체)", "LOCALE_SIMPLIFIED_CHINESE": "중국어(간체)",
"LOCALE_SPANISH": "스페인어", "LOCALE_SPANISH": "스페인어",
"LOCALE_TRADITIONAL_CHINESE": "중국어(번체)" "LOCALE_TRADITIONAL_CHINESE": "중국어(번체)",
"LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "모든 임무 잠금 해제",
"LUA_MENU_CANCEL_UNLOCK_CAPS": "잠금 해제 취소"
} }

View File

@ -11,5 +11,8 @@
"LOCALE_RUSSIAN": "Rosyjski", "LOCALE_RUSSIAN": "Rosyjski",
"LOCALE_SIMPLIFIED_CHINESE": "Chiński uproszczony", "LOCALE_SIMPLIFIED_CHINESE": "Chiński uproszczony",
"LOCALE_SPANISH": "Hiszpański", "LOCALE_SPANISH": "Hiszpański",
"LOCALE_TRADITIONAL_CHINESE": "Chiński tradycyjny" "LOCALE_TRADITIONAL_CHINESE": "Chiński tradycyjny",
"LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "Odblokuj wszystkie misje",
"LUA_MENU_CANCEL_UNLOCK_CAPS": "Anuluj odblokowanie"
} }

View File

@ -11,5 +11,8 @@
"LOCALE_RUSSIAN": "Russo", "LOCALE_RUSSIAN": "Russo",
"LOCALE_SIMPLIFIED_CHINESE": "Chinês simplificado", "LOCALE_SIMPLIFIED_CHINESE": "Chinês simplificado",
"LOCALE_SPANISH": "Español", "LOCALE_SPANISH": "Español",
"LOCALE_TRADITIONAL_CHINESE": "Chinês tradicional" "LOCALE_TRADITIONAL_CHINESE": "Chinês tradicional",
"LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "Desbloquear todas as missões",
"LUA_MENU_CANCEL_UNLOCK_CAPS": "Cancelar desbloqueio"
} }

View File

@ -13,6 +13,9 @@
"LUA_MENU_RED_DOT_BRIGHTNESS": "Яркость коллиматора", "LUA_MENU_RED_DOT_BRIGHTNESS": "Яркость коллиматора",
"LUA_MENU_RED_DOT_BRIGHTNESS_DESC": "Регулировка яркости красной точки коллиматорных прицелов.", "LUA_MENU_RED_DOT_BRIGHTNESS_DESC": "Регулировка яркости красной точки коллиматорных прицелов.",
"LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "Открыть все задания и чит-коды",
"LUA_MENU_CANCEL_UNLOCK_CAPS": "Вернуться к своему прогрессу прохождения",
"MENU_MODS": "МОДЫ", "MENU_MODS": "МОДЫ",
"MENU_MODS_DESC": "Запуск установленных модов.", "MENU_MODS_DESC": "Запуск установленных модов.",
"LUA_MENU_MOD_DESC_DEFAULT": "Запустить &&1.", "LUA_MENU_MOD_DESC_DEFAULT": "Запустить &&1.",

View File

@ -11,5 +11,8 @@
"LOCALE_RUSSIAN": "俄语", "LOCALE_RUSSIAN": "俄语",
"LOCALE_SIMPLIFIED_CHINESE": "简体中文", "LOCALE_SIMPLIFIED_CHINESE": "简体中文",
"LOCALE_SPANISH": "西班牙语", "LOCALE_SPANISH": "西班牙语",
"LOCALE_TRADITIONAL_CHINESE": "繁体中文" "LOCALE_TRADITIONAL_CHINESE": "繁体中文",
"LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "解锁全部任务",
"LUA_MENU_CANCEL_UNLOCK_CAPS": "取消解锁"
} }

View File

@ -11,5 +11,8 @@
"LOCALE_RUSSIAN": "Ruso", "LOCALE_RUSSIAN": "Ruso",
"LOCALE_SIMPLIFIED_CHINESE": "Chino simplificado", "LOCALE_SIMPLIFIED_CHINESE": "Chino simplificado",
"LOCALE_SPANISH": "Español", "LOCALE_SPANISH": "Español",
"LOCALE_TRADITIONAL_CHINESE": "Chino tradicional" "LOCALE_TRADITIONAL_CHINESE": "Chino tradicional",
"LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "Desbloquear todas las misiones",
"LUA_MENU_CANCEL_UNLOCK_CAPS": "Cancelar desbloqueo"
} }

View File

@ -11,5 +11,8 @@
"LOCALE_RUSSIAN": "俄文", "LOCALE_RUSSIAN": "俄文",
"LOCALE_SIMPLIFIED_CHINESE": "簡體中文", "LOCALE_SIMPLIFIED_CHINESE": "簡體中文",
"LOCALE_SPANISH": "西班牙文", "LOCALE_SPANISH": "西班牙文",
"LOCALE_TRADITIONAL_CHINESE": "繁體中文" "LOCALE_TRADITIONAL_CHINESE": "繁體中文",
"LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "解鎖所有任務",
"LUA_MENU_CANCEL_UNLOCK_CAPS": "取消解鎖"
} }