Commit Graph

9268 Commits

Author SHA1 Message Date
c45d3ecb7c Promotion picker allowing picking chains in one go (#9655)
* Try to allow chained promotion picking

* Reorg PromotionPickerScreen into own package

* Draft for new PromotionTree

* Change PromotionPickerScreen to use new tree (picking still not done)

* Finish new PromotionPickerScreen - code

* Finish new PromotionPickerScreen - assets and linting

* Finish new PromotionPickerScreen - polish positioning and lines

* Finish new PromotionPickerScreen - fix sound

* Finish new PromotionPickerScreen - little optimization

* Finish new PromotionPickerScreen - emphasize line along path

* Finish new PromotionPickerScreen - merge fix

* Finish new PromotionPickerScreen - address comments

* Finish new PromotionPickerScreen - fix sort and update wiki
2023-06-28 10:49:35 +03:00
d298f85099 Fixing workers dying in mountains bug for Carthage (#9665)
* Fixed workers dying in mountain tiles issue for Carthage

* Accounts for all damage dealing tiles

* Update WorkerAutomation.kt

* Update Tile.kt

* Update WorkerAutomation.kt

* Update WorkerAutomation.kt
2023-06-28 10:48:44 +03:00
73fa87e6b4 Check for trigger uniques when starting and recaluating population (#9673)
* Check for trigger uniques when starting and recaluating population

* Adding imports

* whoops

* Moved where starting techs are added, added a parameter, and fixed the check for GUI
2023-06-28 10:48:33 +03:00
ee855b8d77 Solved strange concurrency crashes due to players keypress-activating disabled buttons 2023-06-28 10:45:36 +03:00
bef1843cd9 chore: Removed vestigal city.apply{} for CityInfoConquestFunctions, for clarity on what is actually for the city and what is not
No logic changes
2023-06-28 10:34:29 +03:00
42a9c3af57 Resolved #9679 - 'liberate city and resurrect civ' no longer crashes
Kudos @SomeTroglodyte and @random271 for locating the problem :)
2023-06-28 10:27:09 +03:00
a6e4b72cf4 AI no longer purchases non-contiguous tiles 2023-06-26 23:07:53 +03:00
0536c5f24b Resolved #9669 - city name translation for conquered popup does not get icon 2023-06-26 22:08:41 +03:00
6a8f4914b8 More defensive coding of speedupWonderConstruction (#9671) 2023-06-25 19:24:30 +03:00
330fa6593b 4.7.4 4.7.4 2023-06-25 10:07:17 +03:00
14e1683db2 Version rollout (#9667)
* Bump version and create initial changelog entry

* Ukrainian translations (#9663)

* Update French.properties (#9662)

* Update French.properties

* Fix wrong key

* Update Spanish.properties (#9652)

* Update Spanish.properties

* Update Spanish.properties

* Brazilian_Portuguese.properties (#9649)

* Update Italian.properties (#9647)

* Update Italian.properties

* Update Italian.properties

* Update German.properties (#9646)

* Update German.properties

* Fixed missing [spyname]

---------

Co-authored-by: Birk Birkner <birkner@bbirkner.de>

* Update Polish.properties + question (#9644)

* Update Polish.properties

* Update Polish.properties

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Jack Rainy <JackRainy@users.noreply.github.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: Caballero Arepa <78449553+Caballero-Arepa@users.noreply.github.com>
Co-authored-by: Vitor Gabriel <59321138+Ranbut@users.noreply.github.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
Co-authored-by: Knirps1 <52383078+Knirps1@users.noreply.github.com>
Co-authored-by: Birk Birkner <birkner@bbirkner.de>
Co-authored-by: Lesiakower <125187776+Lesiakower@users.noreply.github.com>
2023-06-25 09:58:03 +03:00
0aca3c307b Notifications architectural update (#9605)
* Improved Notifications architecture

* Revert NotificationIcon as class hierarchy

* Improved Notifications architecture - migration roadmap first step
2023-06-25 09:47:50 +03:00
1a6d8d72bb Fix ruleset error crash (#9666)
* Harden NewGameScreen against exceptions from getComplexRuleset

* Miscellaneous tweaks to NewGameScreen - e.g. allow it to show last used custom map
2023-06-25 09:46:00 +03:00
abb0dcbaae Mod name defense attempt II (#9645)
* Improve Load game error label readability

* Fix threading on load game screen

* Miscellaneous tweaks

* Compatibility with Mods using trailing dashes on Windows
2023-06-25 09:38:18 +03:00
82ebb01a20 Zoom in/out of the history charts (#9660)
* Do not recreate the Line Chart every time

* Simplifed the Line Chart creation

* Do not create objects in draw(): VictoryScreenCivGroup table

* Do not create objects in draw(): Labels

* Create labels without negative Y

* Lift the X axis if there is an negative number

* Arbitrary number of -Y labels

* Autoscale by Y axis

* Zoom in/out by click

* Autoscale by X axis

* Unit tests for LineChart

* Rework of the line chart rendering
2023-06-25 09:37:08 +03:00
1285133884 Adding field for great person type (#9614)
* Adding Field for great person types

* Switching from unit field to unique

* Simplification and adding back in the old field for backward compatibility

* Deprecate old field for checking great person

* Fix error

* Fixes part 2. I probably should've waited
2023-06-25 09:36:33 +03:00
aa0fb9ed8b More unit unique tests (#9639) 2023-06-25 09:35:31 +03:00
bc3f1341e1 Tech column validation and removing crashes from undefined building costs (#9664)
* Add in tech column validation

* Negative Columns

* Forgot to add techColumns to the add and clear functiond

* Remove restrictive cokumn check

* bugfixing
2023-06-25 09:34:23 +03:00
650a43aa3b Make UncivGame.isInitialized inaccessible outside of the class hierarchy (#9651)
* Make UncivGame.isInitialized inaccessible outside of the class hierarchy

* Fix JvmName
2023-06-25 09:03:44 +03:00
a246baa333 Resolved #9638 - Removing old buildings on enemy capital (when not last city) no longer crashes 2023-06-23 10:17:45 +03:00
ee668710e2 Resolved #9637 - Concurrent modification fix for liberated city with multiple units in it 2023-06-23 09:54:33 +03:00
b7e4ca358c Resolved #9641 - Removed static wrapper functions from WorkerAutomation 2023-06-23 09:51:04 +03:00
b6aa177311 4.7.3 4.7.3 2023-06-23 09:39:54 +03:00
66eed083f2 Fixed broken build 2023-06-23 09:26:53 +03:00
e4e997a189 Remove GWT dependency which is broken 2023-06-23 09:10:09 +03:00
970cb3cf3d Version rollout (#9642)
* Bump version and create initial changelog entry

* Update Traditional_Chinese.properties (#9634)

* Update Traditional_Chinese.properties

* Update Traditional_Chinese.properties

* Update Spanish.properties (#9628)

* Update French.properties (#9626)

* Update Italian.properties (#9624)

* Update German translation (#9623)

* Update Polish.properties (#9620)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Leslie Yu <32165704+leslieyu608@users.noreply.github.com>
Co-authored-by: Caballero Arepa <78449553+Caballero-Arepa@users.noreply.github.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
Co-authored-by: mape6 <mape6@posteo.de>
Co-authored-by: Lesiakower <125187776+Lesiakower@users.noreply.github.com>
2023-06-23 09:08:38 +03:00
fd56581f21 Update Building-Locally.md (#9631)
* Update Building-Locally.md

Updated build documentation with links, clearer language, and better installation structure

* Update docs/Developers/Building-Locally.md
2023-06-23 08:53:09 +03:00
38cf71a7ab Bug fix: Buildings not set to -1 by default correctly (#9635)
* Change the default cost of buildings and the default time of tile improvements

* Bugfix: default building cost is now set to -1 as intended
2023-06-23 08:52:47 +03:00
f78fd7e665 Move on water (#9622)
* Add in Move on water unique

* Small fixes

* Remove redundant check
2023-06-23 08:51:48 +03:00
47e93a86bf Spies now occasionally steal technologies (#9629)
* Spies now occasionally steal technologies

* Updated the UI so it doesn't show a turn counter when that cannot be provided

* Implemented changes discussed in reveiw comments

* Renamed variable

---------

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
2023-06-23 08:51:34 +03:00
3c1f0f7814 Spies in cities that are captured or destroyed now go to the hideout (#9632)
* Spies in cities that are captured or destroyed now go home

* Turned spy flee reason string into enum
2023-06-23 08:50:56 +03:00
e1fb0e489d Moved the default message to the ApiStatusCode enum (MPv2) (#9630) 2023-06-20 13:08:09 +03:00
ff54bcd493 Prevent mod conflicts better (#9586)
* Tighten mod check severity and selectivity for unit-producing triggered Uniques

* Prettify display of mod check results by suppressing dupes and hiding conditionals from tr()

* Extra confirmation to play with errors, colors, improved handling of mod checkboxes

* Tweaks to improved mod checking in new game
2023-06-19 19:02:09 +03:00
172fee9902 Change the default cost of buildings and the default time of tile improvements (#9621) 2023-06-19 19:01:40 +03:00
c0e5f9d736 Linked Unit Types and Promotions in Civilopedia 2023-06-19 16:04:35 +03:00
e987bbbaad Added new unique - "Automatically built in all cities where it is buildable" 2023-06-19 15:40:21 +03:00
4107e081bd 4.7.2 4.7.2 2023-06-18 18:29:55 +03:00
4579e37848 Version rollout (#9618)
* Bump version and create initial changelog entry

* Ukrainian translations :flag-ua: (#9615)

* update Simplified_Chinese (#9613)

* Updated Brazilian_Portuguese.properties (#9599)

* Update French.properties (#9597)

* Update Italian.properties (#9595)

* Update Italian.properties

* Update Italian.properties

* Update Polish.properties (#9594)

replaced symbols with polish letters

* Update Polish.properties (#9593)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Jack Rainy <JackRainy@users.noreply.github.com>
Co-authored-by: chr_56 <30681738+chr56@users.noreply.github.com>
Co-authored-by: Vitor Gabriel <59321138+Ranbut@users.noreply.github.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
Co-authored-by: Lesiakower <125187776+Lesiakower@users.noreply.github.com>
2023-06-18 18:26:18 +03:00
bd3aa54670 Multiplayer v2: networking stack, dependencies & API definition (#9589)
* Added new ktor dependency for developing multiplayer API v2

* Added the api package, including endpoint implementations, cookie helpers, serializers and structs

* Fixed a bunch of problems related to error handling

* Fixed some API incompatibilities, added getFriends() method

Rename the Api class to ApiV2Wrapper, added a chat room screen

Replaced logging dependency, renamed the endpoint implementations

* Dropped the extra logger to remove dependencies, added the APIv2 class

* Restructured the project to make ApiV2 class the center

* Improved chat handling, added server game detail caching

Added a generic HTTP request wrapper that can retry requests easily

Added a default handler to retry requests after session refreshing

* Updated the API structs based on the new OpenAPI specifications

Switched endpoint implementations to use the new 'request', updated WebSocket structs

* Updated the auth helper, added the UncivNetworkException

Fixed some more issues due to refactoring APIv2 handler

Fixed some issues and some minor incompatibilities with the new API

* Implemented the LobbyBrowserTable, added missing API endpoint

Fixed login and auth issues in the main menu screen

* Added new WebSocket structs for handling invites and friends

Updated the API reference implementation

* Added GET cache, allowed all WS messages to be Events, added missing endpoints

Added func to dispose and refresh OnlineMultiplayer, only show set username for APIv2

* Reworked the ApiV2 class to improve WebSocket handling for every login

Added small game fetch, fixed lobby start, some smaller fixes

* Change the user ID after logging in to fix later in-game issues

Attention: Afterwards, there is restoration of the
previous player ID. Therefore, it won't be possible to
revert back to APIv0 or APIv1 behavior easily (i.e., without
saving the player ID before logging in the first time).

Added serializer class for WebSocket's FriendshipEvent enum

Fixed chat room access and cancelling friendships

* Fixed WebSocket re-connecting, outsourced configs

Updated the RegisterLoginPopup to ask if the user wants to use the new servers

Implemented a self-contained API version check with side-effects

Fixed various problems with WebSocket connections

Don't show kick button for lobby owner, handle network issues during login

* Added English translations for ApiStatusCode, fixed broken APIv1 games for uncivserver.xyz

Fixed subpaths in baseUrl, added server settings button

* Added WS-based Android turn checker, added a new event channel, fixed APIWrapper

Added a logout hook, implemented ensureConnectedWebSocket

Merge branch 'master' into dev

* Throttle auto-reconnect for WS on Android in background, added reload notice for your turn popup

Implemented real pinging with awaiting responses, fixed ping-related problems

* Adapted new getAllChats API, added outstanding friend request list, improved styling

* Added the ApiVersion enum and the ApiV2 storage emulator

* Updated the APIv2 file storage emulator

* Replaced all wildcard imports with named imports
2023-06-18 18:17:59 +03:00
fa68b8746e Fix conditionals for trigger upon declaring friendship running twice (#9601) 2023-06-18 18:15:40 +03:00
123a51a6ef Publish new mod category workflow (#9606) 2023-06-18 18:15:13 +03:00
d79c68b273 More keyboard binding work - World, World Menu Popup, WASD (#9598)
* Groundwork for tooltips for user-bindable keys

* WorldScreen keyboard revisited

* WorldScreen menu popup keyboard support

* WorldScreen WASD bindable
2023-06-18 18:11:10 +03:00
5e9059cd1e Small comment changes in UniqueType.kt (#9617) 2023-06-18 16:35:17 +03:00
c823989c39 Reverted BFS changes, since they caused significant performance degradation 2023-06-18 01:03:20 +03:00
298771a72b Revert "Workers try to build roads utilizing existing roads, and railroads overriding existing roads"
This reverts commit e558ebcc59.
2023-06-18 01:01:12 +03:00
291c546dec Performance improvements
- use existing map for building resource check, instead of iterating over uniques
- remove one retrieval for UniqueMap.addUnique

Idea for future improvement: setTerrainFeatures currently populates a UniqueMap for each tile. MANY tiles share the same set of features...
2023-06-18 00:45:34 +03:00
ead83b912b Performance improvements
- unit unique check uses map, not array search
2023-06-18 00:25:03 +03:00
e634423b2f Performance improvements
- containsBuildingUnique uses map, not array search
2023-06-18 00:01:36 +03:00
51583ab588 Performance improvements
- forCivGetMatchingUniques doesn't toString stateForConditionals if the result would anyway not be cached
2023-06-17 23:59:42 +03:00
259eeeb56c Performance improvements
- improvementFilter checks map instead of array for textual match
- forCityGetMatchingUniques does not string-serialize conditionals - revealed by flame chart to be significant
2023-06-17 23:47:49 +03:00