* Replaced all occurrences of deprecated NinePatch
function calls
This makes a lot of UI elements already moddable but documentation is still missing
* Added "How to create a UI skin for Unciv" to wiki
* Added image
* Fixed two typos and updated directory image
Old image was missing a folder
* Removes the option for disabling religion
* Deprecated religionEnabled variable, set default to `true` and removed in cases where it shouldn't have effect
* Save all tile terrains and terrain uniques in transients, for better performance
Also minor changes in other places for performance reasons
* CR changes + test fix
* Add serialization version to GameInfo
* Add handling of incompatible saves due to a dfiferent save version
* Fix compilation?
* Fix ios compilation
* Refactor: Make it clearer that GameInfo serialization version is only supposed to be incremented when it's guaranteed to cause issues & rename to compatibility version
* Update initial version
* Update initial version
* Fix merge mistake
* Fix OutOfMemory error when loading game state after already having a game loaded
* Fix screen resize not being handled correctly
* Add withContext shortcut functions
* Add more logging
* Fix multiplayer games sometimes being loaded twice
* Make the loading screen nicer
* Make the loading screen hide previous popups for making the screenshot
* Don't do custom rendering & dispose the texture
Sometimes it makes sense to understand the library you're using...
* Fix missing GL context
* Refactor: increase readability of loadGame function
* Fix carrier teleporting without moving airplanes
* Unit test to ensure aircraft and carriers are teleported togother
* Fix other cases where teleportation may occur
* Simplify unit test condition
* Update linting and move return condition
* Allow override for teleporting transported units
* Make sure test catches if transported units get deleted
* Reviews
* Pillaging loots gold on certain improvements
* Add warning if improvement pillageGold > 0 and has UniqueType.Unpillagable
* Pillage yields as a UniqueType
* Forgot to undo demonstration
* Remove unused line
* Eliminate some redundancy
* Reword unique text
* Slight cleanup and add notification for pillage victim
* Reviews
* Made pillaging notifications more consistent with other hostile action notifications
* Missed a line
* Handle subclassing of Events properly
Previously, you could only listen to the exact class
* Add relevant parent classes for the multiplayer events
* Refactor: use the old name as the main name in MultiplayerGameNameChanged event
* Add being able to stop listening to events in the EventBus
* Add tests for EventBus
* Refactor: Extract GameList into standalone file
* Refactor: safeUpdateIf to more generic throttle function
* Refactor: Extract multiplayer UI helper functions into separate file
* Refactor: Extract load/download multiplayer game into logic class from UI
* Make loading a multiplayer game automatically update the in-memory game in OnlineMultiplayer
* Refactor: Extract multiplayer settings into separate object
* Add multiplayer status display
* Fix error with multiplayer games not correctly being cleaned up after successful update
* Prevent loadLatestMultiplayerState() while next turn update is running
* Show "Working..." while waiting for next turn calculations instead of "Waiting for [civ]..."
* Fix race condition while updating online game state
* Refactor: change GameSaver from singleton to single instance pattern & move autosave logic info GameSaver
Singleton just doesn't make sense anymore when we have to `init(..)` with different arguments, then we should just make a normal class out of it
* Fix not correctly checking for missing external files dir
* Refactor: use more appropriate library method
* Add logging for external files dir
* Added more unit tests for uniques; added missing implementations
* This of course shouldn't go here as there is another function for it
* Stylistic changes
* This generates better unique examples
* Reviews
* Reordered for efficiency
* Reverted improvement percentage bonuses applying to tiles
* Replacements for existing UniqueTypes
* More typed uniques are added
* Migration to the typed uniques
* Minor optimization
* More general approach on UniqueType usage
* Better wording for the UniqueType
* Renamed tile.hasUnique, deprecated `Indestructable`, unique for citadels
Also refactored the consumption of (great) people out of UnitActions.
* Reworked when improvements can be build somewhere for more clarity
* Made resources improvable by multiple improvements; Offshore Platform
* Fix compatability
* WIP
* Fixed the tests, but better
* I suppose I might as well update this now that we're a version later
* Fix Barbarian Camp Spawned notification not revealing the camp on the map in multiplayer
* Fix lastSeenImprovement not being cloned
* Use HashMapVector2 in BarbarianManager
* Fix value not having its class written out for proper deserializing
* Refactor: various code improvements
* Simplified tileFilter predicate
* Use only own harbors
* Allow city connections via open borders only
* Basic unit tests
* Advanced unit tests
* The maps and the legend for the tests
* CR changes: barbarians will not let the trades happen
* CR changes: get rid of question signs, "let" "Elvis" pass away
* Correct logic for blocking Naval Melee from capturing Civilians on Land
* Even better solution now that we can move on to unguarded Civilian tiles. But still won't let us capture Civilians if we can't get there
* Make Embarked unable to capture Civilians
* Embarked can't capture Water Civilians
* Fix Gradle Test
* Better unit test without making variable not internal
* attempt not working
* Just make currentTile not internal
* remove debug
* erronious import
Co-authored-by: itanasi <spellman23@gmail.com>
* Autoupdates to uniques will multiple solutions now replace to the correct one
Problem - some deprecated uniques can lead to multiple possibilities of replacements, depending on the parameter type
This lead to replacements in the jsons that were either unparseable entirely or were causing errors, both of which needed to be corrected by hand
We now separate such deprecations into their constituent potential replacement uniques, and try and take only the unique that doesn't cause any errors
Works like a charmander :)
* Conditional name change
* Resolved#6179 - when changing units production due to deprecation, notification no longer counts the same city multiple times if it appears multiple times in its queue
* terrainFeatures is only set through the setTerrainFeatures function
* Use cached terrainFeatures for performance
* Fixed map editor error due to not setting tileinfo ruleset
Added private set to terrainfeatureobjects
* Triggered uniques currently come from researching techs, adopting policies, and building buildings.
This adds a third way of triggering uniques, by attaching them to units with a "by consuming this unit" conditional, which will be added as a possible unit action.
So for example, "[amount] Free Technologies <by consuming this unit>", "Reveals the entire map <by consuming this unit>" etc.
* Added a new uniquetype for triggerable uniques, to make them separate from regular global uniques, so that triggerable uniques can become unit uniques when necessary
* And added translations so the tests will pass
* Step 1 of saving terrain features as a transient - move all terrainFeature changes to new 'addTerrainFeature' and 'removeTerrainFeature' functions
This also included slight rewriting of functions for clarity, but NO functional changes.
Even though there's some logic that I would definitely change, this PR isn't the place for that.
* Fixed tests
This is guaranteed to not cycle endlessly thanks to the added test
Checked by having 2 uniques' deprecation text reference each other and it failed as expected
* Unified "X is only available under Y conditions" into a single unique
There were a few problems with existing uniques - they weren't really composable, the offered things they didn't keep, etc
For example, "Incompatible with [policy/tech/promotion]", UniqueTarget.Policy, UniqueTarget.Tech, UniqueTarget.Promotion. In fact, promotions only checked promotion incompatibility, promotions - promotion incompat, etc
Additionally, with a few more changes, this could cover several other uniques - "Hidden until [amount] social policy branches have been completed", "Requires at least [amount] population", perhaps others
I have to say I think conditionals are the best thing ever and they make amazing composability possible :)
* Autoupdate correctly recognizes parameters
Updated ruleset jsons
* Deprecation texts should be allowed to forward to other deprecated uniques so we only need to change the leaves when introducing new uniques, not go through the whole tree
* Added a json file for unhappiness effects
* Change existing code to handle these effects
* Made a weird and unexpendable way to add unhappiness effects to the civilopedia
* Add the default unhappinesseffects to mods without the json
* Added revolts when at very low happiness
* Renamed a few often-used functions
* Added a file for uniques that are always active
* Fixed tests
* Nullifies [Food] -> Nullifies Growth
* Initial attempt
* Allow Ranged to move into unguarded Civilian Unit
* Comment for clarity
* Fix unit test so that it doesn't segfault and checks you can't move into military units
* Unify that all units can move on to (and through) unguarded civilians that you are at war with
Add TileInfo.getUnguardedCivilian() to quickly respond if there is an unguarded Civilian on the tile
Something is bugged in movement code
* Fix MapUnit.moveThroughTile() so that it doesn't segfault by fixing getUnguardedCivilian()
* captureCivilianUnit() call is now redundant in postBattleMoveToAttackedTile() since canMoveTo() will now return true and capture will happen during the moveToTile() call
Co-authored-by: temurakami <spellman23@gmail.com>
* Print stacktraces in more cases when crashing, useful for debugging
* Conditionalized no oceans before astronomy unique
* Cannot be built on tile before tech conditionalized
* Added "Cannot build unitFilter units" unique
* Fixed tests failing
* Merge branch master into some-uniques
* Fixed typo
* Apparently I made the same mistake twice
* Globalized unique
* Fixed tests checking for mod correctness
* Update G&K jsons to current vanilla versions
* First pass over buildings & beliefs
* First pass over nations
* First pass over eras.json
* Fully updated tech tree
* First pass over units
* Second pass over buildings -- fixed techs
* Fixed last prerequisites and row numbers of tech
* Went through the entire tech tree and moved things to their correct spot
* Fixed tests