Each sprite is comprised of dynamically scaled 9 slices stored in a designated directory.
Base, over, pressed, and disabled variants are combined into a button style called
'BrownButton'.
The sprites have a native/maximum total resolution of 266 x 74 pixels.
(which is larger than any other button sprites)
Brightness of the base sprite is kept neutral so that it fits on both
light and dark backgrounds.
Disable compression and mipmapping as they don't work well with sliced
sprites.
-During each attack on a low preference target unless player-directed, update the range query and find a new target.
-Adjust behavior for elephants to work better versus infantry.
fixes#1488
Use `std::ranges::max` so that only one iteration is needed to find the
texture of highest priority.
Using `std::ranges::max` with an empty range is undefined behavior. So
there has to be a special case.
Adds a 1/125 chance for a corpse to undergo a decay movement in a given frame.
This allows a probability passed from the template to determine the sinking behavior of the entity.
Fixes#7548
Naval Redux 2.1
1 Greatly streamline the tech tree after some criticism it was too lengthy.
2 Move Scout ship to Village Phase
3 Tweak some ship costs
4 Implement some ideas from @Real_T_S
5 Acquiesce to all of @Real's demands
Their return values (undefined) were unused since 2cccd9825d, which is why they
didn't break anything. But due to the latest GetGUIObjectByName API
changes, they triggered some errors. They can be fully removed safely
now.
Fixes#8340
this commit fix and error in HWDetect when the libraries versions use
only MAJOR.MINOR like zlib in some linux os that is "1.3" that need
char[4] (1.3\0) conversion from Script::ToJSVal.
this commit create an overload template that matches "references to
array of uknown bound" and forward it to existing const char* / const
wchar_t* specializations.
this bug was reported by Vantha.
The first header was used to include the SpiderMonkey JS API at once,
with safeguards and preprocessor defines. Nowadays, SpiderMonkey
provides modular headers allowing us to include what we use, refs #8086.
Some defines have to be moved to compiler options but it is apparently
a mistake from the SM developers:
https://bugzilla.mozilla.org/show_bug.cgi?id=1987876
Now that size uses float when emulating positioning, it was getting a
different value, like 0.008. This commit fixed that issue by using
std::floor to remove small noise.
Symmetrical for LEFT with std::ceil.
The size is now float number, because of this code calculates the
required size, we should always ceiling the value to the next int to
remove any error or unwanted behavior in images or subpixel
calculations.
When scaling the GUI, GetCapHeight was incorrectly accounting for
m_Scale which caused text to be hidden due to improper clipping
calculations.
This commit corrects the CapHeight calculation by ensuring that the
division by m_Scale is applied, allowing text to be displayed correctly
at all GUI scale levels.
When not provided, the number of players on autostart was set to 2,
which is incorrect for skirmishes and scenarios. This commit makes this
parameter ignored for non-random maps, as well as the other parameters
specific to random maps.
Furthermore, 2 is already set as a default number of players for random
maps (in the `PlayerCount` gamesettings attribute), setting it in
autostart code is redundant.
Fixes#8325
Refs #7269
The issue was that the rright value was 100%.
That's why the buttons would always extend across the full width of the
screen.
Replacing the value right in the XML would result in an invalid size, so
we can remove it from there and create a full, separate size in the code
each time (Object.assign just edits it), since the top and bottom values
specified in the XML were overwritten anyway.
And since the left margin of 3 is fixed, we better move it to the parent
object to avoid a constant like that in the code.
Fixes#8322
The gendered civilian change made this unit native to its civil center,
but inherited templates in the proof-of-concept strategic map were not
adapted.
Fixes#8337
`groupedDistance` is the "distance between neighboring players" but it
was used as the radius.
Then there was a special case when the team size is big and the
`groupedDistance` was to small.
With this commit the `groupedDistance` is actually used as
"distance between neighboring players" and removes the special casing.
Change the stronghold placement.
Preqiously the angle between the center of the strongholds where equal.
Now the distance between strongholds is equal.
This is done so that big teams have more space.
wxWidgets can use X11 APIs or the GUI toolkits GTK or QT on Linux, with
pure Wayland only the option to use the toolkits remains for
wxGetKeyState().
wxGetKeyState() is only usable for modifier keys with either toolkit and
so we need to bookkeep ourself.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Tooltips for map sizes were introduced in 8cfd494b88 when 'Giant'
received the same sentence as 'Very Large'.
This commit fixes the tooltip for Giant Maps by giving them a proper
sentence, which might avoid confusion.
Commit 8b11f6a151 requires InitAttributes to be available, which isn't
the case for the secondary context in serialization test. So clone
InitAttributes to make it available.
```
ERROR: JavaScript error: simulation/helpers/Commands.js line 89
InitAttributes is not defined
reveal-map@simulation/helpers/Commands.js:89:7
ProcessCommand@simulation/helpers/Commands.js:932:23
ERROR: Failed to call ProcessCommand() global script function
```
Reported-by: phosit <phosit@autistici.org>
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>