Commit Graph

35 Commits

Author SHA1 Message Date
ea72437739 Move GenericName, History and Icon from the civ-JSON to cmpIdentity.
Since the players/civs already have cmpIdentity, use it.
This forces civs to have corresponding XML in the `special/players/`
folder.

Also moves the files from `special/player/` to `special/players/`
consistent with other folders. And moves the generic `player.xml` one
level up.

Differential revision: https://code.wildfiregames.com/D4473
Help and comments by: @Stan, @wraitii
This was SVN commit r26298.
2022-02-05 06:24:45 +00:00
fcc6bbe797 Fix d73a3f59ad - wstring_view on a temporary & wrong utf16->8 conversion.
Two issues:
- The wstring_view was created on a temporary string - the data got
overwritten sometimes.
- there was some weird UTF16->UTF8 conversion going on.


Reported by: langbart
Differential Revision: https://code.wildfiregames.com/D3828
This was SVN commit r25226.
2021-04-09 18:08:37 +00:00
d73a3f59ad Allow arbitrary compositions in TemplateLoader template names.
- Allows compositing any two templates in TemplateLoader, and not just
filters: 'A|B|C' is now valid for any template A, B and C.
- Allows parents to be composited paths 'A|B|C'. In such a schema, if A
or B themselves specify a parent, the actual composition becomes
A|pA|B|pB|C and so on.

This allows, by leveraging the common schema of our entities, to reduce
duplication.

For convenience, templates in "special/filters/" and "mixins/" can be
included by their direct name. Others have to be completely specified.

See the two provided cases for examples:
- 'hoplite' becomes a mixin that can be used to apply the Phalanx
formation
- 'builder' becomes a mixin that can be give a template the ability to
build the standard structures, and gives the 'Builder' identity class.
This also allows deduplicating that list of tokens.

Update checkrefs & swap std::map for std::unordered_map in
TemplateLoader.

Differential Revision: https://code.wildfiregames.com/D3801
This was SVN commit r25223.
2021-04-09 15:43:50 +00:00
ebd9786268 Add missing cpp files in last commit refs D2503
This was SVN commit r23704.
2020-05-28 18:18:00 +00:00
8629b83ed9 Remove unneeded include.
That was a leftover from a previous iteration of the code.

This was SVN commit r20247.
2017-09-30 15:29:13 +00:00
84674911cc Switch back to an unplaceable filter for templates.
This removes FindAllPlaceableTemplates, replaces the few uses of it by
FindAllTemplates,
and makes that ignore all templates starting with special/ in addition
to those starting
with template_.

Now modders can use entirely different template organization schemes
(more folders, different
folders, etc) without having to edit a file that was never well
documented.

In conjunction with a few of the template moving patches preceding this
rubble/ and other/catafalque
are now placeable. The former now does not decay anymore and users that
want that should use the
decay| filter, the latter will be taken care of in #4762.

Return to making FindAllTemplates return all placeable templates again
(switch to unplaceable filter).

To reiterate the main point: Only templates starting with special/ or
template_ will not show up as
placeable in Atlas (or show up to code querying for all (placeable)
templates. If you want to add more
of those use one of these naming schemes (and possibly subfolders in
special/).

Reviewed By: fatherbushido
Differential Revision: https://code.wildfiregames.com/D935
This was SVN commit r20246.
2017-09-30 15:22:51 +00:00
ff7511d9fc Move special_filter/ templates to special/filter/.
This should help with simplifying the (un)placeable filtering again.

Reviewed By: fatherbushido
Differential Revision: https://code.wildfiregames.com/D934
This was SVN commit r20242.
2017-09-30 07:14:35 +00:00
d093f714d7 Use XML files instead of hardcoded C++ code in the template manager to universally change template properties at load time.
Patch By: leper
Differential Revision: https://code.wildfiregames.com/D215
Fixes #2951

This was SVN commit r19302.
2017-03-16 19:56:12 +00:00
be1a205f91 Add support for const methods in components and make those that can be const const.
Reviewed By: Itms
Differential Revision: https://code.wildfiregames.com/D75
This was SVN commit r19156.
2017-01-20 02:25:19 +00:00
b5991e188b TemplateLoader cleanup.
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D26
This was SVN commit r19119.
2017-01-07 17:52:32 +00:00
417c84870c Actually remove trailing tabs from source/.
This was SVN commit r18991.
2016-11-23 14:09:58 +00:00
e0c30745f9 Template manager cleanup. Patch by leper, refs #2951.
Move an early return to the top of the function.
Add an early return in case an error was determined.
Remove unneeded variables ok and templatePath.
Replace includeSubdirectories boolean with a flags int to merge
duplicate vfs::ForEachFile calls.

This was SVN commit r18696.
2016-09-04 15:28:36 +00:00
b45e3e46f7 add non-blocking obstruction to mirages, fixes #3957, refs #2951
This was SVN commit r18145.
2016-05-08 17:26:43 +00:00
ba56678bb3 Add market component to foundations. This is needed since 8f4dffe3f0 to be able to set
a market rallyPoint on a market foundation. refs #2951"

This was SVN commit r18042.
2016-04-17 16:14:19 +00:00
780a1de136 Don't comment out code. Refs #3486.
This was SVN commit r17400.
2015-12-07 12:27:52 +00:00
8af675e207 Don't emit sounds when selecting dead animals. Patch by Stan. Fixes #3486.
This was SVN commit r17399.
2015-12-07 00:21:24 +00:00
a3f467ae4e Make resources have a static, passable obstruction. Ought to be a temporary fix. Fixes #3530
See #3530#comment:9 for a proper fix to this issue.

This was SVN commit r17156.
2015-10-31 15:28:42 +00:00
bd8f9b7824 Fix enemy corpses visible in the fog of war. Fixes #3179.
This was SVN commit r16919.
2015-08-16 09:29:34 +00:00
c5eb9b7bb7 Range-based for for VfsPath loops.
This was SVN commit r16893.
2015-07-29 23:44:12 +00:00
da48c8c26f Some const refs and one const function.
This was SVN commit r16882.
2015-07-27 01:08:25 +00:00
642500b49e Make the Ptolemaic lighthouse reveal the shore on the entire map.
Fixes #3174

This was SVN commit r16628.
2015-05-06 18:47:02 +00:00
da0f33f137 Reduce drastically the number of mirages by making fogging conditional: entities will be miraged only if their health/resource amount is modified, or if they have a non-gaia owner.
Fixes the animals hidden in the FoW, and adds the missing status bars
for mirages.

Also small cleanup of the code.

Refs #2913

This was SVN commit r16281.
2015-02-07 15:48:32 +00:00
1564a10120 Move back the computation of most of the visibilities from JS to engine, to improve performance.
Also fix the remaining TODO left by #958, as a use case of the scripted
Visibility component.

Refs #2913, #958.

This was SVN commit r16248.
2015-01-30 15:28:06 +00:00
c02a7e1a7b SpiderMonkey 31 upgrade
This upgrade also introduces exact stack rooting (see to the wiki:
JSRootingGuide) and fixes problems with moving GC. This allows us to
enable generational garbage collection (GGC).
Measurements a few months ago have shown a performance improvement of a
non-visual replay of around 13.5%. This probably varies quite a bit, but
it should be somewhere between 5-20%. Memory usage has also been
improved. Check the forum thread for details.

Thanks to everyone from the team who helped with this directly or
indirectly (review, finding and fixing issues, the required C++11
upgrade, the new autobuilder etc.)! Also thanks to the SpiderMonkey
developers who helped on the #jsapi channel or elsewhere!

Fixes #2462, #2415, #2428, #2684, #1374
Refs #2973, #2669

This was SVN commit r16214.
2015-01-24 14:46:52 +00:00
e02d7ad949 Automatically replace %hs/%ls with %s in CLogger format strings.
Everything is char* now, so we don't need to mess around with different
string types.

Done with:

  ag -ls 'LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR)' source | xargs perl
-pi -e'1 while
s/(LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR).*)%[hl]s/$1%s/g'

This was SVN commit r16187.
2015-01-22 20:36:24 +00:00
49e2ecea63 Automatically convert all CLogger format strings from wchar_t* to char*.
Done with:

  ag -ls 'LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR)' source | xargs sed
-i 's/LOG\(MESSAGE\|MESSAGERENDER\|WARNING\|ERROR\)(L/LOG\1(/g'

This was SVN commit r16183.
2015-01-22 20:31:30 +00:00
b5b9c0f2ae Improve template code style for the Decay component.
This was SVN commit r16171.
2015-01-21 21:45:05 +00:00
a472944689 Clean up LoadPlayerSettings.
Include gaia to make iteration easier.
Add TemplateExists() to the TemplateLoader. Refs #2877.

This was SVN commit r16099.
2015-01-01 23:10:24 +00:00
b05879e151 Move template items GetRetainInFog and AlwaysVisible from Vision to Visibility.
Refs #2913

This was SVN commit r16022.
2014-12-05 18:33:59 +00:00
d07d1a17f3 Add a new Visibility component that will eventually allow scripted components and mods to influence an entity's visibility.
This first commit only refactors code and does not add any new feature.

Refs #2913 (see this ticket for more information about the change)

This was SVN commit r15925.
2014-11-04 20:53:25 +00:00
f7e591c9f2 Hide changes to buildings in the fog-of-war.
To achieve this, mirage entities are created per player, to replace the
real entities when these ones fall into the fog-of-war. These mirage
entities are created on-the-fly, and destroyed when they get back in
sight.
This depends heavily on the VisibilityChanged message added in
2174eaaeee.

As a temporary adjustment, territories do not explore the map anymore
when their borders change. See #2709.

Fixes #599

This was SVN commit r15612.
2014-08-04 22:49:19 +00:00
a2bd44b23a Exact stack rooting for JSON related ScriptInterface functions.
Refs #2415
Refs #2462

This was SVN commit r15603.
2014-08-02 22:21:50 +00:00
28bdd8540f Quite a lot of stack rooting related changes.
Changes GetProperty, SetProperty and HasProperty and a few other
functions to take handles. The conversions to CScriptVal or
CScriptValRooted at some places should be removed in the future. I've
done that to avoid an even larger patch.

Refs #2415
Refs #2462

This was SVN commit r15568.
2014-07-26 22:33:16 +00:00
c339928c6f Disallow placing some special entities in Atlas. Fixes #1696. Patch by trompetin17
This was SVN commit r15467.
2014-06-30 10:20:20 +00:00
567917bf41 Give RMS access to the simulation templates. Fixes #1589. Patch by Itms.
This was SVN commit r15306.
2014-06-07 12:12:53 +00:00