diff --git a/android/Images/TileIcons/Buy.png b/android/Images/TileIcons/Buy.png new file mode 100644 index 0000000000..d561171ff1 Binary files /dev/null and b/android/Images/TileIcons/Buy.png differ diff --git a/android/Images/TileIcons/CityCenter.png b/android/Images/TileIcons/CityCenter.png new file mode 100644 index 0000000000..c3b2c60399 Binary files /dev/null and b/android/Images/TileIcons/CityCenter.png differ diff --git a/android/Images/OtherIcons/Lock.png b/android/Images/TileIcons/Locked.png similarity index 100% rename from android/Images/OtherIcons/Lock.png rename to android/Images/TileIcons/Locked.png diff --git a/android/Images/TileIcons/NotWorked.png b/android/Images/TileIcons/NotWorked.png new file mode 100644 index 0000000000..9881a70501 Binary files /dev/null and b/android/Images/TileIcons/NotWorked.png differ diff --git a/android/Images/TileIcons/Worked.png b/android/Images/TileIcons/Worked.png new file mode 100644 index 0000000000..c79311147e Binary files /dev/null and b/android/Images/TileIcons/Worked.png differ diff --git a/android/assets/game.atlas b/android/assets/game.atlas index 183884e0e5..496293c017 100644 --- a/android/assets/game.atlas +++ b/android/assets/game.atlas @@ -6,1309 +6,1337 @@ filter: MipMapLinearLinear, MipMapLinearLinear repeat: none CityStateIcons/Cultured rotate: false - xy: 406, 685 + xy: 622, 689 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 CityStateIcons/Maritime rotate: false - xy: 1270, 592 + xy: 1486, 596 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 CityStateIcons/Mercantile rotate: false - xy: 1486, 592 + xy: 1702, 596 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 CityStateIcons/Militaristic rotate: false - xy: 1594, 592 + xy: 1810, 596 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 CityStateIcons/Religious rotate: false - xy: 1546, 376 + xy: 1870, 380 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 EmojiIcons/Culture rotate: false - xy: 1572, 210 + xy: 1978, 422 size: 50, 50 orig: 50, 50 offset: 0, 0 index: -1 EmojiIcons/Faith rotate: false - xy: 1630, 210 + xy: 1978, 364 size: 50, 50 orig: 50, 50 offset: 0, 0 index: -1 EmojiIcons/Food rotate: false - xy: 1688, 210 + xy: 1978, 306 size: 50, 50 orig: 50, 50 offset: 0, 0 index: -1 EmojiIcons/Gold rotate: false - xy: 1746, 210 + xy: 1855, 33 size: 50, 50 orig: 50, 50 offset: 0, 0 index: -1 EmojiIcons/Great Artist rotate: false - xy: 1804, 210 + xy: 1978, 248 size: 50, 50 orig: 50, 50 offset: 0, 0 index: -1 EmojiIcons/Great Engineer rotate: false - xy: 1862, 210 + xy: 1963, 190 size: 50, 50 orig: 50, 50 offset: 0, 0 index: -1 EmojiIcons/Great General rotate: false - xy: 1920, 210 + xy: 1913, 33 size: 50, 50 orig: 50, 50 offset: 0, 0 index: -1 EmojiIcons/Great Merchant rotate: false - xy: 1978, 534 + xy: 1987, 862 size: 50, 50 orig: 50, 50 offset: 0, 0 index: -1 EmojiIcons/Great Scientist rotate: false - xy: 1978, 476 + xy: 1963, 132 size: 50, 50 orig: 50, 50 offset: 0, 0 index: -1 EmojiIcons/Happiness rotate: false - xy: 1978, 418 + xy: 1971, 74 size: 50, 50 orig: 50, 50 offset: 0, 0 index: -1 EmojiIcons/Production rotate: false - xy: 1481, 79 + xy: 112, 66 size: 50, 50 orig: 50, 50 offset: 0, 0 index: -1 EmojiIcons/Science rotate: false - xy: 1597, 152 + xy: 170, 66 size: 50, 50 orig: 50, 50 offset: 0, 0 index: -1 EmojiIcons/Turn rotate: false - xy: 1655, 94 + xy: 228, 66 size: 50, 50 orig: 50, 50 offset: 0, 0 index: -1 ImprovementIcons/Academy rotate: false - xy: 721, 916 + xy: 721, 920 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Ancient ruins rotate: false - xy: 937, 916 + xy: 937, 920 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Barbarian encampment rotate: false - xy: 1261, 916 + xy: 1261, 920 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Camp rotate: false - xy: 1369, 916 + xy: 1477, 920 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Cancel improvement order rotate: false - xy: 1477, 916 + xy: 1585, 920 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Stop rotate: false - xy: 1477, 916 + xy: 1585, 920 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Citadel rotate: false - xy: 1801, 916 + xy: 1909, 920 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/City center rotate: false - xy: 190, 560 + xy: 475, 797 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/City ruins rotate: false - xy: 475, 793 + xy: 583, 797 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Customs house rotate: false - xy: 514, 685 + xy: 691, 797 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Farm rotate: false - xy: 1447, 808 + xy: 1663, 812 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Fishing Boats rotate: false - xy: 1663, 808 + xy: 1879, 812 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Fort rotate: false - xy: 1879, 808 + xy: 838, 704 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Holy site rotate: false - xy: 1270, 700 + xy: 1486, 704 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Landmark rotate: false - xy: 1918, 700 + xy: 514, 581 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Lumber mill rotate: false - xy: 730, 577 + xy: 946, 596 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Manufactory rotate: false - xy: 946, 592 + xy: 1162, 596 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Mine rotate: false - xy: 1702, 592 + xy: 1918, 596 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Moai rotate: false - xy: 1810, 592 + xy: 358, 473 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Offshore Platform rotate: false - xy: 790, 469 + xy: 1114, 488 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Oil well rotate: false - xy: 1006, 484 + xy: 1330, 488 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Pasture rotate: false - xy: 1222, 484 + xy: 1546, 488 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Plantation rotate: false - xy: 358, 361 + xy: 682, 365 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Polder rotate: false - xy: 466, 361 + xy: 790, 365 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Quarry rotate: false - xy: 1006, 376 + xy: 1330, 380 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Railroad rotate: false - xy: 1438, 376 + xy: 1762, 380 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Remove Fallout rotate: false - xy: 1762, 376 + xy: 235, 240 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Remove Forest rotate: false - xy: 1870, 376 + xy: 343, 257 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Remove Jungle rotate: false - xy: 1870, 376 + xy: 343, 257 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Remove Marsh rotate: false - xy: 235, 237 + xy: 559, 258 size: 100, 99 orig: 100, 99 offset: 0, 0 index: -1 ImprovementIcons/Remove Railroad rotate: false - xy: 343, 253 + xy: 667, 257 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Remove Road rotate: false - xy: 451, 253 + xy: 775, 257 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Repair rotate: false - xy: 559, 253 + xy: 343, 149 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Road rotate: false - xy: 343, 145 + xy: 667, 149 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Terrace farm rotate: false - xy: 1762, 268 + xy: 1639, 164 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ImprovementIcons/Trading post rotate: false - xy: 883, 160 + xy: 1855, 164 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 NotificationIcons/EnhanceReligion rotate: false - xy: 1123, 808 + xy: 1339, 812 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 NotificationIcons/FoundPantheon rotate: false - xy: 1123, 808 + xy: 1339, 812 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 NotificationIcons/FoundReligion rotate: false - xy: 1123, 808 + xy: 1339, 812 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 NotificationIcons/ReformReligion rotate: false - xy: 1123, 808 + xy: 1339, 812 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 StatIcons/Faith rotate: false - xy: 1123, 808 - size: 100, 100 - orig: 100, 100 - offset: 0, 0 - index: -1 -NotificationIcons/PickConstruction - rotate: false - xy: 1654, 484 - size: 100, 100 - orig: 100, 100 - offset: 0, 0 - index: -1 -StatIcons/Production - rotate: false - xy: 1654, 484 - size: 100, 100 - orig: 100, 100 - offset: 0, 0 - index: -1 -NotificationIcons/PickPolicy - rotate: false - xy: 406, 797 - size: 33, 33 - orig: 33, 33 - offset: 0, 0 - index: -1 -NotificationIcons/PickTech - rotate: false - xy: 1762, 484 - size: 100, 100 - orig: 100, 100 - offset: 0, 0 - index: -1 -StatIcons/Science - rotate: false - xy: 1762, 484 - size: 100, 100 - orig: 100, 100 - offset: 0, 0 - index: -1 -OtherIcons/AirSweep - rotate: false - xy: 829, 916 - size: 100, 100 - orig: 100, 100 - offset: 0, 0 - index: -1 -OtherIcons/Aircraft - rotate: false - xy: 298, 564 - size: 50, 50 - orig: 50, 50 - offset: 0, 0 - index: -1 -OtherIcons/ArrowRight - rotate: false - xy: 1423, 137 - size: 50, 50 - orig: 50, 50 - offset: 0, 0 - index: -1 -NotificationIcons/MoveAutomatedUnits - rotate: false - xy: 1423, 137 - size: 50, 50 - orig: 50, 50 - offset: 0, 0 - index: -1 -NotificationIcons/NextUnit - rotate: false - xy: 1423, 137 - size: 50, 50 - orig: 50, 50 - offset: 0, 0 - index: -1 -StatIcons/Movement - rotate: false - xy: 1423, 137 - size: 50, 50 - orig: 50, 50 - offset: 0, 0 - index: -1 -OtherIcons/BackArrow - rotate: false - xy: 1514, 210 - size: 50, 50 - orig: 50, 50 - offset: 0, 0 - index: -1 -OtherIcons/Banner - rotate: false - xy: 1153, 916 - size: 100, 100 - orig: 100, 100 - offset: 0, 0 - index: -1 -OtherIcons/Camera - rotate: false - xy: 2017, 991 - size: 25, 25 - orig: 25, 25 - offset: 0, 0 - index: -1 -OtherIcons/Capital - rotate: false - xy: 4, 220 - size: 107, 101 - orig: 107, 101 - offset: 0, 0 - index: -1 -OtherIcons/Checkmark - rotate: false - xy: 1693, 916 - size: 100, 100 - orig: 100, 100 - offset: 0, 0 - index: -1 -NotificationIcons/NextTurn - rotate: false - xy: 1693, 916 - size: 100, 100 - orig: 100, 100 - offset: 0, 0 - index: -1 -OtherIcons/Circle - rotate: false - xy: 4, 590 - size: 178, 178 - orig: 178, 178 - offset: 0, 0 - index: -1 -OtherIcons/Cities - rotate: false - xy: 1909, 916 - size: 100, 100 - orig: 100, 100 - offset: 0, 0 - index: -1 -OtherIcons/CityState - rotate: false - xy: 1423, 79 - size: 50, 50 - orig: 50, 50 - offset: 0, 0 - index: -1 -OtherIcons/Close - rotate: false - xy: 583, 793 - size: 100, 100 - orig: 100, 100 - offset: 0, 0 - index: -1 -OtherIcons/CrosshairB - rotate: false - xy: 298, 730 - size: 100, 100 - orig: 100, 100 - offset: 0, 0 - index: -1 -OtherIcons/Diplomacy - rotate: false - xy: 691, 793 - size: 100, 100 - orig: 100, 100 - offset: 0, 0 - index: -1 -OtherIcons/DiplomacyW - rotate: false - xy: 799, 808 - size: 100, 100 - orig: 100, 100 - offset: 0, 0 - index: -1 -OtherIcons/DisbandUnit - rotate: false - xy: 907, 808 - size: 100, 100 - orig: 100, 100 - offset: 0, 0 - index: -1 -OtherIcons/ExclamationMark - rotate: false - xy: 1231, 808 - size: 100, 100 - orig: 100, 100 - offset: 0, 0 - index: -1 -OtherIcons/Fire - rotate: false - xy: 475, 901 - size: 115, 115 - orig: 115, 115 - offset: 0, 0 - index: -1 -OtherIcons/Hexagon - rotate: false - xy: 4, 776 - size: 277, 240 - orig: 277, 240 - offset: 0, 0 - index: -1 -OtherIcons/Improvements - rotate: false - xy: 1978, 360 - size: 50, 50 - orig: 50, 50 - offset: 0, 0 - index: -1 -OtherIcons/Link - rotate: false - xy: 1978, 244 - size: 50, 50 - orig: 50, 50 - offset: 0, 0 - index: -1 -OtherIcons/Load - rotate: false - xy: 406, 577 - size: 100, 100 - orig: 100, 100 - offset: 0, 0 - index: -1 -OtherIcons/Loading - rotate: false - xy: 514, 577 + xy: 1339, 812 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 NotificationIcons/Loading rotate: false - xy: 514, 577 + xy: 730, 581 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 NotificationIcons/Working rotate: false - xy: 514, 577 + xy: 730, 581 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -OtherIcons/Lock +OtherIcons/Loading rotate: false - xy: 622, 577 + xy: 730, 581 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 +NotificationIcons/PickConstruction + rotate: false + xy: 358, 365 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 +StatIcons/Production + rotate: false + xy: 358, 365 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 +NotificationIcons/PickPolicy + rotate: false + xy: 406, 801 + size: 33, 33 + orig: 33, 33 + offset: 0, 0 + index: -1 +NotificationIcons/PickTech + rotate: false + xy: 466, 365 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 +StatIcons/Science + rotate: false + xy: 466, 365 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 +OtherIcons/AirSweep + rotate: false + xy: 829, 920 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 +OtherIcons/Aircraft + rotate: false + xy: 1207, 4 + size: 50, 50 + orig: 50, 50 + offset: 0, 0 + index: -1 +OtherIcons/ArrowRight + rotate: false + xy: 298, 568 + size: 50, 50 + orig: 50, 50 + offset: 0, 0 + index: -1 +NotificationIcons/MoveAutomatedUnits + rotate: false + xy: 298, 568 + size: 50, 50 + orig: 50, 50 + offset: 0, 0 + index: -1 +NotificationIcons/NextUnit + rotate: false + xy: 298, 568 + size: 50, 50 + orig: 50, 50 + offset: 0, 0 + index: -1 +StatIcons/Movement + rotate: false + xy: 298, 568 + size: 50, 50 + orig: 50, 50 + offset: 0, 0 + index: -1 +OtherIcons/BackArrow + rotate: false + xy: 1978, 538 + size: 50, 50 + orig: 50, 50 + offset: 0, 0 + index: -1 +OtherIcons/Banner + rotate: false + xy: 1153, 920 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 +OtherIcons/Camera + rotate: false + xy: 1265, 29 + size: 25, 25 + orig: 25, 25 + offset: 0, 0 + index: -1 +OtherIcons/Capital + rotate: false + xy: 4, 224 + size: 107, 101 + orig: 107, 101 + offset: 0, 0 + index: -1 +OtherIcons/Checkmark + rotate: false + xy: 1801, 920 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 +NotificationIcons/NextTurn + rotate: false + xy: 1801, 920 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 +OtherIcons/Circle + rotate: false + xy: 4, 594 + size: 178, 178 + orig: 178, 178 + offset: 0, 0 + index: -1 +OtherIcons/Cities + rotate: false + xy: 190, 672 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 +OtherIcons/CityState + rotate: false + xy: 1978, 480 + size: 50, 50 + orig: 50, 50 + offset: 0, 0 + index: -1 +OtherIcons/Close + rotate: false + xy: 127, 348 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 +OtherIcons/CrosshairB + rotate: false + xy: 406, 689 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 +OtherIcons/Diplomacy + rotate: false + xy: 907, 812 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 +OtherIcons/DiplomacyW + rotate: false + xy: 1015, 812 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 +OtherIcons/DisbandUnit + rotate: false + xy: 1123, 812 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 +OtherIcons/ExclamationMark + rotate: false + xy: 1447, 812 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 +OtherIcons/Fire + rotate: false + xy: 475, 905 + size: 115, 115 + orig: 115, 115 + offset: 0, 0 + index: -1 +OtherIcons/Hexagon + rotate: false + xy: 4, 780 + size: 277, 240 + orig: 277, 240 + offset: 0, 0 + index: -1 +OtherIcons/Improvements + rotate: false + xy: 1971, 16 + size: 50, 50 + orig: 50, 50 + offset: 0, 0 + index: -1 +OtherIcons/Link + rotate: false + xy: 177, 182 + size: 50, 50 + orig: 50, 50 + offset: 0, 0 + index: -1 +OtherIcons/Load + rotate: false + xy: 622, 581 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/LockSmall rotate: false - xy: 1978, 186 + xy: 235, 182 size: 50, 50 orig: 50, 50 offset: 0, 0 index: -1 OtherIcons/MapEditor rotate: false - xy: 1054, 592 + xy: 1270, 596 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/MenuIcon rotate: false - xy: 1378, 592 + xy: 1594, 596 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Mods rotate: false - xy: 1918, 592 + xy: 466, 473 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Multiplayer rotate: false - xy: 358, 469 + xy: 574, 473 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/NationSwap rotate: false - xy: 466, 469 + xy: 682, 473 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Nations rotate: false - xy: 1481, 137 + xy: 112, 124 size: 50, 50 orig: 50, 50 offset: 0, 0 index: -1 OtherIcons/New rotate: false - xy: 574, 469 + xy: 790, 473 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Notifications rotate: false - xy: 682, 469 + xy: 1006, 488 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Options rotate: false - xy: 1114, 484 + xy: 1438, 488 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Pencil rotate: false - xy: 1438, 484 + xy: 1762, 488 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Pentagon rotate: false - xy: 1546, 484 + xy: 1870, 488 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Pillage rotate: false - xy: 1870, 484 + xy: 574, 365 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Politics rotate: false - xy: 574, 361 + xy: 898, 380 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 NotificationIcons/WorldCongressVote rotate: false - xy: 574, 361 + xy: 898, 380 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Present rotate: false - xy: 898, 376 + xy: 1222, 380 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Puppet rotate: false - xy: 4, 329 + xy: 4, 333 size: 115, 115 orig: 115, 115 offset: 0, 0 index: -1 OtherIcons/Quest rotate: false - xy: 1114, 376 + xy: 1438, 380 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Question rotate: false - xy: 1222, 376 + xy: 1546, 380 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Quickstart rotate: false - xy: 1330, 376 + xy: 1654, 380 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Remove Heresy rotate: false - xy: 127, 236 + xy: 451, 257 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Resources rotate: false - xy: 667, 253 + xy: 451, 149 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Resume rotate: false - xy: 775, 253 + xy: 559, 150 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Search rotate: false - xy: 559, 145 + xy: 898, 272 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/SecretOptions rotate: false - xy: 667, 145 + xy: 1006, 272 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Settings rotate: false - xy: 775, 145 + xy: 1114, 272 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Shield rotate: false - xy: 343, 37 + xy: 1330, 272 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Sleep rotate: false - xy: 667, 37 + xy: 1654, 272 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Speaker rotate: false - xy: 775, 37 + xy: 1762, 272 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Spy rotate: false - xy: 1114, 268 + xy: 991, 164 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Spy_White rotate: false - xy: 1222, 268 + xy: 1099, 164 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Star rotate: false - xy: 1330, 274 + xy: 1207, 170 size: 100, 94 orig: 100, 94 offset: 0, 0 index: -1 OtherIcons/Swap rotate: false - xy: 1654, 268 + xy: 1531, 164 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Terrains rotate: false - xy: 1655, 152 + xy: 170, 8 size: 50, 50 orig: 50, 50 offset: 0, 0 index: -1 OtherIcons/Timer rotate: false - xy: 1870, 268 + xy: 1747, 164 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Triangle rotate: false - xy: 289, 838 + xy: 289, 842 size: 178, 178 orig: 178, 178 offset: 0, 0 index: -1 OtherIcons/Turn right rotate: false - xy: 991, 160 + xy: 991, 56 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Tyrannosaurus rotate: false - xy: 991, 52 + xy: 1099, 56 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/WLTKD rotate: false - xy: 1423, 195 + xy: 1855, 91 size: 83, 65 orig: 83, 65 offset: 0, 0 index: -1 OtherIcons/Wait rotate: false - xy: 1099, 52 + xy: 1315, 56 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/Wonders rotate: false - xy: 1315, 52 + xy: 1747, 56 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 OtherIcons/whiteDot rotate: false - xy: 289, 829 + xy: 289, 833 size: 1, 1 orig: 1, 1 offset: 0, 0 index: -1 ResourceIcons/Aluminum rotate: false - xy: 4, 4 + xy: 4, 8 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Bananas rotate: false - xy: 1045, 916 + xy: 1045, 920 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Cattle rotate: false - xy: 1585, 916 + xy: 1693, 920 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Citrus rotate: false - xy: 190, 668 + xy: 190, 564 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Coal rotate: false - xy: 142, 452 + xy: 250, 456 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Copper rotate: false - xy: 127, 344 + xy: 235, 348 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Cotton rotate: false - xy: 250, 452 + xy: 298, 734 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Crab rotate: false - xy: 235, 344 + xy: 298, 626 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Deer rotate: false - xy: 622, 685 + xy: 799, 812 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Dyes rotate: false - xy: 1015, 808 + xy: 1231, 812 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Fish rotate: false - xy: 1555, 808 + xy: 1771, 812 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Furs rotate: false - xy: 730, 685 + xy: 946, 704 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Gems rotate: false - xy: 838, 700 + xy: 1054, 704 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Gold Ore rotate: false - xy: 1054, 700 + xy: 1270, 704 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Horses rotate: false - xy: 1378, 700 + xy: 1594, 704 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Incense rotate: false - xy: 1486, 700 + xy: 1702, 704 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Iron rotate: false - xy: 1594, 700 + xy: 1810, 704 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Ivory rotate: false - xy: 1702, 700 + xy: 1918, 704 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Jewelry rotate: false - xy: 1810, 700 + xy: 406, 581 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Marble rotate: false - xy: 1162, 592 + xy: 1378, 596 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Oil rotate: false - xy: 898, 484 + xy: 1222, 488 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Pearls rotate: false - xy: 1330, 484 + xy: 1654, 488 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Porcelain rotate: false - xy: 790, 361 + xy: 1114, 380 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Salt rotate: false - xy: 451, 145 + xy: 775, 149 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Sheep rotate: false - xy: 235, 129 + xy: 1222, 272 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Silk rotate: false - xy: 451, 37 + xy: 1438, 272 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Silver rotate: false - xy: 559, 37 + xy: 1546, 272 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Spices rotate: false - xy: 1006, 268 + xy: 883, 164 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Stone rotate: false - xy: 1438, 268 + xy: 1315, 164 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Sugar rotate: false - xy: 1546, 268 + xy: 1423, 164 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Truffles rotate: false - xy: 883, 52 + xy: 883, 56 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Uranium rotate: false - xy: 1099, 160 + xy: 1207, 62 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Whales rotate: false - xy: 1207, 160 + xy: 1423, 56 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Wheat rotate: false - xy: 1207, 52 + xy: 1531, 56 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 ResourceIcons/Wine rotate: false - xy: 1315, 160 + xy: 1639, 56 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 StatIcons/Acquire rotate: false - xy: 4, 112 + xy: 4, 116 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 StatIcons/CityConnection rotate: false - xy: 4, 452 + xy: 4, 456 size: 130, 130 orig: 130, 130 offset: 0, 0 index: -1 StatIcons/Culture rotate: false - xy: 298, 622 + xy: 514, 689 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 StatIcons/Food rotate: false - xy: 1771, 808 + xy: 730, 689 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 StatIcons/Gold rotate: false - xy: 946, 700 + xy: 1162, 704 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 StatIcons/Happiness rotate: false - xy: 1162, 700 + xy: 1378, 704 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 StatIcons/InterceptRange rotate: false - xy: 1978, 302 + xy: 119, 182 size: 50, 50 orig: 50, 50 offset: 0, 0 index: -1 StatIcons/Malcontent rotate: false - xy: 838, 592 + xy: 1054, 596 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 StatIcons/Population rotate: false - xy: 682, 361 + xy: 1006, 380 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 +TileIcons/Worked + rotate: false + xy: 1006, 380 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 StatIcons/Range rotate: false - xy: 1539, 152 + xy: 170, 124 size: 50, 50 orig: 50, 50 offset: 0, 0 index: -1 StatIcons/RangedStrength rotate: false - xy: 1539, 94 + xy: 112, 8 size: 50, 50 orig: 50, 50 offset: 0, 0 index: -1 StatIcons/ReligiousStrength rotate: false - xy: 1654, 376 + xy: 127, 240 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 StatIcons/Resistance rotate: false - xy: 598, 901 + xy: 598, 905 size: 115, 115 orig: 115, 115 offset: 0, 0 index: -1 StatIcons/Specialist rotate: false - xy: 898, 268 + xy: 1870, 272 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 StatIcons/Strength rotate: false - xy: 1597, 94 + xy: 228, 124 size: 50, 50 orig: 50, 50 offset: 0, 0 index: -1 -UniqueIcons/Fallback +TileIcons/Buy rotate: false - xy: 1339, 808 + xy: 1369, 920 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 +TileIcons/CityCenter + rotate: false + xy: 142, 456 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 +TileIcons/Locked + rotate: false + xy: 838, 596 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 +TileIcons/NotWorked + rotate: false + xy: 898, 488 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 +UniqueIcons/Fallback + rotate: false + xy: 1555, 812 size: 100, 100 orig: 100, 100 offset: 0, 0 diff --git a/android/assets/game.png b/android/assets/game.png index 524661a6ce..a42a3c6b4e 100644 Binary files a/android/assets/game.png and b/android/assets/game.png differ diff --git a/core/src/com/unciv/logic/city/managers/CityExpansionManager.kt b/core/src/com/unciv/logic/city/managers/CityExpansionManager.kt index e79a5c92f4..3de51bb992 100644 --- a/core/src/com/unciv/logic/city/managers/CityExpansionManager.kt +++ b/core/src/com/unciv/logic/city/managers/CityExpansionManager.kt @@ -55,6 +55,15 @@ class CityExpansionManager : IsPartOfGameInfoSerialization { return cultureToNextTile.roundToInt() } + fun canBuyTile(tile: Tile): Boolean { + return when { + city.isPuppet -> false + tile.getOwner() != null -> false + tile !in city.tilesInRange -> false + else -> tile.neighbors.any { it.getCity() == city } + } + } + fun buyTile(tile: Tile) { val goldCost = getGoldCostOfTile(tile) diff --git a/core/src/com/unciv/logic/civilization/Civilization.kt b/core/src/com/unciv/logic/civilization/Civilization.kt index a412a35c81..2b1dc03721 100644 --- a/core/src/com/unciv/logic/civilization/Civilization.kt +++ b/core/src/com/unciv/logic/civilization/Civilization.kt @@ -697,6 +697,14 @@ class Civilization : IsPartOfGameInfoSerialization { } } + fun hasGoldToBuy(price: Int): Boolean { + return when { + gameInfo.gameParameters.godMode -> true + price == 0 -> true + else -> gold >= price + } + } + fun addStats(stats: Stats){ for ((stat, amount) in stats) addStat(stat, amount.toInt()) } diff --git a/core/src/com/unciv/ui/cityscreen/CityMapHolder.kt b/core/src/com/unciv/ui/cityscreen/CityMapHolder.kt new file mode 100644 index 0000000000..6fc6b37680 --- /dev/null +++ b/core/src/com/unciv/ui/cityscreen/CityMapHolder.kt @@ -0,0 +1,29 @@ +package com.unciv.ui.cityscreen + +import com.unciv.ui.UncivStage +import com.unciv.ui.tilegroups.TileGroupMap +import com.unciv.ui.utils.ZoomableScrollPane + +class CityMapHolder : ZoomableScrollPane(20f, 20f) { + + init { + setupZoomPanListeners() + } + + private fun setupZoomPanListeners() { + + fun setActHit() { + val isEnabled = !isZooming() && !isPanning + (stage as UncivStage).performPointerEnterExitEvents = isEnabled + val tileGroupMap = actor as TileGroupMap<*> + tileGroupMap.shouldAct = isEnabled + tileGroupMap.shouldHit = isEnabled + } + + onPanStartListener = { setActHit() } + onPanStopListener = { setActHit() } + onZoomStartListener = { setActHit() } + onZoomStopListener = { setActHit() } + } + +} diff --git a/core/src/com/unciv/ui/cityscreen/CityScreen.kt b/core/src/com/unciv/ui/cityscreen/CityScreen.kt index 4c6c9e2a6a..ce495494f6 100644 --- a/core/src/com/unciv/ui/cityscreen/CityScreen.kt +++ b/core/src/com/unciv/ui/cityscreen/CityScreen.kt @@ -16,9 +16,11 @@ import com.unciv.models.ruleset.tile.TileImprovement import com.unciv.models.ruleset.unique.LocalUniqueCache import com.unciv.models.ruleset.unique.UniqueType import com.unciv.models.stats.Stat +import com.unciv.models.translations.tr import com.unciv.ui.audio.CityAmbiencePlayer import com.unciv.ui.audio.SoundPlayer import com.unciv.ui.images.ImageGetter +import com.unciv.ui.popup.ConfirmPopup import com.unciv.ui.tilegroups.TileGroupMap import com.unciv.ui.popup.ToastPopup import com.unciv.ui.tilegroups.CityTileGroup @@ -26,7 +28,6 @@ import com.unciv.ui.tilegroups.TileSetStrings import com.unciv.ui.utils.BaseScreen import com.unciv.ui.utils.KeyCharAndCode import com.unciv.ui.utils.RecreateOnResize -import com.unciv.ui.utils.ZoomableScrollPane import com.unciv.ui.utils.extensions.disable import com.unciv.ui.utils.extensions.keyShortcuts import com.unciv.ui.utils.extensions.onActivation @@ -88,7 +89,7 @@ class CityScreen( private var tileGroups = ArrayList() /** The ScrollPane for the background map view of the city surroundings */ - private val mapScrollPane = ZoomableScrollPane() + private val mapScrollPane = CityMapHolder() /** Support for [UniqueType.CreatesOneImprovement] - need user to pick a tile */ class PickTileForImprovementData ( @@ -302,9 +303,8 @@ class CityScreen( .map { CityTileGroup(cityInfo, it, tileSetStrings) } for (tileGroup in cityTileGroups) { - tileGroup.onClick { - tileGroupOnClick(tileGroup, cityInfo) - } + tileGroup.onClick { tileGroupOnClick(tileGroup, cityInfo) } + tileGroup.layerMisc.onClick { tileWorkedIconOnClick(tileGroup, cityInfo) } tileGroups.add(tileGroup) } @@ -330,6 +330,45 @@ class CityScreen( mapScrollPane.updateVisualScroll() } + private fun tileWorkedIconOnClick(tileGroup: CityTileGroup, city: City) { + + if (!canChangeState || city.isPuppet) return + val tile = tileGroup.tile + + // Cycling as: Not-worked -> Worked -> Locked -> Not-worked + if (tileGroup.isWorkable) { + if (!tile.providesYield() && city.population.getFreePopulation() > 0) { + city.workedTiles.add(tile.position) + game.settings.addCompletedTutorialTask("Reassign worked tiles") + } else if (tile.isWorked() && !tile.isLocked()) { + city.lockedTiles.add(tile.position) + } else if (tile.isLocked()) { + city.workedTiles.remove(tile.position) + city.lockedTiles.remove(tile.position) + } + city.cityStats.update() + update() + + } else if (tileGroup.isPurchasable) { + + val price = city.expansion.getGoldCostOfTile(tile) + val purchasePrompt = "Currently you have [${city.civ.gold}] [Gold].".tr() + "\n\n" + + "Would you like to purchase [Tile] for [$price] [${Stat.Gold.character}]?".tr() + ConfirmPopup( + this, + purchasePrompt, + "Purchase", + true, + restoreDefault = { update() } + ) { + SoundPlayer.play(UncivSound.Coin) + city.expansion.buyTile(tile) + // preselect the next tile on city screen rebuild so bulk buying can go faster + UncivGame.Current.replaceCurrentScreen(CityScreen(city, initSelectedTile = city.expansion.chooseNewTileToOwn())) + }.open() + } + } + private fun tileGroupOnClick(tileGroup: CityTileGroup, city: City) { if (city.isPuppet) return val tileInfo = tileGroup.tile @@ -356,17 +395,6 @@ class CityScreen( } selectTile(tileInfo) - if (tileGroup.isWorkable && canChangeState) { - if (!tileInfo.providesYield() && city.population.getFreePopulation() > 0) { - city.workedTiles.add(tileInfo.position) - city.lockedTiles.add(tileInfo.position) - game.settings.addCompletedTutorialTask("Reassign worked tiles") - } else if (tileInfo.isWorked()) { - city.workedTiles.remove(tileInfo.position) - city.lockedTiles.remove(tileInfo.position) - } - city.cityStats.update() - } update() } diff --git a/core/src/com/unciv/ui/cityscreen/CityScreenTileTable.kt b/core/src/com/unciv/ui/cityscreen/CityScreenTileTable.kt index 0af383c769..ed2a834b41 100644 --- a/core/src/com/unciv/ui/cityscreen/CityScreenTileTable.kt +++ b/core/src/com/unciv/ui/cityscreen/CityScreenTileTable.kt @@ -59,7 +59,7 @@ class CityScreenTileTable(private val cityScreen: CityScreen): Table() { innerTable.row() innerTable.add(getTileStatsTable(stats)).row() - if (isTilePurchaseShown(selectedTile)) { + if (city.expansion.canBuyTile(selectedTile)) { val goldCostOfTile = city.expansion.getGoldCostOfTile(selectedTile) val buyTileButton = "Buy for [$goldCostOfTile] gold".toTextButton() buyTileButton.onActivation { @@ -67,7 +67,7 @@ class CityScreenTileTable(private val cityScreen: CityScreen): Table() { askToBuyTile(selectedTile) } buyTileButton.keyShortcuts.add('T') - buyTileButton.isEnabled = isTilePurchaseAllowed(goldCostOfTile) + buyTileButton.isEnabled = cityScreen.canChangeState && city.civ.hasGoldToBuy(goldCostOfTile) buyTileButton.addTooltip('T') // The key binding is done in CityScreen constructor innerTable.add(buyTileButton).padTop(5f).row() } @@ -113,9 +113,9 @@ class CityScreenTileTable(private val cityScreen: CityScreen): Table() { */ private fun askToBuyTile(selectedTile: Tile) { // These checks are redundant for the onClick action, but not for the keyboard binding - if (!isTilePurchaseShown(selectedTile)) return + if (!city.expansion.canBuyTile(selectedTile)) return val goldCostOfTile = city.expansion.getGoldCostOfTile(selectedTile) - if (!isTilePurchaseAllowed(goldCostOfTile)) return + if (!city.civ.hasGoldToBuy(goldCostOfTile)) return cityScreen.closeAllPopups() @@ -135,21 +135,6 @@ class CityScreenTileTable(private val cityScreen: CityScreen): Table() { }.open() } - /** This tests whether the buy button should be _shown_ */ - private fun isTilePurchaseShown(selectedTile: Tile) = when { - selectedTile.getOwner() != null -> false - selectedTile !in city.tilesInRange -> false - else -> selectedTile.neighbors.any { it.getCity() == city } - } - /** This tests whether the buy button should be _enabled_ */ - private fun isTilePurchaseAllowed(goldCostOfTile: Int) = when { - city.isPuppet -> false - !cityScreen.canChangeState -> false - city.civ.gameInfo.gameParameters.godMode -> true - goldCostOfTile == 0 -> true - else -> city.civ.gold >= goldCostOfTile - } - private fun getTileStatsTable(stats: Stats): Table { val statsTable = Table() statsTable.defaults().pad(2f) diff --git a/core/src/com/unciv/ui/tilegroups/CityTileGroup.kt b/core/src/com/unciv/ui/tilegroups/CityTileGroup.kt index c8a7c13e25..31c1ea7a77 100644 --- a/core/src/com/unciv/ui/tilegroups/CityTileGroup.kt +++ b/core/src/com/unciv/ui/tilegroups/CityTileGroup.kt @@ -1,23 +1,38 @@ package com.unciv.ui.tilegroups +import com.badlogic.gdx.graphics.Color +import com.badlogic.gdx.scenes.scene2d.Actor +import com.badlogic.gdx.scenes.scene2d.Touchable +import com.badlogic.gdx.utils.Align import com.unciv.UncivGame import com.unciv.logic.city.City import com.unciv.logic.civilization.Civilization import com.unciv.logic.map.tile.Tile import com.unciv.ui.images.ImageGetter +import com.unciv.ui.utils.extensions.addToCenter +import com.unciv.ui.utils.extensions.darken +import com.unciv.ui.utils.extensions.setFontColor +import com.unciv.ui.utils.extensions.toGroup +import com.unciv.ui.utils.extensions.toLabel class CityTileGroup(private val city: City, tile: Tile, tileSetStrings: TileSetStrings) : TileGroup(tile,tileSetStrings) { var isWorkable = false + var isPurchasable = false init { - if (city.location == tile.position) - layerMisc.setNewPopulationIcon(ImageGetter.getImage("OtherIcons/Star")) + layerMisc.touchable = Touchable.childrenOnly } override fun update(viewingCiv: Civilization?) { super.update(city.civ) + isWorkable = false + isPurchasable = false + + layerMisc.removeWorkedIcon() + var icon: Actor? = null + when { // Does not belong to us @@ -25,6 +40,25 @@ class CityTileGroup(private val city: City, tile: Tile, tileSetStrings: TileSetS layerTerrain.dim(0.3f) layerMisc.setYieldVisible(UncivGame.Current.settings.showTileYields) layerMisc.dimYields(true) + + // Can be purchased in principle? Add icon. + if (city.expansion.canBuyTile(tile)) { + + val price = city.expansion.getGoldCostOfTile(tile) + val label = price.toString().toLabel(fontSize = 9, alignment = Align.center) + val image = ImageGetter.getImage("TileIcons/Buy") + icon = image.toGroup(26f).apply { isTransform = false } + icon.addToCenter(label) + label.y -= 15f + + // Can be purchased now? + if (!city.civ.hasGoldToBuy(price)) { + image.color = Color.WHITE.darken(0.5f) + label.setFontColor(Color.RED) + } else { + isPurchasable = true + } + } } // Out of city range @@ -40,34 +74,56 @@ class CityTileGroup(private val city: City, tile: Tile, tileSetStrings: TileSetS layerMisc.dimYields(true) } - // Locked - tile.isLocked() -> { - layerMisc.setNewPopulationIcon(ImageGetter.getImage("OtherIcons/Lock")) - isWorkable = true + // City Center + tile.isCityCenter() -> { + icon = ImageGetter.getImage("TileIcons/CityCenter") + layerMisc.dimYields(false) } - // Workable - tile.isWorked() || !tile.providesYield() -> { - layerMisc.setNewPopulationIcon() + // Does not provide yields + tile.stats.getTileStats(viewingCiv).isEmpty() -> { + // Do nothing + } + + // Locked + tile.isLocked() -> { + icon = ImageGetter.getImage("TileIcons/Locked") isWorkable = true + layerMisc.dimYields(false) + } + + // Worked + tile.isWorked() -> { + icon = ImageGetter.getImage("TileIcons/Worked") + isWorkable = true + layerMisc.dimYields(false) + } + + // Not-worked + else -> { + icon = ImageGetter.getImage("TileIcons/NotWorked") + isWorkable = true + layerMisc.dimYields(true) } } - // No unit flags inside CityScreen - layerUnitFlag.isVisible = false + if (icon != null) { + icon.setSize(26f, 26f) + icon.setPosition(width/2 - icon.width/2, + height*0.85f - icon.height/2) + layerMisc.addWorkedIcon(icon) + } - // Pixel art, road, improvements are dimmed inside CityScreen + // No unit flags and city-buttons inside CityScreen + layerUnitFlag.isVisible = false + layerCityButton.isVisible = false + + // Pixel art, roads, improvements are dimmed inside CityScreen layerUnitArt.dim() layerFeatures.dim() layerMisc.dimImprovement(true) - // Dim yield icons if tile is not worked - if (!tile.providesYield()) - layerMisc.dimYields(true) - - // Update citizen icon and put whole layer (yield, pop, improvement, res) to front - layerMisc.updatePopulationIcon() + // Put whole layer (yield, pop, improvement, res) to front layerMisc.toFront() } - } diff --git a/core/src/com/unciv/ui/tilegroups/WorldTileGroup.kt b/core/src/com/unciv/ui/tilegroups/WorldTileGroup.kt index 05c4c1fb64..8ef7bbf8af 100644 --- a/core/src/com/unciv/ui/tilegroups/WorldTileGroup.kt +++ b/core/src/com/unciv/ui/tilegroups/WorldTileGroup.kt @@ -1,30 +1,54 @@ package com.unciv.ui.tilegroups +import com.badlogic.gdx.graphics.Color +import com.badlogic.gdx.scenes.scene2d.Touchable import com.unciv.UncivGame import com.unciv.logic.civilization.Civilization import com.unciv.logic.map.tile.Tile +import com.unciv.ui.images.ImageGetter +import com.unciv.ui.utils.extensions.center +import com.unciv.ui.utils.extensions.darken import com.unciv.ui.worldscreen.WorldScreen class WorldTileGroup(internal val worldScreen: WorldScreen, tile: Tile, tileSetStrings: TileSetStrings) : TileGroup(tile,tileSetStrings) { - override fun update(viewingCiv: Civilization?) { - - layerMisc.removePopulationIcon() - - val city = tile.getCity() - val tileIsViewable = isViewable(viewingCiv!!) - - // Show population icon overlay (if option is enabled) - if (tileIsViewable && tile.isWorked() && UncivGame.Current.settings.showWorkedTiles - && city!!.civ == viewingCiv) { - layerMisc.setNewPopulationIcon() - } - - super.update(viewingCiv) + init { + layerMisc.touchable = Touchable.disabled } + override fun update(viewingCiv: Civilization?) { + super.update(viewingCiv) + + updateWorkedIcon(viewingCiv!!) + } + + private fun updateWorkedIcon(viewingCiv: Civilization) { + + layerMisc.removeWorkedIcon() + + val shouldShowWorkedIcon = UncivGame.Current.settings.showWorkedTiles // Overlay enabled; + && isViewable(viewingCiv) // We see tile; + && tile.getCity()?.civ == viewingCiv // Tile belongs to us; + && tile.isWorked() // Tile is worked; + + if (!shouldShowWorkedIcon) + return + + val icon = when { + tile.isLocked() -> ImageGetter.getImage("TileIcons/Locked").apply { color = Color.WHITE.darken(0.5f) } + tile.isWorked() && tile.providesYield() -> ImageGetter.getImage("TileIcons/Worked").apply { color = Color.WHITE.darken(0.5f) } + else -> null + } + + if (icon != null) { + icon.setSize(20f, 20f) + icon.center(this) + icon.x += 20f + layerMisc.addWorkedIcon(icon) + } + } override fun clone(): WorldTileGroup = WorldTileGroup(worldScreen, tile , tileSetStrings) } diff --git a/core/src/com/unciv/ui/tilegroups/layers/TileLayer.kt b/core/src/com/unciv/ui/tilegroups/layers/TileLayer.kt index 74fdb5e91a..01a214c7cf 100644 --- a/core/src/com/unciv/ui/tilegroups/layers/TileLayer.kt +++ b/core/src/com/unciv/ui/tilegroups/layers/TileLayer.kt @@ -1,6 +1,7 @@ package com.unciv.ui.tilegroups.layers import com.badlogic.gdx.scenes.scene2d.Group +import com.badlogic.gdx.scenes.scene2d.Touchable import com.badlogic.gdx.scenes.scene2d.ui.Image import com.unciv.logic.civilization.Civilization import com.unciv.logic.map.tile.Tile @@ -11,6 +12,7 @@ import com.unciv.ui.tilegroups.TileSetStrings abstract class TileLayer(val tileGroup: TileGroup, size: Float) : Group() { init { + touchable = Touchable.disabled isTransform = false @Suppress("LeakingThis") setSize(size, size) diff --git a/core/src/com/unciv/ui/tilegroups/layers/TileLayerMisc.kt b/core/src/com/unciv/ui/tilegroups/layers/TileLayerMisc.kt index 957f8d24ae..def3e45230 100644 --- a/core/src/com/unciv/ui/tilegroups/layers/TileLayerMisc.kt +++ b/core/src/com/unciv/ui/tilegroups/layers/TileLayerMisc.kt @@ -13,14 +13,13 @@ import com.unciv.models.helpers.MapArrowType import com.unciv.models.helpers.MiscArrowTypes import com.unciv.models.helpers.TintedMapArrow import com.unciv.models.helpers.UnitMovementMemoryType -import com.unciv.ui.tilegroups.YieldGroup import com.unciv.ui.images.ImageGetter import com.unciv.ui.tilegroups.TileGroup import com.unciv.ui.tilegroups.TileSetStrings import com.unciv.ui.tilegroups.WorldTileGroup +import com.unciv.ui.tilegroups.YieldGroup import com.unciv.ui.utils.extensions.center import com.unciv.ui.utils.extensions.centerX -import com.unciv.ui.utils.extensions.darken import com.unciv.ui.utils.extensions.toLabel import kotlin.math.atan2 import kotlin.math.min @@ -44,7 +43,15 @@ private class MapArrow(val targetTile: Tile, val arrowType: MapArrowType, val st class TileLayerMisc(tileGroup: TileGroup, size: Float) : TileLayer(tileGroup, size) { override fun act(delta: Float) {} - override fun hit(x: Float, y: Float, touchable: Boolean): Actor? = null + override fun hit(x: Float, y: Float, touchable: Boolean): Actor? { + return if (workedIcon == null) { + null + } else { + val coords = Vector2(x, y) + workedIcon!!.parentToLocalCoordinates(coords) + workedIcon!!.hit(coords.x, coords.y, touchable) + } + } private var yieldsInitialized = false private var yields = YieldGroup().apply { isVisible = false } @@ -53,10 +60,10 @@ class TileLayerMisc(tileGroup: TileGroup, size: Float) : TileLayer(tileGroup, si private val arrowsToDraw = ArrayList() private val arrows = HashMap>() + private var resourceName: String? = null + private var resourceIcon: Actor? = null + private var workedIcon: Actor? = null var improvementIcon: Actor? = null - var populationIcon: Image? = null - var resourceIcon: Actor? = null - var resourceName: String? = null private val startingLocationIcons = mutableListOf() @@ -233,36 +240,16 @@ class TileLayerMisc(tileGroup: TileGroup, size: Float) : TileLayer(tileGroup, si } } - fun updatePopulationIcon() { - val icon = populationIcon - if (icon != null) { - icon.setSize(25f, 25f) - icon.setPosition(width / 2 - icon.width / 2, - height * 0.85f - icon.height / 2) - icon.color = when { - tile().isCityCenter() -> Color.GOLD.cpy() - tile().providesYield() -> Color.WHITE.cpy() - else -> Color.GRAY.cpy() - } - icon.toFront() - } + fun removeWorkedIcon() { + workedIcon?.remove() + workedIcon = null + determineVisibility() } - fun setNewPopulationIcon(icon: Image = ImageGetter.getStatIcon("Population") - .apply { color = Color.GREEN.darken(0.5f) }) { - populationIcon?.remove() - populationIcon = icon - populationIcon!!.run { - setSize(20f, 20f) - center(tileGroup) - x += 20 // right - } - addActor(populationIcon) - } - - fun removePopulationIcon() { - populationIcon?.remove() - populationIcon = null + fun addWorkedIcon(icon: Actor) { + workedIcon = icon + addActor(workedIcon) + determineVisibility() } @@ -278,7 +265,7 @@ class TileLayerMisc(tileGroup: TileGroup, size: Float) : TileLayer(tileGroup, si fun dimImprovement(dim: Boolean) { improvementIcon?.color?.a = if (dim) 0.5f else 1f } fun dimResource(dim: Boolean) { resourceIcon?.color?.a = if (dim) 0.5f else 1f } fun dimYields(dim: Boolean) { yields.color.a = if (dim) 0.5f else 1f } - fun dimPopulation(dim: Boolean) { populationIcon?.color?.a = if (dim) 0.4f else 1f } + fun dimPopulation(dim: Boolean) { workedIcon?.color?.a = if (dim) 0.4f else 1f } fun setYieldVisible(isVisible: Boolean) { yields.isVisible = isVisible @@ -305,7 +292,7 @@ class TileLayerMisc(tileGroup: TileGroup, size: Float) : TileLayer(tileGroup, si isVisible = yields.isVisible || resourceIcon?.isVisible == true || improvementIcon != null - || populationIcon != null + || workedIcon != null || arrows.isNotEmpty() || startingLocationIcons.isNotEmpty() } diff --git a/core/src/com/unciv/ui/utils/ZoomableScrollPane.kt b/core/src/com/unciv/ui/utils/ZoomableScrollPane.kt index a47335f971..26599f99bf 100644 --- a/core/src/com/unciv/ui/utils/ZoomableScrollPane.kt +++ b/core/src/com/unciv/ui/utils/ZoomableScrollPane.kt @@ -294,6 +294,8 @@ open class ZoomableScrollPane( } override fun panStop(event: InputEvent?, x: Float, y: Float, pointer: Int, button: Int) { + if (zoomListener.isZooming) + zoomListener.isZooming = false isPanning = false onPanStopListener?.invoke() }