1
0
forked from 0ad/0ad
0ad/source
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
..
collada Fix build with libxml2 v2.12.1 2023-12-13 19:42:00 +00:00
graphics Don't execute the task when no Future awaits it anymore 2024-06-25 19:03:01 +00:00
gui Get a promise when starting a GUIpage 2024-07-08 19:07:04 +00:00
i18n Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
lib Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
lobby Don't use std::shared_ptr to store m_ScriptContext and m_ScriptInterface in the CGUIManager 2024-06-27 19:09:30 +00:00
maths Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
mocks Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
network Delete FSM.cpp forgotten in 3a5ad160f7 2024-05-05 06:04:22 +00:00
pch Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
ps Converge FileLogger with the other logger replacements 2024-07-06 14:48:44 +00:00
renderer Fixes zero usage for Vulkan upload buffer after b9fd6f18f0. 2024-06-14 22:05:32 +00:00
rlinterface Shutdown mongoose in rl-interface gracefully 2024-06-23 17:26:03 +00:00
scriptinterface Get a promise when starting a GUIpage 2024-07-08 19:07:04 +00:00
simulation2 Get a promise when starting a GUIpage 2024-07-08 19:07:04 +00:00
soundmanager Don't check memory allocation made using new 2024-01-21 14:29:30 +00:00
third_party Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
tools Fix translator credit script 2024-07-07 16:26:54 +00:00
main.cpp 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_setup.cpp Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00