Commit Graph

201 Commits

Author SHA1 Message Date
Yair Morgenstern
a76b344aba Split itch upload to separate job - test4
Separated 'packr' gradle task from 'dist' task which builds the JAR
2023-03-07 21:54:41 +02:00
vegeta1k95
b57232c992
Android: selectable orientation (#8822)
* Android: selectable orientation

* Fix visible rectangle bug, fix auto-rotate behaviour, add translations

* Fix translation

---------

Co-authored-by: vegeta1k95 <vfylfhby>
2023-03-06 10:35:14 +02:00
vegeta1k95
f55e010451
Android: "Screen Mode" option (#8785)
* Android: "Screen Mode" option

* Fix broken tests, code cleanup

* Fix broken tests, code cleanup

* Fix broken tests, code cleanup

---------

Co-authored-by: vegeta1k95 <vfylfhby>
2023-03-04 19:22:09 +02:00
Yair Morgenstern
66faeb0d15 Preparation for unit action modifiers 2023-03-01 15:26:54 +02:00
vegeta1k95
494fde53cf
Cleaning: platform specifics and UncivGame (#8773)
* Cleanup: platform specifics + UncivGame

* Fix tests

* Fix requests not clearing

---------

Co-authored-by: vegeta1k95 <vfylfhby>
2023-02-28 18:56:57 +02:00
Yair Morgenstern
c1df32b4e7 Add new uniques to wiki 2023-02-26 22:15:15 +02:00
Yair Morgenstern
a47864ecac Special type for unit triggerables 2023-02-26 21:52:18 +02:00
SomeTroglodyte
5d74689b19
Resilient UiElementDocsWriter (#8738) 2023-02-25 20:39:56 +02:00
vegeta1k95
c593056e42
Modding: allow mods to supply custom fonts (#8715)
* Modding: allow mods to supply custom fonts

* Cleanup

* Code cleanup

---------

Co-authored-by: vegeta1k95 <vfylfhby>
2023-02-21 23:09:11 +02:00
Yair Morgenstern
70f81d1657 chore: huge code reorg for ui classes
Separated into screens, popups, and UI components, with screen-specific components located together with their screens
2023-02-19 07:47:29 +02:00
vegeta1k95
ec2be2ceca Fix Desktop window borders 2023-02-17 17:24:59 +01:00
Yair Morgenstern
e8f54cc2f5 chore: File reorg 2023-01-18 15:25:25 +02:00
Yair Morgenstern
be161d8839 Better docs for Trigger Conditions 2023-01-16 23:13:08 +02:00
vegeta1k95
0aa7c0e79b
Added gradle task of Atlas texture packing for Android build (#8208)
* Added gradle task of Atlas texture packing for Android build

* ImagePackers check also for creation date

Co-authored-by: tunerzinc@gmail.com <vfylfhby>
2022-12-23 14:49:08 +02:00
Yair Morgenstern
454f999948 Resolved #8090 - Replaces misunderstood 'virtual resolutions' with more intuitive 'screen size' 2022-12-05 18:56:47 +02:00
Yair Morgenstern
c3fd948efe Max screen size takes Windows taskbar into account - see #8091 2022-12-05 18:39:01 +02:00
Leonard Günther
99b6a2254d
Changes to moddable UI (#8055)
* 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

* Added clear color to skin config

to support picker screen backgrounds

* Removed deprecated functions in ImageGetter

* Fixed lowercase ui element names

they should always be UpperCamelCase to be consistent

* Added UiElementDocsWriter

to modify the docs for UI elements automatically

* Added default shape to UiElementsDocsWriter.kt

* Revert unintended merge errors

* Rerun file auto generation
2022-11-27 19:14:56 +02:00
Yair Morgenstern
f04297acfd Removed use of Anuken packr, removing windows32 builds. 2022-10-12 23:39:57 +03:00
Leonard Günther
d05b3d376b
Moddable UI skins (#7804)
* Added SkinStrings and SkinConfig

TODO SkinCache

* Deprecated all old ui background getters

* Added SkinCache

for SkinConfigs to take effect

* Modable or moddable? idk ¯\_(ツ)_/¯

* Added separate alpha to config
2022-09-19 16:13:09 +03:00
Yair Morgenstern
1256724ee3
Desktop settings initialize to fullscreen (#7821) 2022-09-19 16:12:49 +03:00
Yair Morgenstern
8fec196db1 Got rid of uppercase C in Unciv in ALL places! 2022-09-12 23:26:28 +03:00
nacro711072
3202239129
JvmArg not work for mac desktop:run. (#7681)
* fix build bug.

* add package gdx-lwjgl3-glfw-awt-macos for mac only.

* use library with non-specify-platform.
2022-08-28 23:24:54 +03:00
Yair Morgenstern
c4747524d4
Disabled packing base images when running from JAR (#7478) 2022-08-04 10:35:01 +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
alexban011
51ba657b75
Added option to select font size (#7238) 2022-06-25 13:46:12 +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
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
9bd8750739
Refactor: Consistent & correct usage of coroutines (#7077)
* Refactor: Consistent usage of coroutines

* Add usage comments to the different threads

* Refactor: Properly separate crash handling into its platform-specific parts

* Fix autoSave never finishing

* Correctly handle coroutines when the GL thread is not accepting runnables anymore

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
2022-06-12 00:13:49 +03:00
Timo T
9008d242a3
Refactor: Change UncivGame.worldScreen and UncivGame.gameInfo to be of nullable type (#7114)
* Refactor: Make Popups work on Stages instead of BaseScreens

* Refactor: Change UncivGame.worldScreen and UncivGame.gameInfo to be of nullable type

* Fix "Resume" game loading not fully handling exceptions

* Fix one missed refactoring

* Refactor: remove useless postRunnable
2022-06-11 22:14:44 +03:00
Timo T
1abc65163d
Fix multiplayer sometimes duplicating games (#6999)
* Fix multiplayer sometimes duplicating games

* Fix test compilation
2022-06-01 22:24:44 +03:00
SomeTroglodyte
1b008905f6
Save and load reorg and keyboard handling (#6929)
* Load and Save Game Screens rework - Linting

* Load and Save Game Screens rework - Modularize and Keyboard

* Load and Save Game Screens rework - error handling

* Load and Save Game Screens rework - Move other save/load code

* Load and Save Game Screens rework - More Keyboard

* Load and Save Game Screens rework - Increase clipboard limit

* Load and Save Game Screens rework - Post-merge patch

* Load and Save Game Screens rework - Home, End, harden

* Load and Save Game Screens rework - Post-merge patch again

* Load and Save Game Screens rework - reviews
2022-05-31 16:31:19 +03:00
Timo T
3a03799074
Refactor: Extract all cross-platform code from CustomSaveLocationHelpers into core module (#6962)
* Also fixes the GameInfo.customSaveLocation to work for Android
2022-05-27 15:53:18 +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
b59b890ced
Fix multiplayer turn check worker exception (#6915) 2022-05-23 10:48:08 +03: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
3d6a01d633
Build warnings cleanup (#6827) 2022-05-19 02:12:18 +02:00
Timo T
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
Timo T
68a0e25c9e
Fix uniques.md being generated with wrong line endings (#6825)
In the repository, this file definitely has Unix line endings (\n). So generating it with \r\n causes it to always show changes, even though there aren't any
2022-05-16 09:50:38 +03: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
alexban011
dc8dadfcab
Fixed proxy issues when starting a new multiplayer game (#6757)
* vpn/proxy issues when creating new mp game

replaced redundant ping with opening a connection to dropbox to fix the proxy issue

* updated error message to include dropbox

* check multiplayerServer url if the user is playing on it

* use `https://content.dropboxapi.com` instead of `https://www.dropbox.com`

* fixed proxy issues on android

if connected to proxy but no internet access it will freeze for a couple seconds (until it finishes the for loop) but it works

* forgot to add the imports

* removed android sdk network check to fix proxy issues

* check for internet now separate from check for multiplayerServer
removed frunctions from PlatformSpecificHelpers__

* added improvements made by touhidurrr

* removed unused imports and replaced setter with property access syntax

Co-authored-by: Md. Touhidur Rahman <46617994+touhidurrr@users.noreply.github.com>
2022-05-11 16:58:20 +03:00
SomeTroglodyte
eb5e8ae226
Switchable gzipping of saved games (#6735)
* Switchable gzipping of saved games

* Switchable gzipping of saved games - consensus says default off
2022-05-11 16:23:11 +03:00
SomeTroglodyte
4290373cf1
Move UncivServer to own module (and jar) (#6468)
* Move UncivServer to own module (and jar)

* UncivServer isalive logged

* Separate UncivServer - some wiki hints

* Separate UncivServer - how to build UncivServer.jar

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
2022-05-08 21:22:43 +03:00
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
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
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
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
SomeTroglodyte
23c23e5566
Unique docs writer makeover (#6516)
* Comments to 'link' implementation (matchFilter) to UniqueParameterType

* Comments to 'link' UniqueParameterType to implementation (matchFilter)

* Fix two mistakes in UniqueParameterType

* Make "and" filter logic for MapUnit and BaseUnit modular, fix mistake

* Make UnitMovementMemory immutable and without lateinit

* Keep UniqueType comment promise that instances can override parameter types

* Reorg UniqueDocsWriter so UniqueParameterType-specific text is moved to the enum

Also some minor improvements - e.g. abbreviations sorted & consistent punctuation, less memory allocations, a/b/c type params get an example,...

* New abilities for UniqueDocsWriter concerning UniqueTarget and inheritsFrom (initially deactivated)

* Actually implement the wish for distinction between absolute and relative amounts

* Change UniqueParameterType.UnitName.docExample to Xander's choice
2022-04-24 22:47:19 +03:00
Xander Lenstra
0a5fc3cf33
Fixed the internal name & parameter of a unique (#6577) 2022-04-20 17:02:31 +03:00