There is a workaround for an old bug with the use of wxCollapsiblePane.
As the widget itself is no longer in use, just remove the now dead code.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The terrain selection notebook is painful to navigate with a large
amount of tabs. Further the control is broken on macOS. As such replace
the wxNotebook with a wxChoicebook.
Fixes: #8705
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Interdependent content width in terrain selection panel results in GTK
throwing warnings. Don't expand the grid cell content.
Also wrap the grid to keep spacing consistent and not variable for the
terrain buttons.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
iwyu 0.26 now want's full declaration of TYPE in case of
std::vector<TYPE>, which is good as it allows the header to be
self standing.
There are some other changes suggested in part of the headers not being
updated when they should have been and some due to changes in iwyu
itself.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Add the header to iwyu mappings as private as the wx documentation
doesn't suggest otherwise.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Don't declare empty constructor and destructor, avoid c-style cast and
remove TODO about a bug that can't be reproduced any longer.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
KEY_DOWN means we need to check for the "down" values instead of "char"
value which differer for numpad.
Ref: #501
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
9 isn't a valid playerID, setting this value causes a JS error
and corrupting the viewport.
Further limit selectable max playerID to what the mapSettings say.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
In many places there are missing gaps/borders and where there are there
are almost random values used (2/3/4/5/8/10/15).
Add missing and standardize on using gaps 5 and 10 pixel only.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Since C++11 a C typedef'ed union can be forward declared, so the wrapper
is no longer needed.
While at it switch signatures to refs and convert C style casts.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
It was previously stored at the end of the array of per-player flags and
set by calling SetLosRevealWholeMap with the player ID -1. However, ever
since the introduction of observer mode in 883f307b40, -1 is the player
ID of observers everywhere else including for GetLosRevealWhole:
GetLosRevealWhole(-1) always returns true in order to reveal the map to
observers, however, the cinema manager, for example, called it meaning
to find out whether the whole map is revealed to all players.
To fix this and avoid confusion about this in the future, this patch
splits this flag from the per-player flag array and introduces new
functions to set and retrieve it.
This name is more descriptive.
And the plan is to split off the extra player value of the vector into
an own flag in the future, and LosRevealAllForAll would have been a poor
name for that.
It's better to construct a js-array from a `JS::RootedValueVector`.
Because it is more strongly typed and the index doesn't has to be
specified when appending an element.
Some usages are replaced with `JS::RootedValueArray`.
Fixes: #8702
Up to now `eslint-plugin-brace-rules` was used to enforce a common brace
style for JavaScript code. This plugin was however updated the last time
over 9 years ago and will be incompatible with ESLint v10, as that
[removes `context.getSourceCode()`][1], the plugin relies on.
To keep the eslint config working with ESLint v10, this replaces
`eslint-plugin-brace-rules` with the [`@stylistic/brace-style`][2] rule
from `@stylistic/eslint-plugin`, a package we already use.
While `@stylistic/brace-style` doesn't offer an option to format braces
in exactly the same way as before, the "allman" style seems to be the
one closest to the existing code.
[1]: https://eslint.org/blog/2025/11/eslint-v10.0.0-alpha.0-released/#removed-deprecated-rule-context-members
[2]: https://eslint.style/rules/brace-style
Previously on non Windows Platforms the Programm would not get its
icon, as the *.rc is not used on e.g. Linux.
Use an xpm File for non Windows Platforms. Use the convenience macro
from wxWidgets to load the icon in a single call.
The icon was converted using GIMP 3.0.6. To avoid `-Wwrite-strings` the
static char* was converted to a const char*.
`LoadScripts` and `LoadDefaultScripts` have to be called imediately
after the `CSimulation2` constructor.
By doing the necesarry work in the constructor and removing
`LoadScripts` and `LoadDefaultScripts` the interface of `CSimulation2`
is simplified.
The NSIS script incorrectly passes the default installation dir as
argument for the auto-uninstaller of previous installs.
This is supposed to avoid moving the uninstaller to a temp file, but it
is unclear why that was done, as this leaves the uninstaller behind.
More importantly, now that we have changed the default installation
directory, the auto-uninstall tries to remove the previous install from
the new location, which does nothing and leaves behind several GB on the
disk.
All functions had a `LDR_` prefix. The prefix is removed.
Functions and globals which are only used in Loader.cpp are now
contained in an anonymous namespace.
When a script in "simulation/helpers/" contained an error. Files in
"simulation/components" aren't loaded. The return value of
`LoadDefaultScripts` indicated an error but was ignored. The simulation
still tried to start.
Now instead of returning a ignoreable error code the error is thrown. In
the common path the error is implicitly rethrown to the JS-function
which tried to start the game.
fixes: #8133
This adds the feature check code found on cppreference [1] and a Jenkins
pipeline to generate a feature status list for all platforms.
Aggregate a summary and upload it to docs.wildfiregames.com
[1] https://en.cppreference.com/w/cpp/experimental/feature_test.html
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
```
source/simulation2/components/CCmpRangeManager.cpp:1953:18: error: Out of bounds access in 'm_LosRevealAll[MAX_LOS_PLAYER_ID+1]', if 'm_LosRevealAll' size is 16 and 'MAX_LOS_PLAYER_ID+1' is 17 [containerOutOfBounds]
m_LosRevealAll[MAX_LOS_PLAYER_ID+1] = enabled;
^
source/simulation2/components/CCmpRangeManager.cpp:1967:21: error: Out of bounds access in 'm_LosRevealAll[MAX_LOS_PLAYER_ID+1]', if 'm_LosRevealAll' size is 16 and 'MAX_LOS_PLAYER_ID+1' is 17 [containerOutOfBounds]
if (m_LosRevealAll[MAX_LOS_PLAYER_ID+1] || player == -1)
^
```
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The user language and start menu folder name were saved, which goes
against recommendations in the NSIS documentation.
The installation directory was also saved, which might make sense,
but prevents us from dropping the "alpha" label.
Reviewed-At: https://gitea.wildfiregames.com/0ad/0ad/pulls/8476Fixes: #7594
Add a Dockerfile having all needed tooling. Using a container also means
those are the libs that will end up being used in the AppImage.
Then add a script for building pyrogenesis either form git or from
extracted source tarballs and for assembling the AppImage and finally
creating the AppImage.
Add building the AppImage to the "bundles" pipeline.
Also add a wrapper script to use podman to drive the whole process
for convenience for local builds.
Ref: #7577
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Commit fe192fe58f added one extra level,
so we have to layout the parent of the parent now to actually layout the
sidebar.
Fixes: #8388
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>