Commit Graph

19855 Commits

Author SHA1 Message Date
wraitii 381bdcbade Fix cc1ea7cca0 error in Promotion when promoting an entity that died on the same turn.
Add a regression test for this case.

Reported By: elexis
Differential Revision: https://code.wildfiregames.com/D2227
This was SVN commit r22808.
2019-08-31 12:38:38 +00:00
elexis 395fae107b Fix missing PushGuiPage callback replacement in session/ openManual() in 86c151ebaa, refs D1684.
This was SVN commit r22807.
2019-08-31 11:00:26 +00:00
LordGood 7943d82bfe Cypresses, maritime pines, emergent teak variant, grasses ptolemaic tower, walls and temple commit, ptolemaic texture split
This was SVN commit r22804.
2019-08-30 00:19:16 +00:00
elexis b59198524f Remove PETRA Module and Augmentation pattern from 3362c591f5, refs #2322, and in Petra since 97afd25171.
The objective of 3362c591f5 to have only one global for multiple AIs is
still achieved by not changing the resulting object structure.
The advantage of not using the pattern is to have less parental scopes,
i.e. more localization and separation of concerns.
This resembles the successful simulation script component system.
The stated benefits of the Augmentation pattern were never used, because
there are (luckily) no such private variables or globals passed as
arguments.

Fixes an ESLint warning about using PETRA before it is defined, refs
#5524, D1993.
Fixes the missing level of indentation if indentation should represent
scoping proportionally.

Remove superfluous, thus misleading name PetraBot in PETRA.PetraBot
assignment.

Differential Revision: https://code.wildfiregames.com/D2103
Patch By: Krinkle
Related comments by: Yves, wraitii, Philip, leper on #0ad-dev on
December 2013, see #2322
Source was:
http://www.adequatelygood.com/JavaScript-Module-Pattern-In-Depth.html

This was SVN commit r22803.
2019-08-29 18:12:53 +00:00
Stan bc9116cdfb Use the @wowgetoffyourcellphone's Uffington Horse as the Briton Wonder committed in @Enrique's special commit 83680b0dee. As such the building is no longer garrisonable, and no longer gives a population bonus.
Discussed with: @wowgetoffyourcellphone
Thread 1:
https://wildfiregames.com/forum/index.php?/topic/20986-civ-britons/&tab=comments#comment-318536
Thread 2:
https://wildfiregames.com/forum/index.php?/topic/17495-task-wonder-britons-stonehenge-and-white-horse/page/6/&tab=comments#comment-298890

This was SVN commit r22802.
2019-08-29 15:55:12 +00:00
elexis 9c6039e4fe Solemnly delete class GUI and rename GUIUtil.h to CGUISetting.h.
Finishes GUIutil rewrite and fixes #5575.

Differential Revision: https://code.wildfiregames.com/D2233
Test on: clang 8.0.1, Jenkins

This was SVN commit r22801.
2019-08-29 09:07:29 +00:00
elexis 0c3a610acc Delete invalid ModmodScrollbar style use and style property from 64bfa089af and 833c9f108c, identified by the LOGWARNING from be963ec9b7, reported by nani.
This was SVN commit r22800.
2019-08-29 07:56:26 +00:00
Alexandermb 18c90ce449 Fix female axe position while gathering wood.
Reported by @wowgetoffyourcelphone

This was SVN commit r22798.
2019-08-28 17:51:49 +00:00
elexis fac98e7afb Move other/wallset_palisade to structures/wallset_palisade, refs #4770, D1002, D1798.
Differential Revision: https://code.wildfiregames.com/D1881
Patch By: Nescio
While at it, fix ESLint overshadowing warning in survival triggers from
804fd4be61, unnoticed in b8fbfe2d20 and 18e7d8a518 but noticed by
Jenkins.

This was SVN commit r22797.
2019-08-28 12:06:59 +00:00
elexis 1a49ccb294 Move static GUI<>::SetSetting operating on IGUIObject to a member IGUIObject::SetSetting.
Remove PSERROR codes from SetSetting (let std::map throw an out_of_range
if a caller wants to Set a setting that doesn't exist without having
checked with SettingExists, equal to GetSetting from 92b6cdfeab).
That also simplifies std::function SetSettingWrap construct from
0a7d0ecdde to void IGUIObject::SettingChanged.
Don't trigger debug_warn or exceptions in GUITooltip::ShowTooltip if the
XML author specified wrong tooltip input, and dodge another
dynamic_cast.

Rename existing IGUIObject::SetSetting to
IGUIObject::SetSettingFromString and comment that it is purposed for
parsing XML files.
Remove SetSetting default value, so that authors are made aware
explicitly of the need to decide the function broadcasting a message,
refs d87057b1c0, 719f2d7967, ...
Change const bool& SkipMessage to const bool SendMessage, so that a
positive value relates to a positive action.
Clean AddSettings whitespace and integer types.

Differential Revision: https://code.wildfiregames.com/D2231
Tested on: gcc 9.1.0, clang 8.0.1, Jenkins
Comments By: Philip on IRC on 2010-07-24 on GUIUtil being ugly, in case
that one counts

This was SVN commit r22796.
2019-08-28 11:21:11 +00:00
Alexandermb 36e2c1caf8 Remove now unused rome_helmet_attic.xml due to better version (both done by myself)
This was SVN commit r22794.
2019-08-27 23:31:10 +00:00
wackyserious a5679ddcd4 Texture Update: Seleucid Pikeman and Cataphract
Thread:
https://wildfiregames.com/forum/index.php?/topic/26907-task-compounded-linothorax-unit-texture/&tab=comments#comment-383735

General Discussion:
https://wildfiregames.com/forum/index.php?/topic/22184-task-greek-unit-texture-general-thread/page/9/#comments

Reviewed by: Lordgood, Alexandermb and wowgetoffyourcellphone
This was SVN commit r22793.
2019-08-27 21:21:07 +00:00
elexis be963ec9b7 Delete 27 invalid style settings and add LOGWARNING to inform future authors.
Unify the two IGUIObject::LoadStyle functions and remove CGUI argument
that is always identical to the member.

Differential Revision: https://code.wildfiregames.com/D2232
Tested on: gcc 9.1.0., clang 8.0.1, Jenkins

This was SVN commit r22792.
2019-08-27 16:03:24 +00:00
elexis 0a6b650189 Delete SGUIMessage GUIM_SETTINGS_UPDATED broadcasts redundant with the broadcast initiated from SetSetting from e21ebb37f5.
659a9ea57a introduced the call rightfully in ShowTooltip since
CTooltip::SetupText() depends on the just changed _mousepos setting.
But then 0382cdd9b1 moved that _mousepos SetSetting call, resulting in
the message becoming redundant; and it inserted the second redundant
message in HideTooltip.

These were the only redundant SGUIMessage HandleMessage calls.

This was SVN commit r22790.
2019-08-26 23:39:16 +00:00
elexis 92b6cdfeab Move static GUI<>::GetSetting operating on IGUIObject member to a IGUIObject member function, grouping it with SettingExists and AddSetting.
Differential Revision: https://code.wildfiregames.com/D2230
Tested on: gcc 9.1.0, Jenkins

This was SVN commit r22789.
2019-08-26 12:25:07 +00:00
wraitii 85d01b839c Fix attack/armor techs not applying after 16b452cf91, and fix auras/techs affecting capture rate.
Reported By: Nescio
Patch By: Freagarach
Differential Revision: https://code.wildfiregames.com/D2224
This was SVN commit r22786.
2019-08-25 18:03:32 +00:00
elexis 719f2d7967 Remove default CGame constructor values to make the code less error-prone, use CRenderer::IsInitialised() to test if the CGame should be rendered to remove indirection/proxies, making the code easier to read.
1c0536bf08 introduced a disableGraphics bool with a default value and
relied on the default being reasonable except for the few needed cases.
be93b31411 introduced the replayLog argument with a default value and
relied on the default being reasonable except for the few needed cases.
5747619c39 fixed a bug in that commit because the default value hadn't
actually been considered to be correct for all CGame constructor calls
and was wrong for two.

By requiring callers to specify the value, authors are forced to
establish thought which value is the correct one, as opposed to hoping
that a default value will be good by default.
As you can see in the diff, it also makes it easier to compare what
values changed if they are always defined in the caller.

Use CRenderer::IsInitialised() to determine if this is a non-visual
CGame,
for the purpose of removing less transparent proxy functions that are
unneeded as long as there are about 30 other calls testing for
CRenderer::IsInitialised() to determine if the Game should be rendered.

Supersedes:
* CGame constructor argument bool disableGraphics from 1c0536bf08.
* CGame::IsGraphicsDisabled() proxy from a533fff883 to the proxy from
1c0536bf08 and two local nonVisual = args.Has("autostart-nonvisual")
variables in GameSetup.cpp from a533fff883.

Call the Renderer destructor instead of calling delete on the
non-pointer (SAFE_DELETE would not be supported for instance).

Started as a preparation for D2197, but actually independent.

Differential Revision: https://code.wildfiregames.com/D2211
This was SVN commit r22785.
2019-08-25 11:02:55 +00:00
Gallaecio 336c423e8e standardized structure aura descriptions
Patch By: Nescio
Differential Revision: D1806
This was SVN commit r22784.
2019-08-25 09:20:43 +00:00
Gallaecio 27a190578f correct descriptions and tooltips of siege technologies
Patch By: Nescio
Differential Revision: D2186
This was SVN commit r22783.
2019-08-25 09:19:01 +00:00
Gallaecio 37a2149cb4 update fortress tooltips
Patch By: Nescio
Differential Revision: D2189
This was SVN commit r22782.
2019-08-25 09:17:58 +00:00
Gallaecio 0dbc66a391 update workshop tooltip
Patch By: Nescio
Differential Revision: D2190
This was SVN commit r22781.
2019-08-25 09:16:53 +00:00
Gallaecio 5f6e2c789c remove incorrect book numbers from Plutarch Moralia
Patch By: Nescio
Differential Revision: D2191
This was SVN commit r22780.
2019-08-25 09:15:23 +00:00
elexis 4919a6185e Remove unused GUIUtil functions, unused GUI includes and some tails in GUIUtil.
HasSetting from 3dfa23cd25 is actually redundant with
IGUIObject::SettingExists.
GetSettingPointer from 8f4f8e240f is superseded by GetSetting reference
following 3dfa23cd25 and 040624acff.
Deregister copying SetSetting variants for CStr and CStrW following copy
removal in 040624acff.
The default template <typename T=int> from c2a71e41bf can be removed
following FallBackSprite/FallBackColor removal in 9985fcf5bd and
RecurseObject unification in d4d5187c9d.
Delete all unused GUI includes, refs D1478.
Remove GUIUtil friend class following something.

Differential Revision: https://code.wildfiregames.com/D2225
Tested on: gcc 9.1.0, Jenkins

This was SVN commit r22779.
2019-08-25 08:57:36 +00:00
elexis b197df5ee6 Fix valgrind conditional jump depending on uninitialised value warning in CGUIManager::HandleEvent from 7c2e9027c2.
The warning seems to be a false positive and happens with clang but not
gcc.

Differential Revision: https://code.wildfiregames.com/D2223
Reviewed By: Vladislav
This was SVN commit r22777.
2019-08-24 22:25:26 +00:00
Alexandermb 9977ddaeff Replace samnite_swordsman.xml actor properly following 31c128b282
reported by: @Freagarach and @Nescio
This was SVN commit r22776.
2019-08-24 19:30:12 +00:00
Alexandermb 31c128b282 Carthaginian mercenaries duplication removal.
Remove duplicated actors from carthaginian civ folder due to redundance
of having twice the same infantry in two folders.

carthaginians/infantry_slinger_e.xml > iberians/infantry_slinger_e.xml

carthaginians/infantry_swordsman_e.xml > gauls/infantry_swordsman_e.xml

Also include a fix for an unsync frame of the idle_ready_shieldsmall.dae
animation.

This was SVN commit r22775.
2019-08-24 18:54:26 +00:00
Alexandermb 51f1436ee2 Add syntagma formation variant for every civ pikeman infantry.
Also add phalanx to hoplite cape.

This was SVN commit r22774.
2019-08-24 18:07:59 +00:00
elexis 55efe4a735 Fix L10n::FormatMillisecondsIntoDateString memory leak following c92e74138a, refs a74fcdcb35, #3350, #4418, #2938.
createDefault returns a new pointer to be deleted, getGMT returned a
pointer to an icu variable not to be deleted.

Differential Revision: https://code.wildfiregames.com/D2220
Reviewed By: Vladislav
This was SVN commit r22773.
2019-08-24 17:33:29 +00:00
wraitii 62dd922bc0 pthread -> std::thread (5/7) - Replace sdl semaphore with condition variable
This removes a dependency on the SDL_Thread header.

Differential Revision: https://code.wildfiregames.com/D1921
This was SVN commit r22772.
2019-08-24 11:26:58 +00:00
Gallaecio b429d0ce03 Quote all book names in quotes.txt
Differential Revision: D2178
This was SVN commit r22771.
2019-08-24 09:24:13 +00:00
wraitii 97ee3211d4 Common template name change: hellenic_royal_stoa → stoa
The old name was unnecessary long, but also potentially misleading:
stoas are Greek, but not necessary royal, and there are no other stoas
in game. Just “stoa” is clearer, more correct, and more consistent with
other `template_structure_*.xml` names.

Patch By: Nescio
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D2036
This was SVN commit r22770.
2019-08-24 09:00:46 +00:00
wraitii 9280b57e79 Make damage bonuses, attack preferred classes and garrisonHolder ejectable classes use MatchesClassList.
MatchesClassList supports additional functionalities (and, not and or).

Reviewed By: wraitii
Patch By: Freagarach
Differential Revision: https://code.wildfiregames.com/D2115
This was SVN commit r22769.
2019-08-24 08:52:15 +00:00
wraitii 47581ea900 Fix resourceGatherer value modifications following e16c4c4800
e16c4c4800 expects player-wide modifications to invalidate entity
caches.
However, this requires the entity to have an owner when calling
ApplyModifiers.

ResourceGatherer caches its gather rates at Init, when entities do now
yet have their correct owner, and thus this fails.
Since OnOwnershipChanged also caches gather rates however, this call is
redundant (and needlessly slow) so it can just be deleted.

Differential Revision: https://code.wildfiregames.com/D2217
This was SVN commit r22768.
2019-08-24 08:20:30 +00:00
wraitii e16c4c4800 Add a system component to handle stat modifiers, make technologies and auras use this common interface.
The ModifiersManager system component provides an interface to add and
remove modifiers, and get modified stats.
The goal is to merge all the different stat-modifying systems 0 A.D. has
implemented over the years.
This commit makes technologies and auras use ModifiersManager. Some
cheats and AI bonuses also have a similar stat-modifying effect that
have not yet been updated.

Further, this system component makes it possible for e.g. triggers to
easily add modifiers, enabling the writing of Castle Blood Automatic,
RPG or Tower Defense maps without the need for mods or hacks.

The 'Modifier' name was preferred over 'Modification' as it is shorter
and more readable, along with the logic that 'modifiers' store
'modifications' and this stores modifiers. Renaming of other functions
and classes has been left for future work for now.

Internally, this uses a JS data structure. If performance issues arise
with it in the future, this data structure or the whole component could
be moved to C++.
The performance has been tested to be about as fast as the current
implementations (and specifically much faster for global auras with no
icons). Testing showed that sending value modification messages was by
far the slowest part.

Comments by: leper, Stan, elexis
Differential Revision: https://code.wildfiregames.com/D274
This was SVN commit r22767.
2019-08-24 07:37:07 +00:00
elexis 040624acff Replace copy-assigning GUI<T>::GetSetting from c2a71e41bf with the reference returning GetSetting from 3dfa23cd25.
Avoids one or two dozen unoptimizable string copies and two CPos copies,
mostly in SetupText.

The reference return allows to mark values as const where the previous
one prevented that.
This also reveals unused variables where the previous code hid them.

Thus use unused variable "buffer_zone" in the otherwise unused (since
b1422137e5, refs 0f807c643a) CCheckBox::SetupText() from b5f6d19332 and
use the unused variable "scrollbar" in CInput GUIM_MOUSE_PRESS_LEFT from
4113aa0a36.

Refs unintentionally copied DrawCall cache due to GetSetting copying in
c19f3608a5, fixed in 8f4f8e240f.

Differential Revision: https://code.wildfiregames.com/D2215
This was SVN commit r22765.
2019-08-23 14:43:10 +00:00
elexis 4d77bd6542 Fix unused glooxwrapper variable following 61261d14fc, refs #2305, #5294, #5550.
The class didn't leak the m_Wrapped gloox Jingle for this program since
it's not set to owned, and it's not set to owned because gloox deletes
it.
It would have leaked if some other app would have used glooxwrapper with
owned = true, if gloox has a situation for that.

Differential Revision: https://code.wildfiregames.com/D2090
This was SVN commit r22764.
2019-08-23 12:04:20 +00:00
elexis e02afa279c Remove hardcoded C++ fallback font from 70d84beab2 and according TODO from 924b0bf1b4 that was fixed in 6af0d7cfd3 by having the default style specify the default font.
Use references instead of copies for obtaining the font in SetupText().

Differential Revision: https://code.wildfiregames.com/D2214
This was SVN commit r22761.
2019-08-23 03:28:04 +00:00
Alexandermb fcd15d0ad5 Update elephantry_r of the following factions:
carthaginians/elephantry_c_r.xml
ptolemies/elephantry_c_r.xml

Also add new variants for the ptolemaic cavalry.

ptolemies/cavalry_spearman_e_r.xml
ptolemies/hero_cavalry_swordsman_ptolemy_IV_r.xml

This was SVN commit r22760.
2019-08-23 03:07:22 +00:00
Alexandermb 1f6b4702ee Fix the warning of fishermans unrecognized skeleton.
Thread:
https://wildfiregames.com/forum/index.php?/topic/26866-could-not-load-animation/&tab=comments#comment-383334

The issue was a variant "base" file using two of the old armature death
animations.

Also clean the repository from having the old actors with the old meshes
in the meshes/structural folder.

Issue reported by @gameboy

This was SVN commit r22759.
2019-08-23 02:50:55 +00:00
elexis 8609041ddf Fix missing actual boolean check in the commit removing the odd way to check for a boolean in 77b81d8761.
Reported By: Vladislav
Reviewed By: Vladislav
This was SVN commit r22758.
2019-08-23 00:42:00 +00:00
elexis f4990cf967 Mark some GUI functions as const, including the boolean ones from d4d5187c9d.
Rename MouseOver to IsMouseOver.

Reported By: Vladislav
This was SVN commit r22757.
2019-08-22 23:51:10 +00:00
elexis 0e26503cc6 Introduce IGUIObject::PlaySound to unify 19 copies of the UI sound play following 9565c60a14, refs #948.
Stops copying the CStrW each time a sound is played by using the
reference GetSetting variant.

Differential Revision: https://code.wildfiregames.com/D2209
This was SVN commit r22756.
2019-08-22 22:34:12 +00:00
vladislavbelov 659bf68cc7 Cleanup Camera and CGameView, removes a not needed method and refactors classes.
Commented By: Stan
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D2195
This was SVN commit r22755.
2019-08-22 20:49:58 +00:00
wraitii 16b452cf91 Generalise Attack effects. All attacks, including death damage and splash, can deal any number of attack effects (damaging, capture, giving status effects.)
This moves most of what was in the Damage system component to a helper,
and renames that component DelayedDamage.
It also introduces a new global script with all possible attack effects.

Comments Taken From: Freagarach, Stan, bb

Differential Revision: https://code.wildfiregames.com/D2092
This was SVN commit r22754.
2019-08-22 18:00:33 +00:00
wraitii cc1ea7cca0 Make Promotion.js use the common Transform helper, add resource gatherer and promotion to said helper.
Fixes #4334

Differential Revision: https://code.wildfiregames.com/D2026
This was SVN commit r22753.
2019-08-22 17:25:44 +00:00
Alexandermb 1d1471aba9 Replace the horse rein with a less basic version
This was SVN commit r22752.
2019-08-22 15:11:07 +00:00
Alexandermb 7efaf75d94 Adjust some helmets following the latest changes on human bodie armature.
(Also remove two files exported from blender by mistake)

This was SVN commit r22751.
2019-08-22 15:06:31 +00:00
Alexandermb e0eb712eb5 Adjust archers right hand position and rotation according to the discussion in the thread.
Thread:
https://wildfiregames.com/forum/index.php?/topic/26012-task-animations-re-export-and-unit-meshes-fix/page/12/&tab=comments#comment-383214

This was SVN commit r22750.
2019-08-22 15:04:49 +00:00
Alexandermb 5bfd0a97eb Update outdated icons and last updated cavalry icons to use the new horse assets
Also separate Gauls from Britons

This was SVN commit r22748.
2019-08-21 18:03:28 +00:00
Alexandermb e513c94366 Fix seleucid hero horse antiochus_the_great from using "objectcolor" material instead of basic_trans_parallax_spec
This was SVN commit r22747.
2019-08-21 17:57:52 +00:00