1
0
forked from 0ad/0ad

Remove Engine.PopGuiPage

This commit is contained in:
phosit 2024-09-21 20:24:54 +02:00
parent a91d849489
commit e3d4719aa9
3 changed files with 0 additions and 25 deletions

View File

@ -137,13 +137,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)
{

View File

@ -72,12 +72,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.
*/

View File

@ -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");