Commit graph

25926 commits

Author SHA1 Message Date
Atrik
202bdb133a Add Atrik to art credits 2026-07-30 20:54:19 +02:00
Atrik
46981d2b90 Add missing garrison flag to German houses 2026-07-30 20:54:19 +02:00
Ralph Sennhauser
49c887b7ca
Don't nest Paths in Common settings
Doesn't make sense to have the Paths StaticBox inside the Common
settings StaticBox so make it a top-level item as well.

While at it dissolve nested constructors to make the creation of the
widgets more readable.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-30 18:43:24 +02:00
Atrik
91a37e32f6 Sort units spatially for freehand selection
Some checks are pending
checkrefs / lfscheck (push) Waiting to run
checkrefs / checkrefs (push) Waiting to run
lint / cppcheck (push) Waiting to run
lint / copyright (push) Waiting to run
lint / jenkinsfiles (push) Waiting to run
pre-commit / build (push) Waiting to run
2026-07-30 17:19:39 +02:00
Atrik
139b08fe6d Add tests for SelectionBoxTargeting 2026-07-30 17:19:39 +02:00
Atrik
dc6da217fd Enable using SelectionBox for targeting
Introduce a new  input, a command handler and adapt
UnitAI to handle arrays of targets in a single order
2026-07-30 17:19:39 +02:00
Atrik
e41dd2d3a4 Add Math.clamp utility function 2026-07-30 17:19:39 +02:00
phosit
c7953026dd
Use switchPage in autostart
Autostart used `OpenChildPage` to open the loading page. Because it's
started as child page the program doesn't end when closing it.
2026-07-30 12:36:51 +02:00
Ralph Sennhauser
0340cc9abd
Make NUSpline public members protected
Some checks are pending
checkrefs / lfscheck (push) Waiting to run
checkrefs / checkrefs (push) Waiting to run
lint / cppcheck (push) Waiting to run
lint / copyright (push) Waiting to run
lint / jenkinsfiles (push) Waiting to run
pre-commit / build (push) Waiting to run
Add a getter for MaxDistance and make members protected and inline
initialization.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-29 18:44:03 +02:00
Ralph Sennhauser
aeeda05433
Prefix NUSpline member variables
To follow coding convention rename the vector Node to m_Nodes,
MaxDistance to m_MaxDistance and NodeCount to m_NodeCount.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-29 18:44:03 +02:00
Atrik
0da1e0c398 Reveal Gaia wonders to players
Some checks are pending
checkrefs / lfscheck (push) Waiting to run
checkrefs / checkrefs (push) Waiting to run
lint / cppcheck (push) Waiting to run
lint / copyright (push) Waiting to run
lint / jenkinsfiles (push) Waiting to run
pre-commit / build (push) Waiting to run
2026-07-29 18:02:37 +02:00
Atrik
dc1e7179a3 Reveal and notify Wonders being constructed
Fixes #8683
2026-07-29 18:02:37 +02:00
Atrik
b6d9d87ba9 Add a test for ExploreCircle 2026-07-29 18:02:37 +02:00
Atrik
839226d542 Support revealing a small area of the map 2026-07-29 18:02:37 +02:00
Vladislav Belov
4125e5b645
Adds sRGB support to GLES 2026-07-29 01:29:11 +02:00
Vladislav Belov
f781181899
Adds sRGB support for proper lighting
Currently we're incorrectly using sRGB colors as raw inputs for lighting
instead of conversion to linear space. For proper PBR we need linear
values.
2026-07-29 01:29:09 +02:00
Vladislav Belov
e2f5b20922
Fixes GL internal format of textures in compute
In compute shaders load/store operations requires sized formats.
2026-07-28 23:32:23 +02:00
Vladislav Belov
b3165505b6
Fixes possible artifacts with GPU skinning on GL
std140 requires 16 bytes alignment and it makes alignment of uvec2 in
SkinData be equal to 16 bytes instead of 8 bytes.
2026-07-28 18:12:21 +02:00
Itms
15b9a39b00
Rebuild SPIRV shaders on all shader changes
Fixes #9096
2026-07-28 16:26:16 +02:00
Ralph Sennhauser
cf7b8aab39
Preserve Cinema Path selection
Commit 81c57e8a28 added support for adding and removing paths.
Reloading path list stores the current selection but it's unused, assume
the idea was to restore it again.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-25 17:18:16 +02:00
Ralph Sennhauser
df06b6895e
Don't mix static and dynamic events
Commit 309ed5ef28 used dynamic events
which prevents some other menu items from working properly. So don't mix
static and dynamic events for top window.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-25 14:05:38 +02:00
phosit
a80446eb59
Use the profiler to profile map generation
Instead of writing the duration to the console it uses
`Engine.ProfileStart` and `Engine.ProfileStop` to profile map
generation.

Refs: #5263
2026-07-25 10:47:49 +02:00
phosit
4122f0bfb3
Use atomic instead of COMPILER_FENCE for Profiler2 2026-07-24 17:22:44 +02:00
Ralph Sennhauser
aae1bbbab2
Use new WX object macro
Added in 2010.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-24 16:51:58 +02:00
Ralph Sennhauser
8523fa5ab4
Fix Atlas build on macOS Tahoe
Bump wxWidgets, the upstream fix was backported to 3.2.9 with commit
a6fc33b416e2ebc804d80a1ac66021935c434573

Fixes: #8594
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-24 13:14:34 +02:00
phosit
8b1e78ae1e
Use JS classes for the AI
Fixes: #6285
2026-07-23 15:15:59 +02:00
phosit
09671b49a2
Use JS classes for QueuePlan
Classes derifed from `QueuePlan` used manual inherintance.

Refs: #6285
2026-07-23 15:12:50 +02:00
phosit
327e70ea82
Use JS classes for Template and Entity
`Template` and `Entity` used a costum form of inheritance.

Refs: #6285
2026-07-23 15:12:50 +02:00
phosit
f9de339f85
Use JS classes for Terain-Analysis and InfoMap
`TerrainAnalysis` and `Accessibility` used a costum form of inheritance.

Refs: #6285
2026-07-23 15:12:50 +02:00
phosit
ea1026a1cc
Define the terrain states in a dedicated file 2026-07-23 15:12:49 +02:00
Vantha
2520c45220 Only call Engine.EndGame right before closing
Since #7786, the GUI tick completed normally after calling
`closePageCallback` instead of being cancelled like previously. Since
`Engine.EndGame` deletes the internal `g_Game` pointer, every Engine call
after it that tried to access `g_Game` caused a segfault.
This patch solves it by moving `Engine.EndGame` to the very end, right
before closing the session page.
In order to follow the convention that only functions directly closing
the page are called `closePageCallback`, that function is in turn
renamed to `closeSession`. Additionally, this allows only resolving
the promise with a bool (`showSummary`) and then only calling
`getNextPageOpenRequest` at the end of `init` for reasons of simplicity.
2026-07-22 23:51:49 +02:00
Vantha
801d21671e Correct hotkey names in Economy Walkthrough
The queue hotkey is called "session.queue", not "selection.queue"

Fixes #8939
2026-07-22 23:51:49 +02:00
Vantha
931c132b1b Fix brief text misalignment in GUI text objects
The issue was introduced by 8a2a450686.
It affected GUI text objects (CText) with `scrollbar` set to true; when
their caption was long enough for a scrollbar to be visible and then the
size changed (got bigger) so that no scrollbar was needed anymore, then
for a single frame the text was completely misaligned. This happened
because in `CText::Draw` the scrollbar wasn't updated yet, so the newly
added `GetScrollBar(0).IsVisible()` check still returned true, even
though it wouldn't end up being rendered anyway -- it was updated in
`IGUITextOwner::DrawText` eventually.

This happened to the tutorial info panel in the starting economy
walkthrough, for example. Note: in that case the scrollbar wasn't ever
drawn, but it was temporarily set visible within a frame by the JS
object resizing logic.
2026-07-22 23:51:49 +02:00
Vantha
6ed963b94c Don't check all scrollbars' visibility in CText
The CText class is designed to only work with one scrollbar, so the
any_of was pointless.
2026-07-22 23:51:49 +02:00
Vantha
a784659158 Two adjustments to the Introductory Tutorial
This patch splits the steps that said "Wait for X and then do Y" into
two different steps "Wait for X" and "Do Y".
2026-07-22 23:51:49 +02:00
Vantha
52b40aaa4f Add a tutorial panel for explaining the GUI
This patch adds a new type of tutorial steps called "GUI explanation",
with a corresponding GUI panel. The purpose of it is to explain what a
certain GUI element does. To make use of it the trigger script has to
specify the target GUI object's name as well as the side on which to
place the explanation panel relative to the target itself. The panel
then highlights the target object by fading everything else out with
black and also uses an arrow to point to it. Whilever the target GUI
object is hidden, the panel hides the background fade too and shows a
warning message.
Unlike for the other steps, the TutorialManager does not hide the
previously active panel when showing a GUI explanation, but instead
only disables it, since it could contain relevant information and the
GUI explanation panel is visibly placed "above" all other panels (in the
Z axis).
2026-07-22 23:51:49 +02:00
Vantha
27fbf02ff4 Improve the ending of tutorials
This patch introduces two functions `CompleteTutorial` and
`FailTutorial` for the tutorial steps to call. They can pass a
message to it to be shown on the victory/defeat screen.
`CompleteTutorial` is also called automatically when all steps are
finished, which resolves #8583 and prevents it from happening in the
future.
`FailTutorial` isn't used anywhere at the moment, but it'll be useful
for the future.

Fixes #8583
2026-07-22 23:51:49 +02:00
Vantha
f1a9c503b8 Support custom hint & button captions in the tutorial
This patch allows steps to override the default hint caption and button
caption set by the PanelControlSection class. This allows them to better
communicate what the player is supposed to do, e.g. don't show "Follow
the instructions" if the player is only supposed to wait.
2026-07-22 23:51:49 +02:00
Vantha
f39e71cca0 Move calls in playersFinished to handlers
This patch fixes the TODO comment in playersFinished and moves
all of the calls to handlers. The only reason for adding back the
function `handlePlayersFinished` is to prevent duplication in the "won"
and "defeated" message handlers. In the future, code to execute when
players finish in the future should exclusively be added by registering
new handlers, not by adding it to that function.
2026-07-22 23:51:49 +02:00
Vantha
6456bccebe Replace old GetState and SetState calls
966727b52e made the player state an enum and introduced more descriptive
functions to achieve the same thing, but it seems they were forgotten to
be replaced in a few places, which this patch fixes.
2026-07-22 23:51:49 +02:00
Vantha
0cc025f675 Indicate if a tutorial step is already done
If a new tutorial step has already been completed by the player it isn't
skipped, but instead shown with the continue button, so that the player
can manually switch to the next one. However, it wasn't well
communicated to the player that this was the case and why the continue
button was shown at the same time as the instruction. This patch adds a
hint "You have already done this." to explain the this to the player.
2026-07-22 23:51:49 +02:00
Vantha
05d434830f Add hotloading support to the tutorial UI 2026-07-22 23:51:49 +02:00
Vantha
2522c305dd Allow defining tutorial steps more compactly
This allows the trigger scripts to combine consecutive tutorial steps
that only differ in the `panelData.text` property into a single one that
instead defines a `panelData.texts` array.
2026-07-22 23:51:49 +02:00
Vantha
7e77065c56 Add an info panel to the tutorial
This patch adds a new tutorial step type and corresponding tutorial
panel labelled "info". It is intended to display steps whose purpose it
is to explain something to the player and give tips -- rather than
just giving instructions and telling the player what to do, like the
instruction panel does.
Also, it can show several related steps at once. To do that, the first
step has to set the 'appendable' flag to true and can also define a
title; then the succeeding steps can then set the 'appendToPrevious'
flag to true in order to do exactly that.
Note: 'info'-type tutorial steps are still supposed to be able to define
triggers, switch to the next step on their own and hide the continue
button on the info panel, to teach the topic interactively, e.g.
"Select a unit by left-clicking on it."

In order to prevent code duplication between `InfoPanel` and
`InstructionPanel` a generic superclass `TutorialPanel` is introduced,
which manages the text, hint, and button objects.
2026-07-22 23:51:49 +02:00
Vantha
6dd8139b43 Only show the last instruction in the tutorial
The idea is to add different types of panels to the tutorial in the
future. And the only texts that players might read multiple times are
tips or explanations, which the plan is to display on an entirely
separate panel anyway.
2026-07-22 23:51:49 +02:00
Vantha
c2c8f5bdf2 Remove pointless trainingDone from tutorial
In `Init` it was always overwritten to false, so `IsDone` always returned
false anyway.
2026-07-22 23:51:49 +02:00
Vantha
1f7d384c29 Fix player command handling in the tutorial
Move the code that checks whether a player command is a "continue
tutorial" into a separate method, so that it never overrides the player
command action of the active tutorial step. This could previously
happen if a step had the showContinueButton flag was set to true (and
a OnPlayerCommand method defined).
2026-07-22 23:51:49 +02:00
Vantha
2f27dcc97d Rename index to stepIndex in Tutorial.js
Makes it more clear what it is an index of.
2026-07-22 23:51:49 +02:00
Vantha
6e6864fd7c Improve internal naming of tutorial triggers
Make the naming consistent with e.g. the Triggers Demo map
Remove the "On" at the start, since it's otherwise used for message
handlers, and replace "Trigger" at the end with "Action", since that
more accurately describes what it is.
2026-07-22 23:51:49 +02:00
Vantha
702e3f1113 Revise tutorial step handling
- Remove the delay functionality from the tutorial. It was unused and
  that for a reason. Switching to the next step after a fixed amount of
  time is never wanted. It was only used to force-show the ready button
  in one case, but a designated bool communicates the purpose better.
- Rename the "ready" button to "continue" as it fits better.
- Rename "leave" to "isLast" as it's more descriptive.
- Rename the "warning" object of the instruction panel to "hint" as it's
  not always display warnings, and move its captions to the class
  prototype like the coding conventions state.
- Simplify the logic in NextStep a bit to make it more readable.
2026-07-22 23:51:49 +02:00