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.
This adds updating the translator credits automatically when updating
translations. This has two benefits:
1. Translator credits are up-to-date in SVN-builds, so potential
problems will already show up there.
2. One manual step less during a release.
Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5299
This was SVN commit r28143.
The changes from D5290 broke the script to credit translators, as the
lines with the translators might now include additional information,
like the years of contribution, after the usernames, that would've
been included by `creditTranslators.py` as well.
This commit also slighly hardens the removal of deleted users to from
the credited translators to reduce the likelihood to remove still
existing users.
Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5298
This was SVN commit r28142.
Use the same `CLogger` constructor.
Never take ownership of the streams.
Comments by: @Stan
Differential Revision: https://code.wildfiregames.com/D5203
This was SVN commit r28140.
`std::shared_ptr` is intrusive. When a function expects a
`std::shared_ptr` the caller has to use it too and can't store the
element on the stack for example.
Comments by: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D5221
This was SVN commit r28131.
The regex for removing the email address of the last translator from
PO-files contained two bugs causing it not to match:
1. It didn't account for text after the email address and PO-files
from Transifex contain the year of the last translation there.
2. It expected a second `\\n"` at the end of the line, instead of `\n"`.
This commit fixes both of these issues and simplifies the regexes. It
also ensures that the text after the email address is kept as well.
Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5290
This was SVN commit r28130.
Summary:
Most of the times the callback stores a reference to a variable in scope
where the `Future` is in. When the scope is left the reference get's
dangling. `CancelOrWait` is called in multiple places (mostly
destructors) to ensure the callback isn't executed anymore.
This patch deduplicates thous calls to `CancelOrWait`.
Refs: #5874
Comments by: @Stan, @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D5208
This was SVN commit r28128.
As we depend on Babel for i18n tooling nowadays, we can also use its
maintained JavaScript-lexer, instead of the one forked from an old
version of Babel.
Doing so reduces the amount of code we have to maintain, adds new
functionality (like properly handling hexadecimal unicode notations) and
fixes some regex related incompatibilities which makes generating
portable object templates possible with recent Python versions.
The use of `tokenize(…, dotted=False)` is necessary, as we use this
lexer for C++ code as well and detection of most strings in C++ code
fails otherwise. As dotted names weren't supported by version of the
lexer we used until now, this isn't a regression.
Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5293
This was SVN commit r28124.
When the `RL::Interface` is destroied but the engine isn't completely
shoutdown there was a dangling pointer. The time the dangling pointer is
accessable got expanded with 968e55704a.
Whith this patch there no dangling pointer (in that regard).
Accepted by: @vladislavbelov
Comments by: @Stan, @sera
Trac Tickets: #5989
Differential Revision: https://code.wildfiregames.com/D5254
This was SVN commit r28123.
The code didn't call `this.isCircularMap` but checks if it's defined.
The function returned the wrong values for square maps.
Broken in 480228f964
Comments by: @Stan
Differential Revision: https://code.wildfiregames.com/D5288
This was SVN commit r28122.
- Adding the function signature
- Changing `g_Map.ExportMap()` to `return g_Map`
- Changing `Engine.SetProgress(NN)` to `yield NN`
- Changing `const g_Map = ...` to `globalThis.g_Map = ...`
- On some maps using the argument `mapSettings`
Comments By: @asterix, @sera, @Stan
Differential Revision: https://code.wildfiregames.com/D5258
This was SVN commit r28119.
Summary:
Preparation to use the generator based interface.
Removes many globals. (but doesn't reduce their scope by much)
Refs: #4964
Comments By: @sera@elexis
Differential Revision: https://code.wildfiregames.com/D5285
This was SVN commit r28117.
Arabian Oases: Added "new" keyword
Sporades Islands: Added "new" keyword, gave both players a free starting
Scout Ship. Added a capturable CC on the unoccupied north island. Added
2 Gaia Treasure Ships.
Syria: Added some Ruins and Shrines.
Watering Holes: Minor tweaks to grass placement.
Zagros Mountains: Added some Shrines and swapped out the Gaia fields and
farmsteads for capturable Mill_Fields and Mills.
This was SVN commit r28113.
- Put the actual functions in `unknownMapFunctions` instead of just the
names
- Inline some functions
Comments by: elexis
Differential Revision: https://code.wildfiregames.com/D5280
This was SVN commit r28105.
- whitespace changes
- functions were called in a way that they always used the default
arguments
- deduplicate code in initialization of `heighLimits`
- new structure in `myBiome`, so that the painting can be reduced much.
- also initialization instead of push
- use algorithm to calculate the `areas` and the "midpoints" of the
slope.
Comments by: @elexis
Differential Revision: https://code.wildfiregames.com/D5279
This was SVN commit r28104.
The "biomes" where duplicated between alpine_lakes and alpine_valley.
The biomes can now be selected by the game setup page.
This also remove many `var`'s.
Comments by: @Stan, @elexis
Differential Revision: https://code.wildfiregames.com/D5277
This was SVN commit r28099.
- The heights are now a constant array. Instead of pushing the heights
to an array.
- The terrain are now always constructed in one expression. Instead of
calling `.concat` repeatedly.
- The actors and the probability thereof are now also part of the
object. Separation of data and code.
- Player placement is now a iife.
Comments by: @Stan, @sera
Accepted by: @elexis
Differential Revision: https://code.wildfiregames.com/D5272
This was SVN commit r28098.
This way it's clear what's the input and what's the output of the
computation.
All map generation scripts should reman working. They are adopted in a
future commit.
`Engine.SetProgress` and `Engine.ExportMap` can be removed in a future
commit.
Comments by: @marder, @sera, @Stan
Differential Revision: https://code.wildfiregames.com/D5220
This was SVN commit r28093.
- Add a new CI docker file
- Fix a typo for checkrefs (Refs https://code.wildfiregames.com/D5266)
- Switch to Clang8
- Unify pipeline reset in a function
- Update the image building pipeline
This was SVN commit r28086.
To avoid the appearance of two Roman numerals at the end of bot names
(e.g. "Artaxshasha II II -> here "Artaxshasha II" was the name itself
and the second "II" was added when the name was chosen for the second
time), remove the addition of Roman numerals entirely.
Instead, if possible, a new name is chosen for each bot. If not, the
suffix "(n)" is added counting the duplicates and warning is displayed.
AINames are added to the Iberians, Gauls, and Mauryas bringing their
totel to at least 8 each in order avoid any duplicates in regular
8-player games.
Credit to Norse_Harold for changing the condition for reusing names to
not use a hardcoded assumption about the maximum number of player slots
Patch by @Vantha
Accepted by @phosit, @wowgetoffyourcellphone
Differential Revision: https://code.wildfiregames.com/D5256
This was SVN commit r28082.
In the Han CC I changed `0.8 * 0.75` to `0.8 - 0.2` so it could also be
described the same way.
Accepted By: @Freagarach
Comments By: @sera, @Stan
Trac Tickets: #6755
Differential Revision: https://code.wildfiregames.com/D5031
This was SVN commit r28065.
The user doesn't have to fiddle with `std::shared_ptr`.
And two (more unrelated) things: use `std::unordered_map`, use a
`std::find_if` in the callback.
Comments By: @vladislavbelov, @Stan
Differential Revision: https://code.wildfiregames.com/D5239
This was SVN commit r28048.