Commit Graph

3357 Commits

Author SHA1 Message Date
8a024bf9fe Popups get the ability to scroll only the content without the buttons (#9513)
* Popups get the ability to scroll only the content without the buttons

* Centralize LoadingPopup

* Split non-WorldScreenMenuPopup classes off from that file

* Linting
2023-06-04 08:41:58 +03:00
dc707382f3 More reapply CityFocus on yield changes (#9459) 2023-06-03 22:44:51 +03:00
b3e2faed71 Remove "does not support server feature set" error for uncivserver.xyz 2023-06-03 22:29:23 +03:00
00712e49a8 Small File Chooser and Separator fixes (#9496)
* Fix FileChooser click-behind

* Fix separators not allowing a Table to shrink back when other cells change width
2023-06-01 22:53:20 +03:00
a7107fa04d Trigger resource recalculation upon gaining a unit that requires resources 2023-06-01 11:43:55 +03:00
ce6d3394bc Added checksum to be added to uploaded multiplayer games (#9483)
* Added checksum to be added to uploaded multiplayer games

* Policy adoption triggers resource recalculation
2023-05-31 14:58:00 +03:00
de09eda043 Politics overview no longer discloses random number of players (#9466)
* Linting

* Hide player count in politics overview diagram legend if randomized

* Comment on getKnownCivs
2023-05-31 14:52:05 +03:00
9302036311 Replacement PlatformSaverLoader for Linux X11 systems (#9490) 2023-05-31 14:43:31 +03:00
ff9d5ff9c1 Fix bug worker will not replace improvement to enable strategy resour… (#9449)
* Fix bug worker will not replace improvement to enable strategy resources #9328

* Make test logic more clear and add some comments
2023-05-28 17:52:37 +03:00
73aeabec2c All notifications from Overview are now temporary (#9455)
* Refactor notification history re-show functionality

* Refactor explored resources notification generator

* Refactor "Unimproved" to use existing providesResource

* Make overview resource "links" into temporary notifications

* Added link to overview resource "Unimproved" column

* Minor linting
2023-05-28 17:51:33 +03:00
d7b6fea2d4 Spectators do not get natural wonder discovery notifications 2023-05-28 09:24:33 +03:00
9739374e17 Update civ resources when a researched tech reveals a resource (#9467) 2023-05-28 08:39:36 +03:00
ef193babee Map editor update - concurrency, resource amounts, file double-click (#9461) 2023-05-27 21:44:23 +03:00
1c124c9ddf Fix UniqueType.RoadMaintenance being ignored (#9456) 2023-05-27 21:44:03 +03:00
4ef33b84e5 4.6.14-patch1
Fix AI automation preventing settlers from moving
2023-05-24 11:42:42 +03:00
b94321f535 4.6.14 2023-05-23 20:37:51 +03:00
7aea703fcc Resolve #9432 - city-state-owned great merchants can no longer 'conduct trade mission' on their own tiles 2023-05-23 19:41:41 +03:00
b3166c4922 Fix ConcurrentModificationException when puppeting a city (#9430) 2023-05-22 20:12:31 +03:00
5f60c887f7 Next-Turn Progressbar (#9409)
* Next-Turn Progressbar

* Next-Turn Progressbar - doc

* NextTurnProgress: Rethink max on first turn
2023-05-22 17:59:28 +03:00
edd09910a1 AI civilian improvement: Don't freeze when enemy is near, keep working in tiles where he can't reach 2023-05-22 14:31:49 +03:00
fc81d7dda3 Units that can enter foreign lands without open borders are not expelled on open borders end 2023-05-22 14:31:43 +03:00
ae8d69b5b3 Resolve To-do in Unit upgrade resource requirements (#9420)
* Update Counter get() nullability

* Counter upgrade

* Use Counter for unit resource requirements

* Linting
2023-05-22 14:28:36 +03:00
95ffbd6a6e 4.6.13 2023-05-21 14:16:50 +03:00
a91dca0930 Fix off-by-one error in autoAssignPopulation (#9411)
* Fix off-by-one error in autoAssignPopulation

* Fix more off-by-one errors from for-repeat conversions

* Linting: Use Actions.forever shortcut where appropriate
2023-05-21 12:08:03 +03:00
ec4586af6c Fix Ensure Minimum Stats (#9408) 2023-05-21 00:13:50 +03:00
728afab1db Modding: Added 'upon adopting [belief]' trigger, allowed belief adoption to trigger uniques 2023-05-19 00:22:34 +03:00
6603c6cfd0 refactor: break large functions into smaller ones (#9406) 2023-05-18 22:02:26 +03:00
91116f8df3 Fixed more warnings (#9401)
* fix: fix FunctionParameterNaming warnings

* fix: fix InvalidPackageDeclaration warnings

* fix: fix MatchingDeclarationName warnings

* fix: fix WrongEqualsTypeParameter warnings

* fix: fix UnusedPrivateProperty warnings

* fix: fix UseCheckOrError warningsU

* fix: fix UseRequire warningsU

* detekt: disabled SpreadOperator rule

* fix: resolve MemberNameEqualsClassName rule

* detekt: disabled ForbiddenComment rule

* fix: resolved SwallowedException warning

* fix: resolved ThrowingExceptionsWithoutMessageOrCause warning

* fix: resolved EmptyFunctionBlock warning

* fix: resolved EmptyFunctionBlock warning

* fix: resolved InstanceOfCheckForError warning

* detekt: disable TooGenericExceptionCaught warning

* detekt: disable TooGenericExceptionThrown warning

* fix: resolve part of NestedBlockDepth warnings
2023-05-18 10:12:33 +03:00
d31a2d83ba Happiness change from bought buildings can reapply citizen focus (#9395)
* Happiness change from bought buildings can reapply citizen focus

* Fix compilation error
2023-05-18 00:37:38 +03:00
841a1aa564 ci: improved detekt configuration and ci (#9380)
* ci: improved detekt configuration

it still needs some work but it's getting there

* detekt: separated errors from warnings

Detekt doesn't currently have a mechanism for failing only on specific issues

workaround suggested by the maintainer of Detekt

* rebased on master

* fix: resolve ExplicitItLambdaParameter

* fix: fix last star import
2023-05-14 21:55:36 +03:00
ae13f32f72 Animate battle damage numbers (#9387)
* Animated battle damage numbers 001

* Animated battle damage numbers 002

* Animated battle damage numbers 003

* Animated battle damage numbers 004
2023-05-14 21:52:15 +03:00
5bbd8bce53 Allow mods to contain a "preview.png" file for visual indication 2023-05-14 14:36:46 +03:00
48bd416347 Multi-server preparations: Save server info in game, save server functionality in specific class (#9379)
* Save server info in game

* Moved server functionality into server class

* Fix Android multiplayer update
2023-05-13 21:51:44 +03:00
97769b89b6 Combat java.util.star-import (#9382) 2023-05-13 21:50:55 +03:00
dde3732383 Convert 'camps' vectorhashmap to 'encampments' arraylist (#9374) 2023-05-11 16:51:29 +03:00
2ef5ed14e1 Fix 4.6.10 no longer loading older games (#9370)
* Fix 4.6.10 no longer loading older games

* Save games with correct current version info
2023-05-11 13:01:00 +03:00
f3e80a4021 Fixed a couple warnings reported by code analysis (#9364)
* fix: resolve EmptyCatchBlock warnings

* fix: resolve PrintStackTrace warnings

* fix: resolve SwallowedException warnings

* fix: resolve ThrowingExceptionsWithoutMessageOrCause warnings

* fix: resolve ConstructorParameterNaming warnings

* fix: resolve FunctionParameterNaming warnings

* fix: resolve InvalidPackageDeclaration warnings

* fix: resolve ForEachOnRange warnings

* fix: resolve ImplicitDefaultLocale warnings

* fix: resolve MayBeConst warnings

* fix: resolve NewLineAtEndOfFile warnings

* fix: resolve UnusedParameter warnings

* fix: resolve UtilityClassWithPublicConstructor warnings

* fix: resolve WildcardImport warnings
2023-05-10 11:43:53 +03:00
a3ef6fa314 Add May not annex cities unique (#9314)
* Add `May not annex cities` unique, following same behaviour as Civ5 Venice. Hopefully this time I won't need to re-install windows.

* Add `May not annex cities` unique, following same behaviour as Civ5 Venice. Hopefully this time I won't need to re-install windows.

* Fix raze button being unavailable in city screen

* Fixed raze button being available in city screen, as per civ5

* Corrected indentation

* mayAnnex instead of canAnnex, hasUnique rather than getMatchingUniques

* AI will follow rules

* Replaced getMatchingUniques with hasUnique, for real this time
2023-05-09 23:02:19 +03:00
203477eca1 4.6.10-patch1 2023-05-08 21:01:23 +03:00
02e6785969 Resolved #9332 - Solved rare concurrency bug for explored tiles 2023-05-08 18:37:44 +03:00
f8b4b202e7 Automated workers no longer stay on unimprovable tile if another tile is improvable 2023-05-08 18:29:34 +03:00
817764ec38 Probably resolved #9320 - AI 'found religion' crash 2023-05-04 09:20:00 +03:00
159ae86960 Reduce a few memory allocations (#9312) 2023-05-02 23:26:39 +03:00
fadeaafc75 Various performance improvements (#9296)
* Move caches for passThrough and movementCost into the parent method.

* Reuse path calculated for reaching enemy city if still far away instead of recalculating it for the "landing tile".

* Cache getDistanceToTilesWithinTurn by removing tilesToIgnore from the call and doing that filtering later. Also simplify caller side with some transformations around differences for the first iteration and subsequent iterations.

* Check whether a player is spectator by comparing their civName directly with the Constant rather than going through the lazily initialized property of the nation. This is significantly faster (10x ?) and we're calling this method a lot (tens of millions of times).

Also check whether a tile is explored directly on the tile, not the other way round.

* Revert "Cache getDistanceToTilesWithinTurn by removing tilesToIgnore from the call and doing that filtering later. Also simplify caller side with some transformations around differences for the first iteration and subsequent iterations."

This reverts commit f75ce00d83.

* Simplify UnitMovement.getShortestPath
2023-05-01 07:35:41 +03:00
b8bd1fc2c2 Performance improvements (#9271)
* Speed up WorkerAutomation.findTileToWork - apparently tileCanBeImproved is quite expensive

* Add cache for rankTileForCityWork in CityPopulationManager.autoAssignPopulation

* Optimize NextTurnAutomation.declareWar by moving expensive BFSs to the end and potentially short-circuiting evaluation if result won't be promising anyways.

* No need to throw if atLeast is negative.

* Revert changes to CityPopulationManager.kt

* Revert changes to CityPopulationManager.kt

* Speed up WorkerAutomation.findTileToWork - apparently tileCanBeImproved is quite expensive

* Add cache for rankTileForCityWork in CityPopulationManager.autoAssignPopulation

* Optimize NextTurnAutomation.declareWar by moving expensive BFSs to the end and potentially short-circuiting evaluation if result won't be promising anyways.

* No need to throw if atLeast is negative.

* Revert changes to CityPopulationManager.kt

* Revert changes to CityPopulationManager.kt
2023-04-26 18:47:07 +03:00
cccaa88456 Cache civ uniques while refreshing world map tiles. (#9284)
* Cache civ uniques while refreshing world map tiles.

This should have a pretty significant performance improvement of about 10% next rount time.

* Forgot to add stateForConditionals to cache key.

* Make cache keys depend on function

* Restrict LocalUniqueCache API to avoid using it the wrong way.

* Use default values instead of two methods
2023-04-26 10:17:58 +03:00
079c237547 terrainFilter now accommodates nationFilter for owner 2023-04-25 17:45:40 +03:00
42dff5584e "can be promoted" notification only when it's actually new (#9230)
* "can be promoted" notification only when it's actually new

* Reviews - sumOf instead of fold
2023-04-24 22:27:28 +03:00
033957c738 Performance improvements (#9265)
* UnitMovement#getDistanceToTilesWithinTurn hotspots

* Make fog busting less expensive

* Speed up tryHeadTowardsEncampment

* Reorder conditions in isGoodTileToExplore

* Reorder conditions in isGoodTileToExplore

* Revert "Speed up tryHeadTowardsEncampment"

This reverts commit d3841a233b.

* Don't lookup twice.
2023-04-24 17:16:43 +03:00
2f7fa6ba5c Civs should not go all-out war if they're weaker than barbs (#9267) 2023-04-24 14:58:01 +03:00