Commit Graph

16722 Commits

Author SHA1 Message Date
real_tabasco_sauce 55c17a905d Use footprint for fish selection box
The addition of seagulls made fish selection boxes large, leading to clumbsiness when trying to select fish. Using the footprint for the selection box makes for a more intuitive selection.
2025-08-10 13:00:51 +02:00
Stan 0dc9477109 Fix missing this call
Reported by: @trompetin17
Pull Request: #8265
Fixes: e35fce8524
2025-08-09 16:32:09 +02:00
Jonny McCullagh aee2aa4cfd Add new historical quotes 2025-08-05 22:27:12 +02:00
Kate 96ab6ecb41 Rename "Join game" to "Connect by IP" in main menu 2025-08-05 22:04:13 +02:00
phosit b1196fc94f Use promises to update the colormixer
Callbacks introduce indirections which are harder to understand.
2025-08-05 19:15:01 +02:00
phosit 17338daaaa Groupe a chanels in the collor-mixer
It's easyier to construct and iterate chanel by chanel instead of
iterating three arrays at once.
2025-08-05 19:15:01 +02:00
phosit 6c481d4811 Make the colormixer a module
Modules don't expose global symbols. Because of that not all functions
have to be cramed in to one class. The functions can now be split in a
more readable way.

Ref: #8081
2025-08-05 19:15:01 +02:00
trompetin17 251f6bfc86 Enhance language selection by applying CJK font styles 2025-08-04 09:35:46 -05:00
trompetin17 47454a592e Fix casing for debug box configuration keys in default.cfg and TextRenderer.cpp 2025-08-04 07:44:12 -05:00
phosit 9f15df2831 Calculate baseResourceConstraint only once
`baseResourceConstraint` was calculated for every resource.
2025-08-03 21:05:14 +02:00
phosit 0cf1697594 Allow maps to not specify BaseResourceClass
There was already a check to handle no `BaseResourceClass` but it's
handled in a way that could lead to errors later on.
2025-08-03 21:05:14 +02:00
phosit 0c96ef7906 Add stronghold placement to Cantabrian Highlands
With stronghold each team is placed on a hill.

With stronghold placement the hills are bigger. On tiny maps the ramps
might overlap and enemies might not be reachable. To prevent that the
ramps are shortened and the angle is changed to point more towards the
center of the map.

Refs: #7717
2025-08-03 19:08:04 +02:00
phosit ecb2db1dcd Return objects from placement-functions
An alternative to 6a43f91630 which doesn't restrict
`playerPlacementByPattern` to return exactly two values.
2025-08-03 19:08:04 +02:00
phosit 50b76acdd5 Restrict foundations on survival of the fittest
Units which are able to build can't reach the center, to build the
placed foundation and the collectors can't build.

This might help Petra a bit and avoid players placing foundations that
cannot be built.
2025-08-03 16:50:43 +02:00
rene 35db768ae5 Remove incorrect tech requirement for Kushites
Naval Ballistae cannot be researched by the Kushites, who don't have
access to siege ships. Hence their unique Flaming Projectiles technology
cannot depend upon Naval Ballistae.

This removes the dependency and increases the cost of the unique tech.

Fixes: #8046
Patch-By: rene
Reviewed-By: Itms
Reviewed-At: https://gitea.wildfiregames.com/0ad/0ad/pulls/8056
2025-08-03 00:29:51 +02:00
phosit 07309450fc Make also dap respect 'no-useless-assignment'
Forgotten in #8163 due to rebase.
2025-08-01 15:57:27 +02:00
phosit 582541ea80 Enable eslint rule 'no-useless-assignment'
Enable rule 'no-useless-assignment' [1] and fix violations.

[1] https://eslint.org/docs/latest/rules/no-useless-assignment
2025-08-01 11:26:40 +02:00
Stan e35fce8524 Move globals to the PopCapManager prototype. 2025-07-27 19:00:04 +02:00
phosit e03b6ae657 Remove isNomad in unknown.js
`isNomad` got removed in 6bb7f3fd39 this use was missed.

It wasn't called. So it always evaluated to true.
2025-07-21 11:07:57 +02:00
trompetin17 b32b018769 Fix chat session incorrect width calc
Refs: #8188
2025-07-17 09:46:31 -05:00
trompetin17 ffdf527d90 Fix label resizing in Map Browser
Refs: #8188
2025-07-17 09:46:18 -05:00
trompetin17 01d2481f55 Fix Structure Tree misplaced phase icons
Refs: #8188
2025-07-17 09:45:35 -05:00
phosit 8f9c92f30c Utilize minDist in placePlayerBaseBerries
Only maps where `minDist` and `maxDist` differ get changed by this
commit. That is only "Deep Forest".

This has been around since `placePlayerBaseBerries` got introduced in
921850cdef.
2025-07-13 20:29:54 +02:00
phosit 6bb7f3fd39 Remove isNomad from rmgen-common
This removes a usage of the global `g_MapSettings`.

The conversion to bool isn't required.
`mapSettings` (non-global) is available since e01ea16ae5.
2025-07-13 20:29:54 +02:00
phosit aa0c195332 Remove get function in placePlayerBase
`get` is used to get a property of `args` or a default if the property
doesn't exist.
`args` was bound to `get` so it obscured dataflow.

`get` was usefull when there wasn't a `??` operator.
2025-07-13 20:29:54 +02:00
phosit bb76a4f711 Remove trivial playerPosition
`playerPosition` is the same as `args.playerPosition` so it isn't of
much value and does obscure dataflow.
2025-07-13 20:29:54 +02:00
trompetin17 20b7c3f9b8 Implement Debug Adapter Protocol (DAP) Interface in debugger.js
Adds initial support for the Debug Adapter Protocol (DAP) to
SpiderMonkey via debugger.js. This JavaScript-based implementation
enables external debuggers (e.g., VS Code) to interact with the JS
runtime using the DAP interface.

Implemented DAP requests and events:

- attach
- initialize (capabilities)
- stopped event
- threads
- scopes
- variables (globalThis pending)
- continue
- stepIn
- stepOut
- setBreakpoints
- Handling of debugger statements

This forms the foundation for interactive debugging of in-game scripts,
providing smoother integration with developer tools.
2025-07-11 11:06:05 -05:00
trompetin17 678a33c100 Dap Interface with Spidermonkey debug
Spidermonkey provide a mechanics to debug all comportaments and real
from a different place with JS code this allow us to reuse the current
scriptinterface but addind the new Debugger object definition only for
debugging without change any code from other place like GUI &
simulation.

Debugger Adapter Interface is a protocol that commons IDE implement to
being able for debugging, the concept is to provide sockets connections
with c++ but the Dap implementation in JS that allow us to extend for
more Request / Events that DAP provide.

Because Dap Interface its implemented with JS we need to handle message
in the main thread so we are calling in the main loop before GUI
messages
2025-07-11 11:06:04 -05:00
phosit 616fa4a006 Handle C++ exceptions in Engine functions
`JSNatives` passed to SpiderMonkey must not throw exceptions. Most
callbacks are wrapped in `ScriptFunction::ToJSNative`.
This commit adds exception handling to `ScriptFunction::ToJSNative` so
that exceptions thrown in the wrapped callbacks are catched and rethrown
as JavaScript `Error`s.
2025-07-08 19:11:49 +02:00
trompetin17 251f599ad2 Expand summary GUI resource columns
Mods can add more resources than the summary screen’s fixed layout
handled, which crashed with:

ERROR: JavaScript error: gui/summary/layout.js:269 headerGUI is null

This patch doubles the column templates (9 → 18) and updates the
iteration logic so extra headers no longer resolve to null. It removes
the need for copy-paste XML edits when mods grow the resource list.

Known limitations
-----------------
* Column count is still static; a future change should generate the
  layout from g_Resources at run-time.
* UI tested at 1080p and 4 K; very small resolutions might require a
  horizontal scroll solution.
2025-07-06 22:33:25 -05:00
obelix 9970706deb Fixes typo in gerousia.xml 2025-07-06 05:57:43 +02:00
obelix bf25c463c5 Correction of the tooltip in gerousia.xml
Add 'and heroes' to the tooltip as this building trains three of them.
2025-07-06 05:57:43 +02:00
wowgetoffyourcellphone af84640a0c Update cape_long_gaul.xml
Fixes the cape not animating while the Gallic skirmisher attacks.
Also has a small formatting improvement.

Fixes #7970
2025-07-05 18:57:15 +02:00
trompetin17 11a108d00c GameSettingsController: clear stale “Removed” flag
If a human player is set to “Removed” in Game Setup, leaves to the
main menu, and re-enters, they are auto-assigned back to the same
slot but still flagged as removed, triggering an instant defeat when
the match starts.

GameSettingsController::onLoad already reconciles **playerAI** against
current player assignments, but the analogous check for the new
**playerRemoved** setting was missing. The flag therefore survived
persisted-settings reloads.

This mirrors the existing AI-conflict logic and resets the flag
whenever a human player occupies the slot.

Bug reported by *elexis*.
2025-07-03 20:41:39 -05:00
Ralph Sennhauser 0f39dcf2c3 Fix white-space error in 8b5bcf05d7
The workflow was run before the addition of white-space error check, so
the trailing white-space made it in.

This commit unblocks the CI.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-02 11:56:09 +02:00
Langbart 8b5bcf05d7 fix: adjusts the tooltip for the fire ship
ref: https://gitea.wildfiregames.com/0ad/0ad/pulls/7510#issuecomment-110923
2025-07-02 07:23:03 +02:00
Langbart 86077bc97f fix: remove 'Heroes' in the spart/syssiton tooltip
ref: https://gitea.wildfiregames.com/0ad/0ad/pulls/7510#issuecomment-114268
2025-07-02 07:23:03 +02:00
Langbart 1aae83f20a fix: wrongly owned entities on the skirmishes/isthmus_of_corinth_2p map
ref #6688
2025-07-02 07:23:03 +02:00
Langbart 091e865243 fix: remove redundant splash tooltip
ref 22b72a362b
2025-07-02 07:23:03 +02:00
Langbart 1f074862cd fix: remove unsupported modifications in ram_garrison.json
ref: #6884
2025-07-02 07:23:03 +02:00
Langbart 26a3f4e8aa fix: increase kennel vision
Default vision of 4 is too low when standing in FOW.
2025-07-02 07:23:03 +02:00
Langbart 1e72caa0f6 fix: increase vision for onager
Increase vision range to avoid continuous firing for most structures.
Ref: #6708

Rename onager template to 'siege_onager_unpacked' to follow existing
naming conventions.
2025-07-02 07:23:03 +02:00
Langbart 1f32412e8d docs: update entity classes and categories
checked for missing, redundant and duplicates classes, Removed 'Fire' no tech uses it and classification value is zero
2025-07-02 07:23:03 +02:00
Langbart 834fff776c fix: delist promoted entities on training panel
promoted entities dont need to be listed if the subset unit is present
2025-07-02 07:23:03 +02:00
Langbart db57e58fd5 fix: add missing civ tags to templates
ref: #7438
2025-07-02 07:23:03 +02:00
Vantha 9c8c8bc42a Enable normal-map-specific compression for skins and terrains
Normal maps contain redundant color information and the engine supports
compression algorithms (like DXT5n) optimized for that.
It has previously only been enabled for the water normal maps.

Pull Request: #8114
2025-07-01 13:42:53 +02:00
rene 3c457457cd Add tip about lost resources when gathering
Illustration by: Vantha
Feedback by: Vantha, Langbart
Fixes #7652.
2025-06-28 10:39:52 +02:00
trompetin17 3db465587f Fix chat input size assignment typo
Fixes a typo introduced in fd847c2a23 where the code
incorrectly modified chatSubmitButton.size instead of
chatInput.size, effectively collapsing the input field's
width to zero.

This change ensures the chat input field resizes correctly
based on the button's position.

Thanks to Langbarg for noticing the issue.

Refs: #8138
2025-06-27 08:38:38 -05:00
trompetin17 22d3a52b38 Fix chat wrapping by replacing Object.assign
Fixes a bug where chat overlay text wrapping changed
unexpectedly when earlier messages expired.

The issue was caused by Object.assign modifying the size
object in place, which did not trigger proper recalculation
for getTextSize in subsequent frames.

Replacing it with direct assignment ensures the size object
is recompute, allowing correct layout behavior.

Bisected to: fd847c2a23

Thanks to Langbarg for identifying the root cause.

Ref: #8043
Fixes: #8138
2025-06-27 08:38:37 -05:00
Vantha bef29e4af5 Add some new tips 2025-06-27 15:34:44 +02:00