1
0
forked from 0ad/0ad
0ad/source/gui/tests
phosit f9114a87f2 Get a promise when starting a GUIpage
When calling `Engine.PushGuiPage` a promise is returned. The promise is
settled when the "child" page is closed. That allows to `await` it
inside `async` functions.
Previously the callback was run right inside the call to
`Engine.PopGuiPage`. Now the continuation of the promise is called at
the end of the "tick".

This won't help performance. It will more likely make things worse.
Since gui pages aren't opened or closed that frequently, it doesn't
matter that much.

Refs: 86c151ebaa

For the engine side:
The promise is stored in the `CGUIManager::SGUIPage` (like previously
the callback). When the promise is fulfilled it enqueues a callback in
the `JobQueue` of the `JSContext`.

Original patch by: @wraitii
Comments by: @wraitii, @Stan, @Polakrity, @lyv, @elexis, @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D3807
This was SVN commit r28145.
2024-07-08 19:07:04 +00:00
..
test_CGUIText.h Don't use std::shared_ptr to store m_ScriptContext and m_ScriptInterface in the CGUIManager 2024-06-27 19:09:30 +00:00
test_GuiManager.h Get a promise when starting a GUIpage 2024-07-08 19:07:04 +00:00
test_GUISetting.h Don't use std::shared_ptr to store m_ScriptContext and m_ScriptInterface in the CGUIManager 2024-06-27 19:09:30 +00:00
test_ParseString.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00