From 19ae2fdf650420edddd0dd9672ef1a8baf15368d Mon Sep 17 00:00:00 2001 From: fed <58637860+fedddddd@users.noreply.github.com> Date: Fri, 10 Mar 2023 16:52:07 +0100 Subject: [PATCH] Add "Quit to desktop" button in pause menu --- data/cdata/ui_scripts/patches/__init__.lua | 1 + data/cdata/ui_scripts/patches/pausequit.lua | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 data/cdata/ui_scripts/patches/pausequit.lua diff --git a/data/cdata/ui_scripts/patches/__init__.lua b/data/cdata/ui_scripts/patches/__init__.lua index da3e488b..6f6f9f6e 100644 --- a/data/cdata/ui_scripts/patches/__init__.lua +++ b/data/cdata/ui_scripts/patches/__init__.lua @@ -1 +1,2 @@ require("unlockall") +require("pausequit") diff --git a/data/cdata/ui_scripts/patches/pausequit.lua b/data/cdata/ui_scripts/patches/pausequit.lua new file mode 100644 index 00000000..401dca61 --- /dev/null +++ b/data/cdata/ui_scripts/patches/pausequit.lua @@ -0,0 +1,10 @@ +if (Engine.InFrontend()) then + return +end + +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)