From d0ab2cb78372abb1b5d4e958e7d96f2e2ba46bb4 Mon Sep 17 00:00:00 2001 From: phosit Date: Sat, 21 Sep 2024 20:24:54 +0200 Subject: [PATCH] Remove Engine.PopGuiPage Remove the old now unused interface. --- source/gui/GUIManager.cpp | 7 ------- source/gui/GUIManager.h | 6 ------ source/gui/Scripting/JSInterface_GUIManager.cpp | 12 ------------ 3 files changed, 25 deletions(-) diff --git a/source/gui/GUIManager.cpp b/source/gui/GUIManager.cpp index 3c00b6adab..ed531ce571 100644 --- a/source/gui/GUIManager.cpp +++ b/source/gui/GUIManager.cpp @@ -138,13 +138,6 @@ JS::Value CGUIManager::PushPage(const CStrW& pageName, Script::StructuredClone i return promise; } -void CGUIManager::PopPage(JS::HandleValue arg) -{ - SGUIPage& topmostPage{m_PageStack.back()}; - const ScriptRequest rq{topmostPage.gui->GetScriptInterface()}; - JS::ResolvePromise(rq.cx, *topmostPage.sendingPromise, arg); -} - CGUIManager::SGUIPage::SGUIPage(const CStrW& pageName, const Script::StructuredClone initData) : m_Name(pageName), initData(initData) { diff --git a/source/gui/GUIManager.h b/source/gui/GUIManager.h index d0756ff55d..7fc063e7e1 100644 --- a/source/gui/GUIManager.h +++ b/source/gui/GUIManager.h @@ -73,12 +73,6 @@ public: */ JS::Value PushPage(const CStrW& pageName, Script::StructuredClone initData); - /** - * Unload the currently active GUI page, and make the previous page active. - * (There must be at least two pages when you call this.) - */ - void PopPage(JS::HandleValue arg); - /** * Called when a file has been modified, to hotload changes. */ diff --git a/source/gui/Scripting/JSInterface_GUIManager.cpp b/source/gui/Scripting/JSInterface_GUIManager.cpp index 490d1be21a..e2907f9c47 100644 --- a/source/gui/Scripting/JSInterface_GUIManager.cpp +++ b/source/gui/Scripting/JSInterface_GUIManager.cpp @@ -43,17 +43,6 @@ void SwitchGuiPage(const ScriptInterface& scriptInterface, const std::wstring& n g_GUI->SwitchPage(name, &scriptInterface, initData); } -void PopGuiPage(const ScriptRequest& rq, JS::HandleValue args) -{ - if (g_GUI->GetPageCount() < 2) - { - ScriptException::Raise(rq, "Can't pop GUI pages when less than two pages are opened!"); - return; - } - - g_GUI->PopPage(args); -} - void SetCursor(const std::wstring& name) { g_VideoMode.SetCursor(name); @@ -79,7 +68,6 @@ void RegisterScriptFunctions(const ScriptRequest& rq) { ScriptFunction::Register<&PushGuiPage>(rq, "PushGuiPage"); ScriptFunction::Register<&SwitchGuiPage>(rq, "SwitchGuiPage"); - ScriptFunction::Register<&PopGuiPage>(rq, "PopGuiPage"); ScriptFunction::Register<&SetCursor>(rq, "SetCursor"); ScriptFunction::Register<&ResetCursor>(rq, "ResetCursor"); ScriptFunction::Register<&TemplateExists>(rq, "TemplateExists");