Add "Quit to desktop" button in pause menu (#558)
* Add "Quit to desktop" button in pause menu * classes & custom_weapons: fix for SP * "Quit to desktop" button for MP
This commit is contained in:
parent
839269c54e
commit
bf2d533ac5
@ -1,4 +1,4 @@
|
||||
if (Engine.InFrontend()) then
|
||||
if game:issingleplayer() or (Engine.InFrontend()) then
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
if (not Engine.InFrontend()) then
|
||||
if game:issingleplayer() or (not Engine.InFrontend()) then
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
require("language")
|
||||
require("background_effects")
|
||||
require("pausequit")
|
||||
|
||||
if game:issingleplayer() then
|
||||
require("sp_unlockall")
|
||||
|
32
data/cdata/ui_scripts/patches/pausequit.lua
Normal file
32
data/cdata/ui_scripts/patches/pausequit.lua
Normal file
@ -0,0 +1,32 @@
|
||||
if (Engine.InFrontend()) then
|
||||
return
|
||||
end
|
||||
|
||||
if game:issingleplayer() and Engine.GetDvarString("mapname") == "coup" then
|
||||
LUI.onmenuopen("sp_pause_menu", function(element)
|
||||
local menu = element:getFirstChild()
|
||||
menu:AddButton("@MENU_SP_SKIP_MISSION", function()
|
||||
Engine.Exec("map blackout")
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
if game:issingleplayer() then
|
||||
LUI.onmenuopen("sp_pause_menu", function(element)
|
||||
local menu = element:getFirstChild()
|
||||
menu:AddButton("@MENU_QUIT_TO_DESKTOP", function()
|
||||
LUI.FlowManager.RequestAddMenu(nil, "quit_popmenu")
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
if not game:issingleplayer() then
|
||||
local quitToDesktop = function()
|
||||
LUI.FlowManager.RequestAddMenu(nil, "quit_popmenu")
|
||||
end
|
||||
local addQuitButton = function(element)
|
||||
local menu = element
|
||||
menu:AddButton("@MENU_QUIT_TO_DESKTOP", quitToDesktop)
|
||||
end
|
||||
LUI.onmenuopen("mp_pause_menu", addQuitButton)
|
||||
end
|
@ -95,5 +95,6 @@
|
||||
"LOCALE_RUSSIAN": "Russian",
|
||||
"LOCALE_SIMPLIFIED_CHINESE": "Simplified Chinese",
|
||||
"LOCALE_SPANISH": "Spanish",
|
||||
"LOCALE_TRADITIONAL_CHINESE": "Traditional Chinese"
|
||||
"LOCALE_TRADITIONAL_CHINESE": "Traditional Chinese",
|
||||
"MENU_QUIT_TO_DESKTOP": "Quit to Desktop"
|
||||
}
|
@ -45,6 +45,7 @@
|
||||
"LOCALE_SIMPLIFIED_CHINESE": "Chinois simplifié",
|
||||
"LOCALE_SPANISH": "Espagnol",
|
||||
"LOCALE_TRADITIONAL_CHINESE": "Chinois traditionnel",
|
||||
"MENU_QUIT_TO_DESKTOP": "Retour au bureau",
|
||||
|
||||
"LUA_MENU_CHOOSE_LANGUAGE": "Choisissez la langue",
|
||||
"LUA_MENU_CHOOSE_LANGUAGE_DESC": "Choisissez la langue."
|
||||
|
@ -16,6 +16,7 @@
|
||||
"LOCALE_SIMPLIFIED_CHINESE": "Vereinfachtes Chinesisch",
|
||||
"LOCALE_SPANISH": "Spanisch",
|
||||
"LOCALE_TRADITIONAL_CHINESE": "Traditionelles Chinesisch",
|
||||
"MENU_QUIT_TO_DESKTOP": "Zum Desktop",
|
||||
"LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "Alle Missionen freischalten",
|
||||
"LUA_MENU_CANCEL_UNLOCK_CAPS": "Freischalten abbrechen"
|
||||
}
|
@ -26,5 +26,6 @@
|
||||
"LOCALE_RUSSIAN": "Russo",
|
||||
"LOCALE_SIMPLIFIED_CHINESE": "Cinese semplificato",
|
||||
"LOCALE_SPANISH": "Spagnolo",
|
||||
"LOCALE_TRADITIONAL_CHINESE": "Cinese tradizionale"
|
||||
"LOCALE_TRADITIONAL_CHINESE": "Cinese tradizionale",
|
||||
"MENU_QUIT_TO_DESKTOP": "Esci e torna al desktop"
|
||||
}
|
@ -16,6 +16,7 @@
|
||||
"LOCALE_SIMPLIFIED_CHINESE": "簡体字中国語",
|
||||
"LOCALE_SPANISH": "スペイン語",
|
||||
"LOCALE_TRADITIONAL_CHINESE": "繁体字中国語",
|
||||
"MENU_QUIT_TO_DESKTOP": "デスクトップに戻る",
|
||||
|
||||
"LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "全ミッションをアンロック",
|
||||
"LUA_MENU_CANCEL_UNLOCK_CAPS": "アンロックをキャンセル"
|
||||
|
@ -16,6 +16,7 @@
|
||||
"LOCALE_SIMPLIFIED_CHINESE": "중국어(간체)",
|
||||
"LOCALE_SPANISH": "스페인어",
|
||||
"LOCALE_TRADITIONAL_CHINESE": "중국어(번체)",
|
||||
"MENU_QUIT_TO_DESKTOP": "데스크탑으로 나가기",
|
||||
|
||||
"LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "모든 임무 잠금 해제",
|
||||
"LUA_MENU_CANCEL_UNLOCK_CAPS": "잠금 해제 취소"
|
||||
|
@ -16,6 +16,7 @@
|
||||
"LOCALE_SIMPLIFIED_CHINESE": "Chiński uproszczony",
|
||||
"LOCALE_SPANISH": "Hiszpański",
|
||||
"LOCALE_TRADITIONAL_CHINESE": "Chiński tradycyjny",
|
||||
"MENU_QUIT_TO_DESKTOP": "Wyjdź do pulpitu",
|
||||
|
||||
"LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "Odblokuj wszystkie misje",
|
||||
"LUA_MENU_CANCEL_UNLOCK_CAPS": "Anuluj odblokowanie"
|
||||
|
@ -16,6 +16,7 @@
|
||||
"LOCALE_SIMPLIFIED_CHINESE": "Chinês simplificado",
|
||||
"LOCALE_SPANISH": "Español",
|
||||
"LOCALE_TRADITIONAL_CHINESE": "Chinês tradicional",
|
||||
"MENU_QUIT_TO_DESKTOP": "Sair para a área de trabalho",
|
||||
|
||||
"LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "Desbloquear todas as missões",
|
||||
"LUA_MENU_CANCEL_UNLOCK_CAPS": "Cancelar desbloqueio"
|
||||
|
@ -48,6 +48,7 @@
|
||||
"LOCALE_SPANISH": "Испанский",
|
||||
"LOCALE_TRADITIONAL_CHINESE": "Китайский традиционный",
|
||||
"LUA_MENU_DOWNLOAD": "Скачать",
|
||||
"MENU_QUIT_TO_DESKTOP": "Выйти на рабочий стол",
|
||||
|
||||
"MPUI_MP44": "MP-44",
|
||||
"WEAPON_AT4": "AT4",
|
||||
|
@ -16,6 +16,7 @@
|
||||
"LOCALE_SIMPLIFIED_CHINESE": "简体中文",
|
||||
"LOCALE_SPANISH": "西班牙语",
|
||||
"LOCALE_TRADITIONAL_CHINESE": "繁体中文",
|
||||
"MENU_QUIT_TO_DESKTOP": "退至桌面",
|
||||
|
||||
"LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "解锁全部任务",
|
||||
"LUA_MENU_CANCEL_UNLOCK_CAPS": "取消解锁"
|
||||
|
@ -16,6 +16,7 @@
|
||||
"LOCALE_SIMPLIFIED_CHINESE": "Chino simplificado",
|
||||
"LOCALE_SPANISH": "Español",
|
||||
"LOCALE_TRADITIONAL_CHINESE": "Chino tradicional",
|
||||
"MENU_QUIT_TO_DESKTOP": "Salir al escritorio",
|
||||
|
||||
"LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "Desbloquear todas las misiones",
|
||||
"LUA_MENU_CANCEL_UNLOCK_CAPS": "Cancelar desbloqueo"
|
||||
|
@ -17,6 +17,7 @@
|
||||
"LOCALE_SIMPLIFIED_CHINESE": "簡體中文",
|
||||
"LOCALE_SPANISH": "西班牙文",
|
||||
"LOCALE_TRADITIONAL_CHINESE": "繁體中文",
|
||||
"MENU_QUIT_TO_DESKTOP": "返回桌面",
|
||||
|
||||
"LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "解鎖所有任務",
|
||||
"LUA_MENU_CANCEL_UNLOCK_CAPS": "取消解鎖"
|
||||
|
Loading…
Reference in New Issue
Block a user