Commit Graph

176 Commits

Author SHA1 Message Date
Yair Morgenstern
2e5e221158 CityStateType overhaul!!!! 2022-11-21 20:30:52 +02:00
Yair Morgenstern
7d9db1e119 CityStateType deprecation p1 2022-11-21 20:03:05 +02:00
Yair Morgenstern
8530de7de1 Can now use [stats] unique to add happiness globally 2022-11-21 11:33:29 +02:00
Yair Morgenstern
0cf5c33475 Can now use [stats] unique for e.g. techs, policies, etc, to add gold/faith/culture/science to the global pool 2022-11-21 11:21:42 +02:00
Yair Morgenstern
61b98120a8 Fixed tests failing due to removing "crutches" 2022-11-20 00:24:59 +02:00
Leonard Günther
4522ab4c6b
Added "How to create a UI skin for Unciv" to wiki (#7976)
* 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
2022-11-06 22:53:55 +02:00
Yair Morgenstern
f0ad7581bc Resolved crash when mods make 2 techs require each other 2022-10-13 22:55:12 +03:00
Xander Lenstra
35eb71c937
Removes the option for disabling religion (#7606)
* Removes the option for disabling religion

* Deprecated religionEnabled variable, set default to `true` and removed in cases where it shouldn't have effect
2022-08-05 11:46:06 -04:00
OptimizedForDensity
53d18095ee
Add unit test for unique translation template keys (#7557) 2022-07-30 10:32:40 +03:00
Yair Morgenstern
8574ad4624
Save all tile terrains and terrain uniques in transients, for better performance (#7490)
* 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
2022-07-20 16:38:42 +03:00
Xander Lenstra
160b51d578
Added more unit tests (#7448) 2022-07-14 10:27:06 +03:00
Timo T
83d5d1ab36
Add a simple GDX application to help with developing UI components (#7411)
* Add a simple GDX application to help with developing UI components

* Add UI development docs
2022-07-13 21:58:43 +03:00
Xander Lenstra
ae5a0221ed
Refactorings & three more unit tests for uniques (#7412) 2022-07-10 23:19:45 +02:00
Yair Morgenstern
3422e161ad Removed deprecated uniques 2022-07-08 15:48:33 +03:00
SomeTroglodyte
64ab79faf3
Moddable prettier Tutorials - Step 1 (#7326)
* Moddable prettier Tutorials - Step 1

* Moddable prettier Tutorials - TranslationFileWriter

* Moddable prettier Tutorials - Kdoc

* Moddable prettier Tutorials - UX for open options task
2022-07-01 09:36:11 +03:00
Timo T
57ed61af41
Save compatibility handling (#7255)
* 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
2022-07-01 09:34:41 +03:00
Timo T
bc9a42e452
Save uncaught exception to file (#7247)
* Refactor: Rename GameSaver to UncivFiles

* Save last uncaught exception to file

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
2022-06-25 22:30:27 +03:00
OptimizedForDensity
e69789a683
Allow modded harbor-type buildings to connect cities to capital (#7254) 2022-06-23 20:53:32 +02:00
Azzurite
18b91bba1e Change all translation test output checking for translator's errors back to println 2022-06-20 14:27:52 +02:00
OptimizedForDensity
c922f134e6
Moddable game speeds (#6856)
* Move GameSpeed definition to JSON files

* Add game speeds civilopedia page
2022-06-18 23:27:46 +02:00
SomeTroglodyte
e2b7891248
Two new Unit Tests (#7001)
* MapGenerator fixes

* MainMenu Background Map scaled to Screen

* Easter Eggs - Code only

* Easter Eggs - Graphics
2022-06-16 21:07:30 +03:00
alexban011
564f7b476c
small fixes (#7181)
* fixes

* relaced translations with _

* better displayCutout
2022-06-16 18:56:18 +03:00
Timo T
a5f9623dbe
Fix OutOfMemory error when loading game state after already having a game loaded (#7145)
* 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
2022-06-14 21:09:09 +03:00
Timo T
b6a98e5540
Fix EventBus not being able to listen to events with more than one level of inheritance (#7009) 2022-06-14 21:08:43 +03:00
Yair Morgenstern
120c41dd15 Revert "Moddable prettier Tutorials - Step 1 (#7064)"
This reverts commit e91c0ff212.
2022-06-06 09:59:21 +03:00
SomeTroglodyte
e91c0ff212
Moddable prettier Tutorials - Step 1 (#7064) 2022-06-06 09:32:23 +03:00
Jack Rainy
862f368075
Bugfixes to the units' teleportation (#7071)
* Allow to pass other units when teleporting

* Teleport to the closest city tile

* Additional unit tests
2022-06-05 23:17:59 +03:00
Timo T
868e551ba9
Fix test logging not using format specifiers for arbitrary text (#7073) 2022-06-05 16:57:16 +02:00
OptimizedForDensity
12674ed69e
Fix aircraft disappearing when their carrier is teleported (#7035)
* 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
2022-06-01 22:28:11 +03:00
OptimizedForDensity
afce951724
Pillaging certain improvements may loot gold or other stat resources (#6993)
* 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
2022-06-01 19:13:04 +02:00
OptimizedForDensity
09195d6b62
More UniqueType unit tests and correct some broken uniques in JSON files (#6965)
* Add ruin reward unique check plus fix broken unique
2022-05-29 16:08:15 +02:00
Timo T
214fae6f59
Add simple logging solution (#6952)
* Add simple logging solution

* Fix Android compilation

For some reason I stashed this and didn't unstash.

* Add better logging explanation
2022-05-27 13:45:13 +03:00
Timo T
ea03b97639
#6914 Multiplayer Status Display (#6916)
* 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
2022-05-25 22:22:58 +02:00
Timo T
fc9668f2d0
Refactor: change GameSaver from singleton to single instance pattern & move autosave logic into GameSaver (#6846)
* 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
2022-05-22 19:51:35 +03:00
SomeTroglodyte
a2c646ef8e
Fix Autocracy Complete including unit test (#6908) 2022-05-22 19:51:05 +03:00
Xander Lenstra
3754108391
Added more unit tests for uniques; added missing unique implementations (#6886)
* 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
2022-05-22 13:12:10 +03:00
SomeTroglodyte
3e95e3f152
Fix effect of new Beliefs not immediately visible in top bar (#6888)
* Fix effect of new Beliefs not immediately visible in top bar

* Fix effect of new Beliefs not immediately visible - reviews
2022-05-21 21:37:06 +03:00
Yair Morgenstern
1f3890e2a0 welp these tests kind of existed before 2022-05-19 19:02:57 +03:00
Yair Morgenstern
1126a7c996 Added test that improvements can be built on their tiles 2022-05-19 14:27:01 +03:00
Timo T
5353f3337c
Fix Gdx.files being garbage collected in MultiplayerTurnCheckWorker (#6817)
* Add logging to MultiplayerTurnCheckWorker

* Fix NullPointerException in turn check worker: Gdx.files is null
2022-05-18 07:35:00 +03:00
Xander Lenstra
7b3a4c741f
Added more unit tests for uniques (#6841) 2022-05-17 15:42:27 +02:00
Jack Rainy
ab82328211
Missing typed uniques for the units - part 2 (#6749)
* 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
2022-05-13 12:34:10 +03:00
Xander Lenstra
8fcfbf752b
Improved clarity and moddability of building improvements (#6712)
* 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
2022-05-11 00:35:21 +02: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
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
cf6543bc29
Fix Sweden not being able to gift great people to city states (#6690) 2022-05-05 09:09:15 +03: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
Yair Morgenstern
702f477e49
Added placeholder parameter location in a way that enables nested translations (#6632)
* Added placeholder parameter location in a way that enables nested translations - see #6474

* Simplified
2022-04-28 13:32:55 +02:00