Commit Graph

5175 Commits

Author SHA1 Message Date
591c96b0c1 puppet cities only focus on gold (#6946)
* fixed issue

* cleanup

* puppets only like making gold

* fully revert file to master file

* Update CityInfo.kt
2022-05-27 13:52:23 +03:00
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
e7a90f2ad0 Make so Citizen Management buttons don't work if Spectator (#6954) 2022-05-26 15:24:55 +03:00
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
e54fda5a4a Resource supply list reorg (#6881)
* ResourceSupplyList reorg

* ResourceSupplyList reorg - instrumentation

* ResourceSupplyList reorg - map of maps

* ResourceSupplyList reorg - revert to ArrayList

* ResourceSupplyList reorg - review

* ResourceSupplyList reorg - review

* ResourceSupplyList reorg - almost-immutability
2022-05-25 19:42:51 +03:00
e1b76e776d Fix floodfill abbreviation translation showing on fortify key tooltips (#6909)
* Fix floodfill abbreviation translation showing on fortify key tooltips

* Fix floodfill abbreviation translation - fix case

* Fix floodfill abbreviation translation - existing and comment
2022-05-25 19:39:08 +03:00
392a8d5de9 Re-hide Enable Portrait option on desktop (#6912)
* Re-hide Enable Portrait Option in desktop version

* MainMenu Background Map Job cancellable

* MainMenu Background Map generation cancellable

* MainMenu Background Map cancellable - remove instrumentation

* Revert "MainMenu Background Stuff"
2022-05-25 19:37:44 +03:00
0f63000ac8 Show required resource for upgrades, rework upgrade logic (#6849)
* Show required resource for upgrades, rework upgrade logic

* Show required resource for upgrades - reviews
2022-05-25 19:35:27 +03:00
0461d9d7fd Fix Right-Click attacks made no sound (#6906)
* Fix Right-Click attacks made no sound

* Fix Right-Click attacks made no sound - no UI in logic

* Fix Right-Click attacks made no sound - comments

* Fix Right-Click attacks made no sound - comments
2022-05-25 19:34:41 +03:00
e927ef6f64 ImageGetter.getDrawable a few ns faster (#6936) 2022-05-25 19:33:17 +03:00
6f7af9ee22 KeyPressDispatcher no longer silently eats exceptions (#6931) 2022-05-25 19:32:24 +03:00
fe0ec08e61 Fix missing icons and translations in civilopedia accessed from main menu (#6922)
* Fix blank icons

* Apply translations to civilopedia + use complex ruleset

* Unused import

* Typo

* Simplify definition
2022-05-25 19:31:12 +03:00
156db1f5f7 Go back to current game when you press "Resume" on the main menu (#6882) 2022-05-25 19:27:59 +03:00
16874f5da6 Implement a waiting command (#6884) (#6896)
* Implement a waiting command (#6884)

* Resolve misc. issues with commit 27a03bca8

* Resolve misc. issues with commit 93d9fe9cc

* Resolve misc. issues with commit 2ca7ed154

Co-authored-by: Paul Pogonyshev <pogonyshev@gmail.com>
2022-05-25 04:07:20 +02:00
0661bbc31b Fixed slider sound playing when opening NewGameScreen and MapEditor (#6932)
* fixed slider sound playing in some of the tabs

* made "initial" value mandatory to avoid such issues in the future

* initial values now taken from gameParameters

* whitespaces
2022-05-24 22:43:00 +02:00
93afb26c62 Added option for confirmation when clicking "next turn" button (#6925) 2022-05-24 21:32:35 +02:00
b59b890ced Fix multiplayer turn check worker exception (#6915) 2022-05-23 10:48:08 +03:00
6836038252 4.1.2 2022-05-22 20:40:51 +03:00
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
a2c646ef8e Fix Autocracy Complete including unit test (#6908) 2022-05-22 19:51:05 +03:00
39bbb2de1c Fix crashes when a civ does not have a capital (#6889) 2022-05-22 17:00:42 +02:00
740886c890 Refactor UncivShowableException (#6899) 2022-05-22 13:55:19 +02:00
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
f34b97a421 Fix multiplayer turn checker potentially stopping turn checks for everyone that plays that game if a file was not found remotely (#6901) 2022-05-22 00:13:48 -07:00
244f9477df Initial Event Bus implementation & Event-based multiplayer updates (#6826)
* Add EventBus

* Refactor: Extract multiplayer logic into their own classes & make updates event-based instead of throwaway+rebuild
2022-05-22 00:05:33 +02:00
91ffa2e185 Fix screens not correctly being dispose()d (#6876) 2022-05-21 23:52:02 +02:00
81379078fa Refactor: Split options into multiple files (#6857)
* Refactor: Move OptionsPopup to own package

* Refactor: Split OptionsPopup into multiple classes

# Conflicts:
#	core/src/com/unciv/ui/options/OptionsPopup.kt
2022-05-21 21:57:06 +03:00
a128ea0d59 Fix images not being able to have their size set (#6887)
* Fix images not being able to have their size set

* Small corrections

`> 0f` to include `-0f`
2022-05-21 21:43:30 +03:00
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
8b9946e65e Fix Zone of Control (#6891) 2022-05-21 15:24:18 +02:00
915f3e694f A lot of smaller code/performance improvements (#6859)
* Unused import directive

* Unused symbols

* Unnecessary constructions

* Redundant constructions

* Some optimizations

* Java interop issues: a package must match a location

* Collection .count() can be replaced with .size

* Class member can be "private"

* Call chain can be simplified

* Simplified conditions

* Proper use of variables

* Assignment styles

* Corrections after the code review

* Corrections after the code review - part 2

* Code review feedback: get them back to public

* Fix of the bad merging

* Code review: Lost spaces found their homes
2022-05-21 01:41:28 +02:00
5d835c762a Refactor: Extract PickerPane from PickerScreen (#6870)
Refactor: Extract PickerPane from PickerScreen
2022-05-20 21:23:25 +02:00
a2bc1a1a29 Assign Population Improvements (#6650)
City management UI to allow focusing automatic worker placement

Improvements to worker / specialist assignment routines
2022-05-20 00:12:23 +02:00
a272e8e7ba Correct check for the city connection quest (#6875) 2022-05-19 22:52:55 +02:00
0ced4d96e7 SimpleHttp gets a connection timeout (#6812)
* SimpleHttp gets a connection timeout
2022-05-19 14:30:31 +02:00
6dabffb5a9 Fixed a bug blocking special improvements on removable terrain features (#6865) 2022-05-19 13:04:03 +03:00
3d6a01d633 Build warnings cleanup (#6827) 2022-05-19 02:12:18 +02:00
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
4986505363 Great General typed uniques and improved moddability (#6818)
* Great General UniqueTyped and improved moddability - draft

* Great General UniqueTyped and improved moddability - reviews

* Great General UniqueTyped and improved moddability - no reason not to cache another

* Integration with JackRainy's solution

* Integration with JackRainy's solution - part 2

* Revert of maxGreatGeneralBonusRadius logic

* Minor refactoring

* Code review: minor refactoring

* Keep the warning for the modders about the obsolete unique

* Code review: Better wording for the unique

Co-authored-by: SomeTroglodyte <63000004+SomeTroglodyte@users.noreply.github.com>
2022-05-18 00:02:53 +03:00
7079619fe2 Great improvements can again be constructed on forest (#6823)
* Great improvements can again be constructed on forest
This PR fixes a bug where great improvements couldn't be build on 
forests/marshes/jungles/etc. It does so by creating a unique which 
specifically allows for removing features, and checking for that.
Additionally, we only remove these features when we have the tech to 
remove them. For example, you can no longer plonk an Academy down over a 
forest without having researched mining.

* Missed the file for vanilla

* Reviews

* Fixed logic
2022-05-17 20:04:49 +03:00
919812f775 Fixed MP refresher not working after rate limit (#6847) 2022-05-17 20:02:30 +03:00
fa2c5f7cde Added 'in puppeted cities' cityFilter (#6843)
* Added 'in puppetted cities' cityFilter

* Added to list of unique parameters
2022-05-17 17:43:20 +02:00
df9b62ff6f Fix coroutines not being added to desktop:dist (#6822)
* Use kotlin coroutines instead of raw threads (+ refactorings)

Equal to f8e0f572

* Fix coroutine class files not being added to desktop:dist
2022-05-17 08:37:12 -07:00
7b3a4c741f Added more unit tests for uniques (#6841) 2022-05-17 15:42:27 +02:00
88585bcf7d Fix MayWithdraw modifier calculation (#6829)
* Fix MayWithdraw modifier calculation

* Readability changes

Co-authored-by: OptimizedForDensity <>
2022-05-16 17:37:05 +03:00
8329d56131 Allow generation of "Default" Deciv redux maps (#6821) 2022-05-16 13:03:06 +03:00
96780be1d2 Fix and improve real time autofix while typing on multipleServer URL (#6772)
Sometime `TextField.cursorPosition` becomes greater than `TextField.text.length` for unknown reasons
In those cases we need to bring the cursor down to its maximum possible position which is `TextField.text.length`
Otherwise we will get `java.lang.StringIndexOutOfBoundsException` thrown from `kotlin.text.substring`
Not knowing the reason why it happens, I followed the libGDX implementation from here:
e03b757cae/gdx/src/com/badlogic/gdx/scenes/scene2d/ui/TextField.java (L689)
And it seems to have fixed the errors we were getting
2022-05-15 23:40:55 +02:00
ef08bda50d Revert "Use kotlin coroutines instead of raw threads (+ refactorings) (#6801)"
This reverts commit f8e0f572
2022-05-15 19:21:37 +03:00
7ef2bbc56c Revert "Use kotlin coroutines instead of raw threads (+ refactorings) (#6801)"
This reverts commit f8e0f572
2022-05-15 19:20:23 +03:00
c4de3530f6 Possibility to liberate a traded city (#6797) 2022-05-15 17:57:29 +03:00