1
0
forked from 0ad/0ad
0ad/source/simulation2
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
..
components Don't execute the task when no Future awaits it anymore 2024-06-25 19:03:01 +00:00
docs Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
helpers Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
scripting Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
serialization Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
system Make the CSimContext constructor take a CTerrain and a CUnitManager 2024-07-05 16:55:33 +00:00
tests Don't use std::shared_ptr<ScriptContext> in the CSimulation2 2024-03-08 17:15:25 +00:00
MessageTypes.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
Simulation2.cpp Get a promise when starting a GUIpage 2024-07-08 19:07:04 +00:00
Simulation2.h Don't use std::shared_ptr<ScriptContext> in the CSimulation2 2024-03-08 17:15:25 +00:00
TypeList.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00