Commit Graph

7253 Commits

Author SHA1 Message Date
SomeTroglodyte
3ea9c6503b
Font choice rework (#6670)
* Font choice rework

* Font choice rework - naming

* Font choice rework - fix default font selection
2022-05-08 21:22:23 +03:00
SomeTroglodyte
4b7edca7a8
Rework of the "Creates improvement on a specific tile" Unique (#6687)
* Make Citadel tile takeover a unique

* CreatesOneImprovement unique overhaul step 1

* CreatesOneImprovement unique overhaul - increase highlights alpha

* Fix missing translatables, again

* CreatesOneImprovement unique overhaul - review suggestions

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
2022-05-08 21:22:01 +03:00
Timo T
7c24b0b6af
Fix old barbarian camps not being properly loaded after 86d5011 (#6724)
* Fix old barbarian camps not being properly loaded after 86d5011

* Fix first load resulting in error
2022-05-08 21:21:25 +03:00
Jack Rainy
d00b72806b
Leftovers from previous PRs (#6725)
* Leftovers from #6698

* Leftovers from #6718

* Better naming
2022-05-08 21:19:55 +03:00
Timo T
86d5011da1
In-depth serialization improvement, fixes Barbarian Camps revealed by Honor not showing immediately in multiplayer
* 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
2022-05-08 12:35:41 +02:00
Jack Rainy
569b51cb27
Missing uniques are added (#6721) 2022-05-08 11:23:55 +02:00
letstalkaboutdune
304d3317b0
Update VictoryScreen.kt (#6723)
Corrected bug in Demographics scoreboard which displayed current player based on turn, not based on viewing civ.
2022-05-08 09:00:46 +03:00
Jack Rainy
080842d65c
Assist on downloading of the missing mods (#6718)
* More verbose error handling

* Better handling of the missing mods exceptions

* Place GitHub routines where it is used the most

* Move a shared routine to the shared class

* Download missing mods

* Minor refactoring

* Minor fix: Handling corner cases
2022-05-07 21:59:01 +02:00
Yair Morgenstern
417831085b Resolved ANR in City Screen by increasing performance of rankTileForExpansion 2022-05-07 22:43:34 +03:00
Yair Morgenstern
806d58074c 4.0.13 2022-05-06 10:15:38 +03:00
Yair Morgenstern
621099b315
Version rollout (#6707)
* Bump version and create initial changelog entry

* Update Filipino.properties (#6703)

* Update Filipino.properties

* Update Filipino.properties

* Update Filipino.properties

* Update Filipino.properties

* Update Filipino.properties

* Update Italian.properties (#6693)

* Update German translation (#6691)

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Shann Aurelle Ripalda <shannaurelleg@gmail.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
Co-authored-by: MartinP <77325495+Mape6@users.noreply.github.com>
2022-05-06 10:07:20 +03:00
Xander Lenstra
155fbb2690
Adds a debug option to simulate up to some amount of turns (#6657)
* Adds a debug option to simulate up to some amount of turns
Note that the option popup only appears _after_ closing the option menu, 
which is very counterintuitive, but a direct result of how opening 
popups is implemented.
I'm fine if this PR is rejected as a result of that, but it is quite a 
useful option to have nonetheless.

* Reworked it so its just an internal text field + button

* Fixed the weird crashes and made UI interactive during simulation
2022-05-06 10:06:34 +03:00
Jack Rainy
13eb49f55c
Allow trade routes via city-states (#6696)
* Allow trade routes via city-states

* One more unit test is added

* Minor refactoring
2022-05-06 10:06:22 +03:00
Jack Rainy
3b4881ffdd
Reviewed version of the unit's teleportation (#6698)
* Unit tests for the teleports

* Ensure that unit may technically reach the teleport tile

* Capture the civilian units being teleported on them
2022-05-06 10:05:57 +03:00
Timo T
ceeb547fb8
Create turn notifier for when the game is running for Windows (#6682)
* Create turn notifier for when the game is running for Windows

If playing on Desktop, you often put the game into background, but still want to know if it's your turn. A standard Windows function for that is `FlashWindow` from winuser.h, which is implemented here

* Fix: Use the window from the listener instead of the static one from libGDL

* Only notify if it's the turn of the player that is playing

* Always notify spectators of the next players' turn

* Refactor: Move notifier into GeneralPlatformSpecificHelpers

* Only load Windows DLL when we're actually on Windows
2022-05-06 08:42:30 +03:00
Ouaz
822ce5e041
Update healing values in "Injured Units" article (#6704)
- Based on merged commit "Healing parity" (c8be00b)
2022-05-05 21:07:11 +02:00
Yair Morgenstern
f703f2fbde Do not resort building uniques when displaying in Civilopedia - leave as the json order to allow modders to determine order themselves 2022-05-05 18:43:28 +03:00
Yair Morgenstern
1e7eff9d1e Can no longer gift units to enemy City States 2022-05-05 18:36:46 +03:00
Yair Morgenstern
467a0aa742 Resolved crash due to sending 'localized message' from exception 2022-05-05 18:29:34 +03:00
Yair Morgenstern
28a207813b Resolved #6701 - No crash from Science victory AI units that cannot head towards capital 2022-05-05 17:41:11 +03:00
letstalkaboutdune
035b6528a7
New Demographics Scoreboard (#6645)
* Healing parity

Adjusted healing values for parity with CV

* New Demographics system for victory screen rankings

Added a new game setup checkbox option to use a ranking system on the victory screen which is more in line with the Civ V Demographics window. Created the UI element and game parameter but the demographics screen still needs to be implemented.

Also removed unnecessary comments from adjustments to healing values in a previous update.

* Demographics table init

Beginning to build structure of Demographics rankings table.

* Update VictoryScreen.kt

Attempt at getting more of the Demographics table implemented

* Update VictoryScreen.kt

Continued building the structure of the Demographics table

* Demographics first implementation

Finished first pass of Demographics screen.

* Minor text formatting

Improved some text formatting in code and comments.

* Update MapUnit.kt

Minor comment cleanup.

* SomeTroglodyte's Feedback, pt. 1

Implemented feedback given by SomeTroglodyte in PR #6645.

* Organized into functions

Split up Rankings table creation and Demographics table creation into new functions

* Update template.properties

Fixed missing space.

* Implementing more PR #6645 feedback

Added needed translation templates, used enum class instead of array for headers, moved checkbox to Options -> Display instead of new game

* Implemented rest of PR #6645 feedback

Simplified logic for finding player's rank, value, best/worst civ value, and filtered out defeated civs from the display and calculations

* Dead Civs get 0 in all categories

Added simple check if a civ is dead when computing score. If they are dead then they get 0 and go to the bottom of the scoreboard.

* Update VictoryScreen.kt

Further cleaned up code for better reuse and simpler logic with fewer loops.

* Update CivilizationInfo.kt

Simplified implementation of return 0 for stats when civ is defeated.

* Update CivilizationInfo.kt

Removed commented-out line of code.

* Fixed duplicate rank bug

Adjusted method of determining best and worst civs so that duplicates don't occur.

* Update VictoryScreen.kt

One-lined the handling of logic in buildDemographicsTable()

* Update VictoryScreen.kt

Moved static header row to new function.
2022-05-05 14:42:35 +02:00
Yair Morgenstern
b258b34c89 Use a UniqueMap to have hashmap finding instead of array iteration and string comparison for MapUnit getUnique(string) - see #6695 2022-05-05 12:29:04 +03:00
Yair Morgenstern
d285bc1ec7 When updating civ resources, only update stats if anything has changed - see #6695 2022-05-05 12:16:34 +03:00
Yair Morgenstern
79dc3c08d1 Cache city-wide uniques in addStatPercentBonusesFromBuildings and updateTileStats, don't build maps in Stats - see #6695 2022-05-05 11:14:31 +03:00
Yair Morgenstern
c6795d7e91 Cache city-wide uniques in CityConstructions.getStats() for reuse between buildings - see #6695 2022-05-05 10:39:40 +03:00
Yair Morgenstern
333582980f Ignore temporary uniques if not relevant - see #6695 2022-05-05 09:51:17 +03:00
Yair Morgenstern
fe2c98bc54 Lazy initialize of Yield group - see #6695 2022-05-05 09:50:35 +03:00
Timo T
cf6543bc29
Fix Sweden not being able to gift great people to city states (#6690) 2022-05-05 09:09:15 +03:00
MartinP
342367c72c
Fix typo in new translation line (#6692) 2022-05-05 01:23:22 +03:00
Yair Morgenstern
20d580976d Don't create unneeded filters in getMatchingUniquesWithNonLocalEffects - see #6695 2022-05-04 22:59:14 +03:00
Yair Morgenstern
6812caf3b3 Placeholder and Conditional function optimization - see #6695 2022-05-04 22:56:15 +03:00
Yair Morgenstern
7986134929 Update latest fastlane changelog entry when generating translation files 2022-05-04 19:03:47 +03:00
Yair Morgenstern
0aa1dbeda4 Added owner-style-specific improvements 2022-05-04 15:23:04 +03:00
Yair Morgenstern
760aace923 4.0.12 2022-05-04 10:56:17 +03:00
Yair Morgenstern
204d80fbe2
Version rollout (#6689)
* Bump version and create initial changelog entry

* Rework German descriptions for F-Droid (#6688)

* Update French.properties (#6678)

* Update German translation (#6674)

* Update Traditional_Chinese.properties (#6673)

* Update Indonesian.properties (#6663)

* Update Simplified_Chinese.properties (#6660)

* Update Simplified_Chinese.properties

* Fix errors

I wonder who translated 'wonder ' into “奇迹”. I bet he/she used machine translating. Pretty annoying

* Update Simplified_Chinese.properties

* Update Simplified_Chinese.properties

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: MartinP <77325495+Mape6@users.noreply.github.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: Chia-Hung Ni <jameseses@gmail.com>
Co-authored-by: kensvin <63847755+Kensvin28@users.noreply.github.com>
Co-authored-by: heipizhu4 <100454479+heipizhu4@users.noreply.github.com>
2022-05-04 10:48:41 +03:00
SomeTroglodyte
75239ca1d9
Optimize String to Stat and Translation mod list somewhat (#6669)
* Accelerate Stat.values().firstOrNull and tr.activeMods a bit

* Use Stat.safeValueOf and its Map in existing code
2022-05-04 10:12:40 +03:00
Yair Morgenstern
deac3d6f67 Minor performance improvement for border strings 2022-05-04 10:11:27 +03:00
SomeTroglodyte
cec9975b4d
Implement fastlane step 2: Translating (#6643)
* Implement fastlane step 2: Translating

* Placing the Font family Label before the Thread is nicer
2022-05-03 09:16:22 +02:00
Jack Rainy
5d1a09b214
Allow city connections via open borders and own harbors only (#6656)
* 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
2022-05-03 08:10:29 +03:00
heipizhu4
0d80929945
Make 'Followers of this religion" translatable (#6662)
First time editing the template. Is this the correct way to do so?
2022-05-03 08:07:41 +03:00
Timo T
ded648f6b1
Fix minimap actor leak (#6659)
* Formatting

* Fix minimap actor leak

The minimap update method tried to update borders only on tiles that changed owners, which is fine if that was what it did. But only the "remove old borders" part was in the "changed owners" branch, not "add new borders", so what actually happened was that each update all borders where the tile owner didn't change got added again, which is basically all borders.

This caused a huge slowdown the more actions you do on the world map in a single turn (i.e. move a lot of units). When a new turn starts, the minimap gets completely thrown away and rebuilt, so then it's fine again.

This changes the minimap to properly add/remove borders when something actually changes.

* Refactor: Split classes up into separate files

Also, split up the Minimap.init method into smaller methods to make it a bit more readable

* Finish up comment
2022-05-03 08:07:17 +03:00
Xander Lenstra
da2d3450b8
Fixed provides [amount] [resource] on buildings not accepting conditionals (#6664)
* Fixed `provides [amount] [resource]` not accepting conditionals
This was due to it still using `getLocalMatchingUniques` without 
providing a `StateForConditionals`, and then manually filtering them if 
they didn't provide conditionals. This of course doesn't work anymore, 
as `getLocalMatchingUniques` then assumes that all conditionals aren't 
satisfied.
Also refactored a loop over `uniqueObjects` with `isOfType()` to just 
use `getMatchingUniques()`.

* Only initialize StateForConditionals once

* Actually this is more moddable
2022-05-03 08:01:54 +03:00
SomeTroglodyte
515c9bbcae
Show available resources from CityScreen (bottom right info only) (#6667) 2022-05-03 07:59:42 +03:00
SomeTroglodyte
6ceb2b10c2
Fastlane - sort screenshots by renaming (#6671) 2022-05-03 07:57:03 +03:00
Xander Lenstra
c55b14eaa7
Implemented most easy things from comments on moddable victory PR (#6600)
* Implemented most easy things from comments on moddable victory PR
Also added religious victory condition

* Fixed tests

* Fixed compile problems & missing string

* Fixed typo
2022-05-03 07:56:24 +03:00
SomeTroglodyte
345114ed93
Unciv Adaptive Android Icon (#6672)
* Use both icon and roundIcon properties

* Studio-generated Android Icon

* Studio-generated Android Icon to fastlane

Co-authored-by: JackRainy <JackRainy@users.noreply.github.com>
2022-05-03 07:55:55 +03:00
MartinP
e279e14fe8
Update Hosting-a-Multiplayer-server.md (#6676)
* Update Hosting-a-Multiplayer-server.md

Added a section for explaining that Android does not like unencrypted traffic to a self-hosted server and that you need to setup a reverse proxy to do that.

* Added hint for MultiplayerFiles folder
2022-05-03 07:52:59 +03:00
Jack Rainy
a938fffb99
Fix of the broken link in the uniques.md (once again) (#6665)
* Fix of misprint (once again)

* Usage of CRLF endings
2022-05-03 07:52:20 +03:00
alexban011
898b1ca056
check for internet before starting a mp game to avoid freeze (#6679)
* Fixed issue #6649 by checking for internet connection before starting the game if "online multiplayer" is selected
Many thanks to SomeTroglodyte for most of the code and for explanations

* check for internet before starting a mp game to avoid freeze

Fixed issue #6649 by checking for internet connection before starting the game if "online multiplayer" is selected.

Many thanks to SomeTroglodyte for most of the code and for explanations. A slight modification has been done to the code to catch an error caused by InetAddress

* Revert "Merge remote-tracking branch 'origin/master-noInternet' into master-noInternet"

This reverts commit bd6474b50d, reversing
changes made to f52ad60b51.
2022-05-02 23:41:08 +02:00
Jack Rainy
031cb4fc14
Enable scrolling for the oversized popups (#6668) 2022-05-02 13:56:34 +02:00