1
0
forked from 0ad/0ad
Commit Graph

21966 Commits

Author SHA1 Message Date
507f44f7f9 Remove all external usage of CmptPrivate. Header cleanup.
This removes usage of CmptPrivate outside of ScriptInterface.
ScriptRequest can now be used to safely recover the scriptInterface from
a JSContext instead of going through ScriptInterface, which allows more
code cleanup.

Follows 34b1920e7b

Differential Revision: https://code.wildfiregames.com/D3963
This was SVN commit r25442.
2021-05-15 13:54:58 +00:00
3ebff376cc Adds view bounds test for an ortho camera and removes commented code after 44f8d2c6f5.
This was SVN commit r25441.
2021-05-15 13:47:48 +00:00
44f8d2c6f5 Fixes a bounding box projection to an incorrect camera causes the red water bug.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/D3905
This was SVN commit r25440.
2021-05-15 13:33:36 +00:00
6b0802836a Fix duplicating promoting entities in XP trickling structures.
The entity received a value modif. message while promoting, triggering a
second promotion.

Differential revision: https://code.wildfiregames.com/D3918
Fixes: #6162
Comments by: @Angen, @Stan
This was SVN commit r25439.
2021-05-15 05:40:13 +00:00
66c75068bc Fix broken non pot texture by @m7600
Reported by: @nwtour
Fixes: #6177 and 318a5d7a2b

This was SVN commit r25437.
2021-05-14 18:06:00 +00:00
79e294ec06 Make fruit (berries and some fruit trees)'s obstructions smaller.
Patch by: @nani
Liked by: @ffffffff
Tested by: me and @Langbart
Differential Revision: https://code.wildfiregames.com/D3957
This was SVN commit r25436.
2021-05-14 15:13:55 +00:00
cf5c815879 Fix 4f972bc623
Shouldn't make last-minute changes without recompiling...

This was SVN commit r25435.
2021-05-14 11:12:07 +00:00
4f972bc623 Split off JSON-related function from ScriptInterface, clean up headers.
Follows 34b1920e7b.

JSON functions and ToString are movec to their own headers.
Also clean out a few PersistentRooted usage to use the 2-phase init to
clean up scriptInterface usage.

With these functions split off, we can finally clean out headers and
remove ScriptInterface.h from most of them, in favour of smaller and
more precise headers.


Take the opportunity to clarify some comments regarding Mutability.

Differential Revision: https://code.wildfiregames.com/D3961
This was SVN commit r25434.
2021-05-14 10:18:03 +00:00
f368e1a69e Remove unused m_rng member from ScriptInterface.
The one in ScriptInterface_Impl is actually used.
Introduced in e9e05f4efc and from what I can tell never actually used.

Differential Revision: https://code.wildfiregames.com/D3960
This was SVN commit r25433.
2021-05-14 09:27:12 +00:00
0f60bf3a97 Split off Object-related functions from ScriptInterface
Follows 34b1920e7b.

This splits off the object-related functions, such as
[Set/Get/Has]Property, CreateObject, CreateArray, FreezeObject.

It also puts the definitions in the header itself, which might end up
with faster code here & there, though perhaps slower compilation time
(somewhat doubtful since we already included most things anyways).

Differential Revision: https://code.wildfiregames.com/D3956
This was SVN commit r25430.
2021-05-13 17:23:52 +00:00
cb263b9f26 Add a decal to the berry bushes to make them more visible and make the fruits bigger
Suggestions by: @m7600, @wraitii, @JCWasmx86
Reported by: @Yekaterina
Thread:
https://wildfiregames.com/forum/topic/39973-a25-feedbacks-from-testing/

This was SVN commit r25429.
2021-05-13 11:19:37 +00:00
61e0aef0b4 Split JS conversions from ScriptInterface.
All ToJSVal/FromJSVal definitions are put in a separate header.
Remove AssignOr[To/From]JSVal duplication.

The functions were already static so this is rather straightforward.

Follows 34b1920e7b and 2bae30c454

Differential Revision: https://code.wildfiregames.com/D3953
This was SVN commit r25428.
2021-05-13 09:43:33 +00:00
d798a2ec0e Fix crash in Atlas.
Fixes 6fbf036ae4

Reported by: Stan
Differential Revision: https://code.wildfiregames.com/D3954
This was SVN commit r25425.
2021-05-12 19:25:09 +00:00
dd19cc3444 Major improvements to the lobby bots XpartaMuPP and EcheLOn.
Reviewers: elexis, Dunedan

Fixes: #5914

Differential Revision: https://code.wildfiregames.com/D2630
This was SVN commit r25424.
2021-05-12 15:40:50 +00:00
4ad78018f9 Fix no-pch build. Potentially fixes bb49fbe793, 0198942a79, 34b1920e7b, 8b08f4ae7a 0dbf417171, 3af1fc64d2, 5fbdbaa3bc, 6fbf036ae4.
Comments by: @vladislavbelov, @wraitii.
Differential Revision: https://code.wildfiregames.com/D3948
This was SVN commit r25423.
2021-05-12 13:48:55 +00:00
bb
412e870c55 Add defeat condition on civil centre loss
Somewhat obsoleting 171afdc7a6.

Reviewed By: Freagarach
Comments By: Stan, Nescio and wowgetoffyourcellphone
Differential Revision: D3530
This was SVN commit r25422.
2021-05-12 13:34:50 +00:00
441c122331 Fix collecting treasures near position.
Also refactors the order a bit to be more equal to other orders.
Removes the `autocontinue` because it was not useful (since that is more
about doing other tasks than the one ordered).
Follows ea96e81098 97addf2aa7.

Differential revision: https://code.wildfiregames.com/D3942
Tested by: @Langbart
Fixes: #6175

This was SVN commit r25421.
2021-05-11 07:41:40 +00:00
6fbf036ae4 Split off StructuredClone from ScriptInterface
Follows 34b1920e7b.

This separates StructuredClone & DeepCopy logic into its own header,
reducing the size of the monolithic ScriptInterface header.

Differential Revision: https://code.wildfiregames.com/D3922
This was SVN commit r25419.
2021-05-10 11:51:32 +00:00
ad62707eef Ensure rated game and cheat won't be enabled at the same time.
Reported by: Freagarach
Differential Revision: https://code.wildfiregames.com/D3943
This was SVN commit r25418.
2021-05-10 07:49:30 +00:00
5fbdbaa3bc Fix 3af1fc64d2 - incorrect texture path on Windows.
sizeof(const char*) returns the pointer size and not the string size,
and 'texture:' happend to be 8 characters long, which is the same as a
64-bit pointer but not a 32-bit pointer.

Reported by: Stan
Differential Revision: https://code.wildfiregames.com/D3947
This was SVN commit r25415.
2021-05-09 17:29:50 +00:00
Angen
b4d11bda89 Fix warnings and missing break from f1acd22455
make linter happy
add missing break to loop if correct comparator has been found, reported
by @Langbart

Differential revision: D3945
Tested by: @Langbart
This was SVN commit r25414.
2021-05-09 17:05:02 +00:00
8f8996e338 Allow registering custom data for triggers
This allows easier handling of e.g. range triggers calling into the same
function.

The original trigger data is also forwarded for convenience.

Differential Revision: https://code.wildfiregames.com/D3904
This was SVN commit r25413.
2021-05-09 16:55:36 +00:00
f653541e2c Fix warnings in 3af1fc64d2
Differential Revision: https://code.wildfiregames.com/D3946
This was SVN commit r25412.
2021-05-09 16:24:13 +00:00
Angen
f1acd22455 Do not allow to start pyrogenesis with incompatible mods
Fixing following problems:
Issue number one:
Enable mod with a23 compatibility in a23b.
Save configuration.
Start a24.
Better result:
Mod will be enabled and invisible in mod selection screen producing
various errors.
Worse result:
Game will crash and refuse to start.

Issue number two:
Mods can silently set loaded mods without restarting the engine, so mods
can unlist themselves from compatibility detection.

Solution:
Enable necessary mods instead if running with gui and open mod page.
Open information window on top of mod page to infom why mod page is
showing up.
On mod page show mods which failed in compatibility check and color the
resposnible ones.
Disable start button without enabled mods.
Show non existed mods if they failed in compatibility check.

Else just log to mainlog and close.

Another fixes:
Display in enabled mods really enabled mods as current logic confuses
players about which mods they have enabled and is not helpful (ref
#4881)

Note:
this will not solve issue with mods claiming being compatible with
engine version while in fact being incompatible.

Comments by: @vladislavbelov, @Stan, @Imarok
Tested by: @wraitii
Differential revision: D3592
Fixes: #6044 #4881

This was SVN commit r25410.
2021-05-09 13:53:25 +00:00
Angen
933b331c1b Hide icon for matches without password
This should help with better visual experience.
Icon introduced in c2155e31c0.

Differential revision: D3939
Fixes: #6153

This was SVN commit r25409.
2021-05-09 13:47:03 +00:00
3af1fc64d2 Allow GUI elements to define custom mouse event mask shapes.
This allows GUI elements to use a texture as their "mouse event mask",
making it possible to have arbitrarily-shaped GUI elements with regards
to mouse interactions.

Used for the minimap idle worker button as a proof-of-concept.

Differential Revision: https://code.wildfiregames.com/D3814
This was SVN commit r25408.
2021-05-09 13:08:07 +00:00
e94faf7827 Don't hardcode the "0ad" resource into lobby XMPP & hosting
XMPP JID has a concept of 'resources', which can be used to
differentiate multiple clients of the same account.

We currently hardcode this 'resource' to '0ad' in two places:
- The 0 A.D. client always uses '0ad'
- The network code expects a host resource to be '0ad' when connecting.

As noted in 0fd8aa2a77#31215, it is less effort to store the JI
D directly. This patch does that. It also makes 0 A.D. use a different
resource each time.
Note that resources ought not contain particular information, as the
XMPP server is free to
 clobber it. I keep '0ad-' here for debug purposes.

This allows:
- multiple 0 A.D. instances to log on the lobby at the same time (not
massively useful, but good for debugging sometimes)
- hosting a game with a custom resource, which will potentially make it
easier to have dedi
cated servers on one account.

Note that hosting multiple games on one account is currently not
supported and will have weird behaviour on the lobbybots side. They
should be upgraded independently of this.

Refs #3556

Differential Revision: https://code.wildfiregames.com/D3500
This was SVN commit r25407.
2021-05-09 12:51:32 +00:00
88810524b3 Make it explicit that technology specific names expect an object.
Simple strings would trigger errors.

Patch by: nwtour
Differential Revision: https://code.wildfiregames.com/D3921
This was SVN commit r25406.
2021-05-09 12:46:58 +00:00
abb124a36f Fix cpuid call with -fPIC on i386 architectures.
GCC < 5 used to reserve the ebx register for PIC (position-independent
code) metadata. This meant that we needed to save the state of ebx
before calling cpuid (fixed in #2675)
However, the original patch from 03eaf9b461 did not force a particular
register to store this value in. Following the GCC 5 upgrade, GCC
stopped reserving ebx, and that register silently got used instead. The
code became non-sensical, and our ASM __cpuidex started returning random
garbage in edx.

Since we now only support GCC7 and above, the PIC-specific branch is no
longer necessary and is removed.

Fixes #6028. The assertion was a result of random data in ebx.
Refs #2675 / reverts 6334ee3f8b and reverts 03eaf9b461.

Patch by: nwtour
Comments by: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D3575
This was SVN commit r25405.
2021-05-09 12:41:45 +00:00
1e1af6e2df Separate campaign replays in replay page & fix for i18n
The 'map name' dropdown filter did not work in localised interfaces.

Patch by: nwtour
Differential Revision: https://code.wildfiregames.com/D3883
This was SVN commit r25404.
2021-05-09 08:39:38 +00:00
14324b8918 Fix auto-complete chat entries for Biome names in GameSetup
The line altered here was returning an Array of Objects. This array
would
eventually passed to code that expected it to be an Array of Strings.
This was
causing an error to thrown that could be replicated by going to the
Multiplayer
GameSetup, entering text (e.g. "Winter", "Dry", "lol") into the chat
field, and
pressing `Tab` to trigger the auto-complete.

This line now returns an Array containing the user-facing names of the
Biomes
available to the selected map (if it has them), which is what this
method was
returning prior to dc18d94030.


Related: dc18d94030, dc18d94030

This was SVN commit r25403.
2021-05-08 20:45:20 +00:00
0dbf417171 Fix 8b08f4ae7a - CGUIColor setting
Reported by: langbart
Fixes #6173

Differential Revision: https://code.wildfiregames.com/D3937
This was SVN commit r25401.
2021-05-07 11:34:20 +00:00
f008edea73 Fx low resource supply tricking AI.
Strength was floored, resulting in possibility for `0`, which was not
handled gracefully by the map.
Since the strength is multiplied by something that can be non-integer in
the map, the floor is not needed.

Differential revision: https://code.wildfiregames.com/D3884
Comments by: @Angen, @smiley
This was SVN commit r25400.
2021-05-07 09:07:20 +00:00
a18d97b047 Let team bonuses also apply to own player.
Requested in D3810 (and other places).
It was weird that e.g. the Romans gave their allies a training bonus but
lacked that themselves.

Differential revision: https://code.wildfiregames.com/D3899
Reviewed by: @ValihrAnt
Comment by: @darkcity
Idea approved by: @wraitii
This was SVN commit r25399.
2021-05-07 08:48:51 +00:00
2dfc8681d2 Fix returning resources by formation members.
Noticed by @mysticjim.
Introduced in 21645f5c1c.

Differential revision: https://code.wildfiregames.com/D3931
Differential revision: D3838
Fixes: #6170
Reviewed by: @wraitii
This was SVN commit r25397.
2021-05-07 07:05:57 +00:00
d2d0c6b347 Some small fixes for the AutoQueue feature.
51ab4315ff
Fix using the hotkey on entities that don't have a Production Queue.
Fix showing the icon on entities that don't produce entities.

Differential revision: https://code.wildfiregames.com/D3932
Fixes: #6172
Comment by: @wraitii
Tested by: @Langbart
This was SVN commit r25396.
2021-05-07 07:01:39 +00:00
64b475b390 Fix Profiler1 "time per turn".
Actually call Turn() when a turn is processed.

Fixes #6144

Differential Revision: https://code.wildfiregames.com/D3885
This was SVN commit r25394.
2021-05-06 16:49:34 +00:00
e0800bc092 Allow toggling repairability.
Useful for trigger maps.

Differential Revision: https://code.wildfiregames.com/D3901
This was SVN commit r25393.
2021-05-06 14:25:33 +00:00
8b08f4ae7a Change GUI settings to explicitly be member variables.
Completes work starting in D2313 / a33fd55e81:
- Make C++ mistakes where values can be changed without messages being
sent easier to notice / harder to do.
- Make the IGUISetting interface more flexible, allowing custom settings
implementing their own logic. This is used to clean up hotkey code
introduced in 33af6da5e1.

Side effects:
- FromJSVal_Vector clears the vector being passed in. I have some vague
memory of not doing that in D24 / 2bae30c454 as an optimisation, but it
seems more like a footgun to me.
- Most usage of SetSettingFromString is replaced by direct method calls,
as we can generally cast to the proper GUI object type. Where we can't,
it is kept as a poor's man virtual dispatch.
- It moves a few member variables elsewhere, e.g. TextOwner now gets its
own member variable settings.

Differential Revision: https://code.wildfiregames.com/D3892
This was SVN commit r25392.
2021-05-06 08:22:37 +00:00
4db5467717 Fix mistake in 100159548c
I last-minuted a "X = X * Y" into a "X *= Y" but that turns out to map
to "X = Y * X" with our matrix overloads.

Reported by: langbart
This was SVN commit r25391.
2021-05-06 07:42:49 +00:00
c2167ffc7e Differentiate a bit the spart and athen rams.
- Use Athenian Shields
- Reduce Duplication
- Add default material

Patch by: @wowgetoffyourcellphone & @Stan`
This was SVN commit r25390.
2021-05-06 07:17:09 +00:00
100159548c Fix bounding boxes after f73fa05542
Skinning calculations must happen in bone-space.

Fixes f73fa05542

Reported by: langbart
Fixes #6168

Differential Revision: https://code.wildfiregames.com/D3927
This was SVN commit r25387.
2021-05-05 16:20:33 +00:00
781afea4b1 More broken implicit conversions.
Differential Revision: https://code.wildfiregames.com/D3928
This was SVN commit r25386.
2021-05-05 15:39:44 +00:00
8724b86915 Fix macOS boost compilation
Bintray has moved. Also upgrade to 1_76 while at it.

Differential Revision: https://code.wildfiregames.com/D3925
This was SVN commit r25383.
2021-05-05 08:25:01 +00:00
51ab4315ff Enable production entities to autoqueue.
This adds a new command button that enables training of units
automatically.
Use:
- Enable auto-queue.
- Train an entity.

This adds a new item to the queue whenever the previous item starts,
such that good micro is more resource-efficient.

Patch by: @azayrahmad
Differential revision: https://code.wildfiregames.com/D3865
Comments by: @Langbart, @nani, @Stan, @wraitii
This was SVN commit r25381.
2021-05-05 06:12:31 +00:00
fe3ff1b0ff Map browser fixes and improvements
- 'Random' map is filtered correctly
 - When in 'fallback to all' mode, selecting something works (#6165).
 - Fix hotkeys being broken (fixes map browser following 0406c4dfde)
 - Clear filters when reopening the map browser (seems natural).

Based on a patch by: nani
Refs #6045.
Fixes #6165.

Differential Revision: https://code.wildfiregames.com/D3833
This was SVN commit r25379.
2021-05-04 16:40:16 +00:00
2e08fd38ea GUI cleanup: XML & child handling.
- We only need an XMBFile, not a CXeromyces to parse GUI
objects/scripts/... This makes the interface more consistent with other
usage, notably ParamNode.
- Rename IGUIObject::AddChild to RegisterChild and flesh out the
interface a little.

Differential Revision: https://code.wildfiregames.com/D3908
This was SVN commit r25378.
2021-05-04 15:17:50 +00:00
0198942a79 Fix warning in cdd75deafb
GCC complained, even if the path cannot be taken.

This was SVN commit r25377.
2021-05-04 14:01:18 +00:00
911f49c655 Gamesetup: make sure GameSpeed is a number
The dropdown converted the numbers to string, and the code expected
numbers.

Differential Revision: https://code.wildfiregames.com/D3924
This was SVN commit r25376.
2021-05-04 13:59:30 +00:00
cdd75deafb XMB Improvements, parse JS into XMB, make strings more efficient.
XMB format is bumped to 4, invalidating all cached files. The
differences are:
 - element/attribute names are stored after the elements themselves, and
not before. This allows writing XMB data in one pass instead of two.
 - names themselves becomes offsets (instead of arbitrary integers),
making getting the string from the int name much more efficient.

XMBFile is renamed to XMBData to clarify that it does not, in fact,
refer to a file on disk.

XMBData::GetElementString is also changed to return a const char*, thus
not creating an std::string. A string_view version is added where
convenient.

The XML->XMB and JS->XMB conversion functions and the corresponding
storage are moved to `ps/XMB`, since that format doesn't particularly
relate to XML. CXeromyces becomes lighter and more focused as a result.
The XML->XMB conversion also benefits from the above streamlining.

Note that in a few cases, string_view gets printed to CLogger via
data(), which is generally not legal, but we know that the strings are
null-terminated here. Our libfmt (version 4) doesn't support
string_view, that would be v5.

Differential Revision: https://code.wildfiregames.com/D3909
This was SVN commit r25375.
2021-05-04 13:02:34 +00:00