Commit Graph

44 Commits

Author SHA1 Message Date
a7afc0718c Unit swapping (#4049)
* Added an icon for unit swapping

* Implemented unit swapping

In the original Civ V, unit swapping is a supported mechanic.
If you try to move a unit to a tile with another of your units, and both
units have enough movement points left to reach the other's tile, they
will swap places. They will consume only the movement points needed to
reach the other's tile in this way.

This change implements unit swapping for Unciv.

To prevent all kinds of problems from arising with automatic unit
movement, unit swapping can only be done explicitly. This also means
that it can only be done if the unit-swap movement is possible in a
single turn. It is however not limited to adjacent units.

Because Unciv supports mobile devices, there is in general no separation
between a unit-selection click and a movement click. Clicking on another
unit while a unit is selected simply selects that other unit. Because we
do not want to make it more difficult to select other units in this way,
unit swapping is implemented as a separate "movement mode": to toggle
this mode on or off, the new unit action "Swap units" must be used.
Newly selected units still always start in the normal movement mode.

In the unit-swap movement mode, the possible swap tiles are highlighted
instead of the possible movement and attack tiles. Clicking on a
highlighted tile will display a swap button, similar to the movement
button, or instantly perform the swap if single-click-movement is
enabled. This new behavior overrides the selection of the unit on the
target tile: if the user wants to select the unit instead, they have to
exit the unit-swapping mode first.

The swapping code is robust, it can even handle swaps that involve a
paradrop!

An option to always swap-move when an eligible tile is clicked instead
of requiring the unit-swapping mode, similar to the existing
single-click-movement option, could perhaps be added in later.

* Added some comments to existing movement functions

* Fixed a silly mistake

Fixed a silly mistake which caused the unit-swapping eligibility
detection to sometimes remove units from the world.

* Removed some unneeded code

* Fixed movement buttons not showing with world wrap

Fixed a bug where the "move here" and "swap with" buttons would only
show on the leftmost copy of the world when world wrap was enabled.

* Made the swap action only display if usable

Made the unit swapping button only display if there is at least one
possible swap movement.
2021-06-06 22:56:25 +03:00
d7941924be Better camera square 2021-05-28 14:53:21 +03:00
a25777f380 Overview screen category decoration + key hint (#3872)
* OverviewScreen: Category buttons decorated / key indicator

* OverviewScreen: Category buttons decorated / key indicator: Images
2021-05-04 12:10:34 +03:00
807444d2c5 Replace padding with leftAndRightPadding & topAndBottomPadding in TileGroupMap (#3742)
* Replace padding with leftAndRightPadding & topAndBottomPadding in class TileGroupMap, edit MainMenuScreen

* Remove TableBackground.png
2021-03-29 18:21:31 +03:00
5a5d0a980f Removed ALL color-based notifications! 2021-03-21 00:28:58 +02:00
d4b19a7bb3 Many notification conversions 2021-03-20 23:49:33 +02:00
50d5b0d7ce Added specific icons to certain notification types 2021-03-19 11:26:54 +02:00
1e981abe53 Display scroll position on minimap (#3593) 2021-02-14 11:48:57 +02:00
adaee7e7ab City State quests (#3183)
* City State quests

* Flag to log two civ ever been friends
* Utility functions in GameInfo
* Created Diplomacy Action for notifications
* Utility functions for map
* Can be specified a custom color for surroundWithCircle
* Translation placeholder utility
* Added Quest model
* Utility function: number of researched technologies

* Image atlas rebuilt

* Localization

* Updated DiplomaticFlags and added EverBeenFriends

Slightly reworked nextTurnFlags() for code clarity and introduced the new flag EverBeenFriends that is set as soon as two civilizations are at least friends. It never expires.

* Removed quests not implemented yet from json
2020-09-29 23:26:50 +03:00
9d951835d1 UI Update (#3102)
* Add "Load game" in WorldscreenMenuPopup

* UI Update

* Fix the Ottomans uniques, edit Tech description
2020-09-10 19:25:56 +03:00
3eb9b36550 Restored techButton visualization 2020-09-03 12:37:04 +03:00
def96071e7 Use NinePatch in getRoundedEdgeTableBackground (#3080) 2020-09-02 20:51:21 +03:00
a253a97940 Added Unzip functionality - we should soon be ready for mod management from within the game! 2020-08-25 16:38:55 +03:00
c51879cc5f OptionsPopup with two experimental switches: Spectator mode, Extended Map editor. (#2834) 2020-07-12 12:59:32 +03:00
aa677042dd New icon for "Load Scenario" (#2768)
* New icon for "Load Scenario"

* Javadoc comments
2020-06-25 22:30:39 +03:00
d511899ed8 Resolved #2613 - added a close button to the Civ-picking popup in the New Game screen 2020-06-03 19:09:48 +03:00
688b780b14 Added a repeating baclground to the menu screen 2020-04-21 23:53:33 +03:00
5aae57d848 Added icons to the main menu, looks much better! 2020-04-21 14:18:38 +03:00
e4fab26b43 Display the crosshair in alternate color for distant targets (#2347) 2020-04-07 11:37:14 +03:00
378f56207c Resolved #1779 - Can now lock worked tiles to prevent them from being unassigned 2020-03-29 12:42:58 +03:00
0cf27789e9 Borders made of oriented triangles rather than circles (#2104) 2020-03-08 20:36:50 +02:00
a1b03849ec Fix city screen (#1657)
* Last CityScreen fix

* Atlas & Translations
2020-01-11 22:46:17 +02:00
12a98aa4bb City construction queue (#1479)
* Construction Queue

* Added constructionQueue in addition to currentConstruction: if currentConstruction is done, next construction from Queue is started; if Queue is empty invoke ConstructionAutomation
* Queue utility methods: add, remove, higher prio, lower prio
* Icons to move constructions in queue
* Top left city stats moved to top right panel
* Added current construction and queue construction to top left
* Extended selected construction (containing description) moved to bottom right, it is now displayed alternatively to selected tile

Rework

* Max queue size, cannot change queue in puppet city or in other player turn

* Queue and current construction reset on puppeting city

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
2020-01-09 20:58:15 +02:00
52111430ef Add close icon for the UnitTable (#1472) 2019-12-17 21:44:20 +02:00
e1350cdb05 separated whiteDot for images from TableBackground for backgrounds 2019-11-08 15:42:19 +02:00
f6d2143ff6 Fixed weird resizing bug - #1304, thanks @ninjatao! 2019-11-06 19:25:02 +02:00
a1f5690e41 Added Puppet icon - some reorgnizing still needs to be done in regards to puppet vs annex 2019-09-23 10:46:51 +03:00
185ec10f10 Can now see when city contains air units 2019-07-03 23:32:17 +03:00
227f6627be Resolved #883 - Added Civilization icons 2019-06-19 18:43:25 +03:00
fd4123e15f City state icon in city button now visible and colored according to city-state color 2019-05-20 22:22:16 +03:00
1434ca3f30 Update city-state related icons and popups. 2019-05-08 13:32:23 +03:00
973cfd50a2 Added different city tiles for different locations 2019-03-20 15:15:55 +02:00
d6f3ab3f40 Fantasy hex tileset is go! 2019-03-19 18:35:58 +02:00
c282ffb423 Resolved #410 - land units on lake aren't shown as embarked 2019-01-08 15:43:54 +02:00
eeb494364b Resolved #407 - Add pillaging terrain improvements 2019-01-07 21:56:02 +02:00
5b66f8f0f7 Organized Unit Table UI 2018-11-23 14:36:22 +02:00
a7694867d0 Population is assigned/unassigned in cities by clicking on the tile, not just the population symbol 2018-11-06 22:49:40 +02:00
937687a0f4 Steam Power and Astronomy now increase embarked units' movement 2018-11-04 13:07:03 +02:00
fb2538524a Tile info now dispays which civ each unit belongs to
Embarked units marked on map with different shaped background
2018-11-04 13:06:16 +02:00
dea7775be5 Added Optics and Lighthouse 2018-10-16 21:13:29 +03:00
c1e6c8e894 Added "Sleep" action for units that can't fortify
Added tutorial after constructing the apollo program
2018-09-16 13:58:35 +03:00
40db822a79 Finished off promotions, adding Formation I, Formation II, Blitz, Logistics, Mobility, and Volley promotions 2018-08-28 12:12:14 +03:00
5d4c8a618d Replaced all resource and improvement icons!
AI disables city raze on capture/buying cities
2018-08-28 10:35:56 +03:00
fee0b718ec Shrunk game size by 15% by including the images only when packed 2018-08-13 08:56:15 +03:00