UI Upgrade (#3149)
* UI Update * Replace ScrollPane with Table in Minimap
This commit is contained in:
parent
a0d18889e0
commit
9f4607635b
12 changed files with 67 additions and 109 deletions
|
@ -521,8 +521,7 @@ Raze city = 摧毁城市
|
|||
Stop razing city = 停止摧毁城市
|
||||
Buy for [amount] gold = 花费[amount]金钱购买
|
||||
Buy = 购买
|
||||
You have [amount] gold = 你有[amount]金钱
|
||||
Currently you have [amount] gold. = 目前你有[amount]金钱
|
||||
Currently you have [amount] gold. = 目前你有[amount]金钱。
|
||||
Would you like to purchase [constructionName] for [buildingGoldCost] gold? = 你想花费[buildingGoldCost]金钱购买[constructionName]吗?
|
||||
No space available to place [unit] near [city] = [city]附近没有位置部署[unit]
|
||||
Maintenance cost = 建筑维护费
|
||||
|
@ -655,9 +654,9 @@ Closest city = 最近的城市
|
|||
Action = 行动
|
||||
Defeated = 战败
|
||||
[numberOfCivs] Civilizations in the game = 游戏中共有[numberOfCivs]个文明
|
||||
Our Civilization: = 我们的文明:
|
||||
Known and alive ([numberOfCivs]) = 已知的幸存文明([numberOfCivs])
|
||||
Known and defeated ([numberOfCivs]) = 已知的陨落文明([numberOfCivs])
|
||||
Our Civilization: = 我们的文明:
|
||||
Known and alive ([numberOfCivs]) = 已知的幸存文明 ([numberOfCivs])
|
||||
Known and defeated ([numberOfCivs]) = 已知的陨落文明 ([numberOfCivs])
|
||||
Tiles = 地块
|
||||
Natural Wonders = 自然奇观
|
||||
Treasury deficit = 财政赤字
|
||||
|
@ -811,6 +810,7 @@ Adopt policy = 推行政策
|
|||
Adopt free policy = 推行免费的政策
|
||||
Unlocked at = 解锁时代:
|
||||
Gain 2 free technologies = 获得2项免费科技
|
||||
All policies adopted = 所有政策皆已推行
|
||||
|
||||
# Technologies
|
||||
|
||||
|
@ -819,8 +819,7 @@ Mass Media = 大众传媒
|
|||
# Terrains
|
||||
|
||||
Impassable = 不能通行
|
||||
# Requires translation!
|
||||
Rare feature =
|
||||
Rare feature = 稀有地貌
|
||||
|
||||
# Resources
|
||||
|
||||
|
@ -905,9 +904,8 @@ Are you SURE you want to delete this mod? = 你确定要删除这个模组吗?
|
|||
[stats] from every [param] = 每个[param][stats]
|
||||
[stats] from [param] tiles in this city = 所在城市的[param]地块[stats]
|
||||
[stats] for each adjacent [param] = 每个相邻的[param][stats]
|
||||
Must be next to [terrain] = 必须紧邻[terrain]
|
||||
# Requires translation!
|
||||
Must be on [terrain] =
|
||||
Must be next to [terrain] = 城市必须毗邻[terrain]
|
||||
Must be on [terrain] = 城市必须位于[terrain]之上
|
||||
+[amount]% vs [unitType] = 对战[unitType]时+[amount]%
|
||||
|
||||
# City filters
|
||||
|
@ -928,8 +926,7 @@ Monument = 纪念碑
|
|||
|
||||
Granary = 粮仓
|
||||
|
||||
# Requires translation!
|
||||
Must not be on [terrain] =
|
||||
Must not be on [terrain] = 城市不能位于[terrain]
|
||||
Stone Works = 石工坊
|
||||
|
||||
'Time crumbles things; everything grows old and is forgotten under the power of time' - Aristotle = “时间能粉碎一切;所有事物终将在时流中衰老并被遗忘。”——亚里士多德
|
||||
|
@ -961,7 +958,7 @@ Walls of Babylon = 巴比伦城墙
|
|||
|
||||
'O, let not the pains of death which come upon thee enter into my body. I am the god Tem, and I am the foremost part of the sky, and the power which protecteth me is that which is with all the gods forever.' - The Book of the Dead, translated by Sir Ernest Alfred Wallis Budge = “哦,别让你所受的死亡痛苦进入我的身体。我是创世神泰姆,我处在天界的最高层,神力护佑着我和所有其他神灵直到永远。”——“死者之书”译文,欧内斯特·阿尔弗雷德·沃利斯·巴吉爵士(英国考古学家)
|
||||
Worker construction increased 25% = 设施建造速度+25%
|
||||
Provides 2 free workers = 提供2个免费工人
|
||||
[amount] free [unit] units appear = [amount]个免费的[unit]出现
|
||||
The Pyramids = 大金字塔
|
||||
|
||||
Barracks = 军营
|
||||
|
@ -1048,8 +1045,7 @@ Chichen Itza = 奇琴伊察
|
|||
|
||||
'Few romances can ever surpass that of the granite citadel on top of the beetling precipices of Machu Picchu, the crown of Inca Land.' - Hiram Bingham = “很少有能超越这座建立在马丘比丘顶峰峭壁上的石头城塞的浪漫,它是印加的皇冠。”——海勒姆·宾厄姆(美国探险家)
|
||||
Gold from all trade routes +25% = 所有贸易路线的金币收益+25%
|
||||
# Requires translation!
|
||||
Must have an owned [terrain] within [amount] tiles =
|
||||
Must have an owned [terrain] within [amount] tiles = 城市[amount]格内的己方地块必须有[terrain]
|
||||
Machu Picchu = 马丘比丘
|
||||
|
||||
Workshop = 工坊
|
||||
|
@ -1121,7 +1117,6 @@ Museum = 博物馆
|
|||
Hermitage = 冬宫
|
||||
|
||||
'Every genuine work of art has as much reason for being as the earth and the sun' - Ralph Waldo Emerson = “每一件伟大的艺术品都应如日月般长存。”——拉尔夫·沃尔多·爱默生
|
||||
2 free Great Artists appear = 2个免费的伟大艺术家出现
|
||||
The Louvre = 卢浮宫
|
||||
|
||||
Seaport = 海运码头
|
||||
|
@ -1201,7 +1196,6 @@ Enables construction of Spaceship parts = 允许建造太空飞船的部件
|
|||
Apollo Program = 阿波罗计划
|
||||
|
||||
'The wonder is, not that the field of stars is so vast, but that man has measured it.' - Anatole France = “奇迹的不是那片星域如此辽阔,而是人类竟然成功测量了它。”——阿纳托尔·法郎士(法国小说家)
|
||||
2 free great scientists appear = 2个免费的大科学家出现
|
||||
Hubble Space Telescope = 哈勃太空望远镜
|
||||
|
||||
SS Cockpit = 飞船驾驶舱
|
||||
|
@ -1931,8 +1925,7 @@ Ruin! Ruin! Istanbul becomes Iram of the Pillars, remembered only by the melanch
|
|||
From the magnificence of Topkapi, the Ottoman nation greets you, stranger! I'm Suleiman, Kayser-I Rum, and I bestow upon you my welcome! = 在托普卡利的壮丽之下,奥斯曼帝国向您致敬,陌生人!我是苏莱曼一世,在这里,我表示对您的欢迎!
|
||||
Let us do business! Would you be interested? = 让我们做些威尼斯商人要做的事吧,你对这个交易怎么看?
|
||||
Barbary Corsairs = 巴巴里海盗
|
||||
# Requires translation!
|
||||
50% chance of capturing defeated Barbarian naval units and earning 25 Gold =
|
||||
50% chance of capturing defeated Barbarian naval units and earning 25 Gold = 50%几率俘获战败的蛮族海军单位同时获得25金钱
|
||||
Pay only one third the usual cost for naval unit maintenance = 海上单位维护费为正常值的1/3
|
||||
Istanbul = 伊斯坦布尔
|
||||
Edirne = 埃迪尔内
|
||||
|
@ -3009,6 +3002,7 @@ Fort = 堡垒
|
|||
|
||||
Road = 道路
|
||||
|
||||
|
||||
Remove Forest = 砍伐森林
|
||||
|
||||
Remove Jungle = 砍伐丛林
|
||||
|
@ -3035,8 +3029,7 @@ Customs house = 海关
|
|||
Deal 30 damage to adjacent enemy units = 任何在军事要塞旁结束回合的敌方单位将遭受30点损伤
|
||||
Citadel = 军事要塞
|
||||
|
||||
# Requires translation!
|
||||
Can only be built on Coastal tiles =
|
||||
Can only be built on Coastal tiles = 只能建造在海滨地块
|
||||
Moai = 摩艾石像群
|
||||
|
||||
Cannot be built on bonus resource = 无法建造在拥有奖励资源的地块
|
||||
|
@ -3282,6 +3275,7 @@ Founds a new city = 建立一座城市,组建此单位时城市的食物积累
|
|||
|
||||
Ignores terrain cost = 所有地形都只消耗1移动力
|
||||
|
||||
|
||||
Maori Warrior = 毛利勇士
|
||||
|
||||
Jaguar = 美洲虎战士
|
||||
|
|
|
@ -534,8 +534,7 @@ Raze city = 摧毀城市
|
|||
Stop razing city = 停止摧毀城市
|
||||
Buy for [amount] gold = 花費[amount]金錢購買
|
||||
Buy = 購買
|
||||
You have [amount] gold = 你有[amount]金錢
|
||||
Currently you have [amount] gold. = 目前你有[amount]金錢
|
||||
Currently you have [amount] gold. = 目前你有[amount]金錢。
|
||||
Would you like to purchase [constructionName] for [buildingGoldCost] gold? = 你想花費[buildingGoldCost]金錢購買[constructionName]嗎?
|
||||
No space available to place [unit] near [city] = [city]附近沒有位置部署[unit]
|
||||
Maintenance cost = 建築維護費
|
||||
|
@ -638,8 +637,7 @@ military units = 軍事單位
|
|||
melee units = 近戰單位
|
||||
mounted units = 騎乘單位
|
||||
naval units = 海軍單位
|
||||
# Requires translation!
|
||||
ranged units =
|
||||
ranged units = 遠程單位
|
||||
# For the All "newly-trained [relevant] units in this city receive the [] promotion" translation. Relevant as in 'units that can receive'
|
||||
relevant = 相應的
|
||||
# For '[stats] from [Water] tiles in this city'
|
||||
|
@ -647,8 +645,7 @@ Water = 水上
|
|||
# For [stats] from [Water resource] tiles in this city
|
||||
Water resource = 水上資源
|
||||
River = 河流
|
||||
# Requires translation!
|
||||
Fresh water =
|
||||
Fresh water = 淡水
|
||||
non-fresh water = 非淡水
|
||||
|
||||
Wonders = 奇觀
|
||||
|
@ -670,9 +667,9 @@ Closest city = 最近的城市
|
|||
Action = 行動
|
||||
Defeated = 戰敗
|
||||
[numberOfCivs] Civilizations in the game = 遊戲中共有[numberOfCivs]個文明
|
||||
Our Civilization: = 我們的文明:
|
||||
Known and alive ([numberOfCivs]) = 已知的倖存文明([numberOfCivs])
|
||||
Known and defeated ([numberOfCivs]) = 已知的殞落文明([numberOfCivs])
|
||||
Our Civilization: = 我們的文明:
|
||||
Known and alive ([numberOfCivs]) = 已知的倖存文明 ([numberOfCivs])
|
||||
Known and defeated ([numberOfCivs]) = 已知的殞落文明 ([numberOfCivs])
|
||||
Tiles = 地區
|
||||
Natural Wonders = 自然奇觀
|
||||
Treasury deficit = 財政赤字
|
||||
|
@ -836,6 +833,7 @@ Adopt policy = 推行政策
|
|||
Adopt free policy = 推行免費的政策
|
||||
Unlocked at = 解鎖時代:
|
||||
Gain 2 free technologies = 獲得2項免費科技
|
||||
All policies adopted = 所有政策皆已推行
|
||||
|
||||
# Technologies
|
||||
|
||||
|
@ -844,8 +842,7 @@ Mass Media = 大眾傳媒
|
|||
# Terrains
|
||||
|
||||
Impassable = 不能通行
|
||||
# Requires translation!
|
||||
Rare feature =
|
||||
Rare feature = 稀有地貌
|
||||
|
||||
# Resources
|
||||
|
||||
|
@ -855,12 +852,9 @@ Cocoa = 可可
|
|||
Crab = 螃蟹
|
||||
Citrus = 柑橘
|
||||
Truffles = 松露
|
||||
# Requires translation!
|
||||
Strategic =
|
||||
# Requires translation!
|
||||
Bonus =
|
||||
# Requires translation!
|
||||
Luxury =
|
||||
Strategic = 戰略資源
|
||||
Bonus = 獎勵資源
|
||||
Luxury = 奢侈資源
|
||||
|
||||
# Unit types
|
||||
|
||||
|
@ -941,11 +935,9 @@ Are you SURE you want to delete this mod? =
|
|||
[stats] from every [param] = 每個[param][stats]
|
||||
[stats] from [param] tiles in this city = 所在城市的[param]地塊[stats]
|
||||
[stats] for each adjacent [param] = 每個相鄰的[param][stats]
|
||||
Must be next to [terrain] = 必須緊鄰[terrain]
|
||||
# Requires translation!
|
||||
Must be on [terrain] =
|
||||
# Requires translation!
|
||||
+[amount]% vs [unitType] =
|
||||
Must be next to [terrain] = 城市必須毗鄰[terrain]
|
||||
Must be on [terrain] = 城市必須位於[terrain]之上
|
||||
+[amount]% vs [unitType] = 對戰[unitType]時+[amount]%
|
||||
|
||||
# City filters
|
||||
# Requires translation!
|
||||
|
@ -965,8 +957,7 @@ Monument = 紀念碑
|
|||
|
||||
Granary = 糧倉
|
||||
|
||||
# Requires translation!
|
||||
Must not be on [terrain] =
|
||||
Must not be on [terrain] = 城市不能位於[terrain]
|
||||
Stone Works = 石工坊
|
||||
|
||||
'Time crumbles things; everything grows old and is forgotten under the power of time' - Aristotle = “時間能粉碎一切;所有事物中將在時流中衰老並被遺忘。”——亞里士多德
|
||||
|
@ -1003,7 +994,8 @@ Walls of Babylon = 巴比倫城牆
|
|||
|
||||
'O, let not the pains of death which come upon thee enter into my body. I am the god Tem, and I am the foremost part of the sky, and the power which protecteth me is that which is with all the gods forever.' - The Book of the Dead, translated by Sir Ernest Alfred Wallis Budge = “哦,別讓你所受的死亡痛苦進入我的身體。我是創世神泰姆,我處在天界的最高層,神力護佑著我和所有其他神靈直到永遠。”——“死者之書”譯文,歐內斯特·阿爾弗雷德·沃利斯·巴吉爵士(英國考古學家)
|
||||
Worker construction increased 25% = 設施建造速度+25%
|
||||
Provides 2 free workers = 提供2個免費工人
|
||||
# Requires translation!
|
||||
[amount] free [unit] units appear =
|
||||
The Pyramids = 大金字塔
|
||||
|
||||
Barracks = 軍營
|
||||
|
@ -1166,7 +1158,6 @@ Museum = 博物館
|
|||
Hermitage = 冬宮
|
||||
|
||||
'Every genuine work of art has as much reason for being as the earth and the sun' - Ralph Waldo Emerson = “每一件偉大的藝術品都應如日月般長存。”——拉爾夫·沃爾多·愛默生
|
||||
2 free Great Artists appear = 2名免費的大藝術家出現
|
||||
The Louvre = 羅浮宮
|
||||
|
||||
Seaport = 海運碼頭
|
||||
|
@ -1246,7 +1237,6 @@ Enables construction of Spaceship parts = 允許建造太空飛船的零件
|
|||
Apollo Program = 阿波羅計畫
|
||||
|
||||
'The wonder is, not that the field of stars is so vast, but that man has measured it.' - Anatole France = “奇跡的不是那片星域如此遼闊,而是人類竟然成功測量了它。”——阿納托爾·法郎士(法國小說家)
|
||||
2 free great scientists appear = 2個免費的大科學家出現
|
||||
Hubble Space Telescope = 哈柏太空望遠鏡
|
||||
|
||||
SS Cockpit = 飛船駕駛艙
|
||||
|
@ -1976,8 +1966,7 @@ Ruin! Ruin! Istanbul becomes Iram of the Pillars, remembered only by the melanch
|
|||
From the magnificence of Topkapi, the Ottoman nation greets you, stranger! I'm Suleiman, Kayser-I Rum, and I bestow upon you my welcome! = 在托普卡利的壯麗之下,奧斯曼帝國向您致敬,陌生人!我是蘇萊曼一世,在這裡,我表示對您的歡迎!
|
||||
Let us do business! Would you be interested? = 讓我們做些威尼斯商人要做的事吧,你對這個交易怎麼看?
|
||||
Barbary Corsairs = 巴巴里海盜
|
||||
# Requires translation!
|
||||
50% chance of capturing defeated Barbarian naval units and earning 25 Gold =
|
||||
50% chance of capturing defeated Barbarian naval units and earning 25 Gold = 50%幾率俘獲戰敗的蠻族海軍單位同時獲得25金錢
|
||||
Pay only one third the usual cost for naval unit maintenance = 海上單位維護費為正常值的1/3
|
||||
Istanbul = 伊斯坦布爾
|
||||
Edirne = 埃迪爾內
|
||||
|
@ -3103,6 +3092,7 @@ Fort = 堡壘
|
|||
|
||||
Road = 道路
|
||||
|
||||
|
||||
Remove Forest = 砍伐森林
|
||||
|
||||
Remove Jungle = 砍伐叢林
|
||||
|
@ -3377,6 +3367,7 @@ Founds a new city = 建立一座城市,組建此單位時城市的食物積累
|
|||
|
||||
Ignores terrain cost = 所有地形都只消耗1移動力
|
||||
|
||||
|
||||
Maori Warrior = 毛利勇士
|
||||
|
||||
# Requires translation!
|
||||
|
|
|
@ -521,7 +521,6 @@ Raze city =
|
|||
Stop razing city =
|
||||
Buy for [amount] gold =
|
||||
Buy =
|
||||
You have [amount] gold =
|
||||
Currently you have [amount] gold. =
|
||||
Would you like to purchase [constructionName] for [buildingGoldCost] gold? =
|
||||
No space available to place [unit] near [city] =
|
||||
|
|
|
@ -54,7 +54,7 @@ class BaseUnit : INamed, IConstruction {
|
|||
|
||||
fun getDescription(forPickerScreen:Boolean): String {
|
||||
val sb = StringBuilder()
|
||||
if(requiredResource!=null) sb.appendln("{Requires} {$requiredResource}".tr())
|
||||
if(requiredResource!=null) sb.appendln("Consumes 1 [{$requiredResource}]".tr())
|
||||
if(!forPickerScreen) {
|
||||
if(uniqueTo!=null) sb.appendln("Unique to [$uniqueTo], replaces [$replaces]".tr())
|
||||
else sb.appendln("{Cost}: $cost".tr())
|
||||
|
@ -77,7 +77,7 @@ class BaseUnit : INamed, IConstruction {
|
|||
sb.appendln(promotions.joinToString(", ", " ") { it.tr() })
|
||||
}
|
||||
|
||||
return sb.toString()
|
||||
return sb.toString().trim()
|
||||
}
|
||||
|
||||
fun getMapUnit(ruleset: Ruleset): MapUnit {
|
||||
|
|
|
@ -62,7 +62,7 @@ class CityScreenCityPickerTable(val cityScreen: CityScreen) : Table(){
|
|||
|
||||
cityNameTable.add(currentCityLabel)
|
||||
|
||||
add(cityNameTable).width(stage.width/3)
|
||||
add(cityNameTable).width(stage.width/4)
|
||||
|
||||
|
||||
if (civInfo.cities.size > 1) {
|
||||
|
|
|
@ -6,11 +6,12 @@ import com.unciv.UncivGame
|
|||
import com.unciv.logic.map.TileInfo
|
||||
import com.unciv.models.UncivSound
|
||||
import com.unciv.models.stats.Stats
|
||||
import com.unciv.models.translations.tr
|
||||
import com.unciv.ui.utils.*
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
class CityScreenTileTable(val cityScreen: CityScreen): Table(){
|
||||
val innerTable = Table()
|
||||
class CityScreenTileTable(private val cityScreen: CityScreen): Table(){
|
||||
private val innerTable = Table()
|
||||
val city = cityScreen.city
|
||||
init{
|
||||
innerTable.background = ImageGetter.getBackground(ImageGetter.getBlue().lerp(Color.BLACK, 0.5f))
|
||||
|
@ -28,7 +29,7 @@ class CityScreenTileTable(val cityScreen: CityScreen): Table(){
|
|||
innerTable.clearChildren()
|
||||
|
||||
val stats = selectedTile.getTileStats(city, city.civInfo)
|
||||
innerTable.pad(20f)
|
||||
innerTable.pad(5f)
|
||||
|
||||
innerTable.add(selectedTile.toString(city.civInfo).toLabel()).colspan(2)
|
||||
innerTable.row()
|
||||
|
@ -40,8 +41,9 @@ class CityScreenTileTable(val cityScreen: CityScreen): Table(){
|
|||
|
||||
val buyTileButton = "Buy for [$goldCostOfTile] gold".toTextButton()
|
||||
buyTileButton.onClick(UncivSound.Coin) {
|
||||
city.expansion.buyTile(selectedTile)
|
||||
UncivGame.Current.setScreen(CityScreen(city))
|
||||
val purchasePrompt = "Currently you have [${city.civInfo.gold}] gold.".tr() + "\n" +
|
||||
"Would you like to purchase [Tile] for [$goldCostOfTile] gold?".tr()
|
||||
YesNoPopup(purchasePrompt, { city.expansion.buyTile(selectedTile);UncivGame.Current.setScreen(CityScreen(city)) }, cityScreen).open()
|
||||
}
|
||||
if((goldCostOfTile>city.civInfo.gold && !city.civInfo.gameInfo.gameParameters.godMode)
|
||||
|| city.isPuppet
|
||||
|
@ -49,7 +51,6 @@ class CityScreenTileTable(val cityScreen: CityScreen): Table(){
|
|||
buyTileButton.disable()
|
||||
|
||||
innerTable.add(buyTileButton).row()
|
||||
innerTable.add("You have [${city.civInfo.gold}] gold".toLabel(Color.YELLOW, 16)).padTop(2f)
|
||||
}
|
||||
|
||||
if(city.civInfo.cities.filterNot { it==city }
|
||||
|
|
|
@ -21,7 +21,7 @@ class CityStatsTable(val cityScreen: CityScreen): Table() {
|
|||
background = ImageGetter.getBackground(colorFromRGB(194,180,131))
|
||||
|
||||
innerTable.pad(5f)
|
||||
innerTable.defaults().pad(5f)
|
||||
innerTable.defaults().pad(2f)
|
||||
innerTable.background = ImageGetter.getBackground(Color.BLACK.cpy().apply { a=0.8f })
|
||||
|
||||
add(innerTable).fill()
|
||||
|
@ -30,12 +30,11 @@ class CityStatsTable(val cityScreen: CityScreen): Table() {
|
|||
fun update() {
|
||||
innerTable.clear()
|
||||
|
||||
val ministatsTable = Table().pad(5f)
|
||||
ministatsTable.defaults()
|
||||
val ministatsTable = Table()
|
||||
for(stat in cityInfo.cityStats.currentCityStats.toHashMap()) {
|
||||
if(stat.key == Stat.Happiness || stat.key == Stat.Faith) continue
|
||||
ministatsTable.add(ImageGetter.getStatIcon(stat.key.name)).size(20f).padRight(3f)
|
||||
ministatsTable.add(round(stat.value).toInt().toString().toLabel()).padRight(13f)
|
||||
ministatsTable.add(ImageGetter.getStatIcon(stat.key.name)).size(20f).padRight(5f)
|
||||
ministatsTable.add(round(stat.value).toInt().toString().toLabel()).padRight(10f)
|
||||
}
|
||||
innerTable.add(ministatsTable)
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ class ConstructionInfoTable(val city: CityInfo): Table() {
|
|||
|
||||
fun update(selectedConstruction: IConstruction?) {
|
||||
selectedConstructionTable.clear()
|
||||
selectedConstructionTable.pad(20f)
|
||||
selectedConstructionTable.pad(5f)
|
||||
|
||||
if (selectedConstruction == null) {
|
||||
isVisible = false
|
||||
|
@ -62,21 +62,16 @@ class ConstructionInfoTable(val city: CityInfo): Table() {
|
|||
selectedConstructionTable.add(buildingText.toLabel()).row()
|
||||
|
||||
|
||||
val description: String
|
||||
if (construction is BaseUnit)
|
||||
description = construction.getDescription(true)
|
||||
else if (construction is Building)
|
||||
description = construction.getDescription(true, city.civInfo, city.civInfo.gameInfo.ruleSet)
|
||||
else if(construction is PerpetualConstruction)
|
||||
description = construction.description.replace("[rate]","[${construction.getConversionRate(city)}]") .tr()
|
||||
else description="" // Should never happen
|
||||
val description: String = when (construction) {
|
||||
is BaseUnit -> construction.getDescription(true)
|
||||
is Building -> construction.getDescription(true, city.civInfo, city.civInfo.gameInfo.ruleSet)
|
||||
is PerpetualConstruction -> construction.description.replace("[rate]","[${construction.getConversionRate(city)}]") .tr()
|
||||
else -> "" // Should never happen
|
||||
}
|
||||
|
||||
val descriptionLabel = description.toLabel()
|
||||
descriptionLabel.setWrap(true)
|
||||
descriptionLabel.width = stage.width / 4
|
||||
|
||||
val descriptionScroll = ScrollPane(descriptionLabel)
|
||||
selectedConstructionTable.add(descriptionScroll).colspan(2).width(stage.width / 4).height(stage.height / 8)
|
||||
selectedConstructionTable.add(descriptionLabel).colspan(2).width(stage.width / 4)
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -342,7 +342,7 @@ class ConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBaseScre
|
|||
button.disable()
|
||||
cityScreen.closeAllPopups()
|
||||
|
||||
val purchasePrompt = "Currently you have [${city.civInfo.gold}] gold.".tr() + "\n\n" +
|
||||
val purchasePrompt = "Currently you have [${city.civInfo.gold}] gold.".tr() + "\n" +
|
||||
"Would you like to purchase [${construction.name}] for [$constructionGoldCost] gold?".tr()
|
||||
YesNoPopup(purchasePrompt, { purchaseConstruction(construction) }, cityScreen, { cityScreen.update() }).open()
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ class EmpireOverviewScreen(private var viewingPlayer:CivilizationInfo, defaultPa
|
|||
civTable.background = ImageGetter.getBackground(Color.BLACK)
|
||||
civTable.add("[${relevantCivs.size}] Civilizations in the game".toLabel()).pad(5f).colspan(4).row()
|
||||
val titleTable = Table()
|
||||
titleTable.add("Our Civilization:".toLabel()).pad(5f)
|
||||
titleTable.add("Our Civilization:".toLabel())
|
||||
titleTable.add(ImageGetter.getNationIndicator(viewingPlayer.nation,25f)).pad(5f)
|
||||
titleTable.add(viewingPlayer.civName.toLabel()).left().row()
|
||||
civTable.add(titleTable).colspan(4).row()
|
||||
|
|
|
@ -3,10 +3,10 @@ package com.unciv.ui.utils
|
|||
import com.unciv.UncivGame
|
||||
|
||||
class YesNoPopup(question:String, action:()->Unit,
|
||||
screen: CameraStageBaseScreen = UncivGame.Current.worldScreen, restoredefault:()->Unit = {}) : Popup(screen){
|
||||
screen: CameraStageBaseScreen = UncivGame.Current.worldScreen, restoreDefault:()->Unit = {}) : Popup(screen){
|
||||
init{
|
||||
add(question.toLabel()).colspan(2).row()
|
||||
add("No".toTextButton().onClick { close(); restoredefault() })
|
||||
add("No".toTextButton().onClick { close(); restoreDefault() })
|
||||
add("Yes".toTextButton().onClick { close(); action() })
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,12 +2,9 @@ package com.unciv.ui.worldscreen
|
|||
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.math.Vector2
|
||||
import com.badlogic.gdx.scenes.scene2d.Event
|
||||
import com.badlogic.gdx.scenes.scene2d.Group
|
||||
import com.badlogic.gdx.scenes.scene2d.InputListener
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Image
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Table
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane
|
||||
import com.badlogic.gdx.utils.Align
|
||||
import com.unciv.UncivGame
|
||||
import com.unciv.logic.HexMath
|
||||
|
@ -18,21 +15,12 @@ import com.unciv.ui.utils.onClick
|
|||
import com.unciv.ui.utils.surroundWithCircle
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
import kotlin.math.sqrt
|
||||
|
||||
class Minimap(val mapHolder: WorldMapHolder) : ScrollPane(null){
|
||||
val allTiles = Group()
|
||||
val tileImages = HashMap<TileInfo, Image>()
|
||||
|
||||
|
||||
fun setScrollTomapHolder(){
|
||||
scrollPercentX = mapHolder.scrollPercentX
|
||||
scrollPercentY = mapHolder.scrollPercentY
|
||||
}
|
||||
class Minimap(val mapHolder: WorldMapHolder) : Table(){
|
||||
private val allTiles = Group()
|
||||
private val tileImages = HashMap<TileInfo, Image>()
|
||||
|
||||
init {
|
||||
setScrollingDisabled(true, true)
|
||||
|
||||
var topX = 0f
|
||||
var topY = 0f
|
||||
var bottomX = 0f
|
||||
|
@ -55,7 +43,6 @@ class Minimap(val mapHolder: WorldMapHolder) : ScrollPane(null){
|
|||
positionalVector.y * 0.5f * groupSize)
|
||||
hex.onClick {
|
||||
mapHolder.setCenterPosition(tileInfo.position)
|
||||
setScrollTomapHolder()
|
||||
}
|
||||
allTiles.addActor(hex)
|
||||
tileImages[tileInfo] = hex
|
||||
|
@ -74,15 +61,8 @@ class Minimap(val mapHolder: WorldMapHolder) : ScrollPane(null){
|
|||
// so we zero out the starting position of the whole board so they will be displayed as well
|
||||
allTiles.setSize(topX - bottomX, topY - bottomY)
|
||||
|
||||
actor = allTiles
|
||||
add(allTiles)
|
||||
layout()
|
||||
updateVisualScroll()
|
||||
mapHolder.addListener(object : InputListener() {
|
||||
override fun handle(e: Event?): Boolean {
|
||||
setScrollTomapHolder()
|
||||
return true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun update(cloneCivilization: CivilizationInfo) {
|
||||
|
@ -100,7 +80,6 @@ class Minimap(val mapHolder: WorldMapHolder) : ScrollPane(null){
|
|||
nationIcon.setPosition(hex.x - nationIcon.width/3,hex.y - nationIcon.height/3)
|
||||
nationIcon.onClick {
|
||||
mapHolder.setCenterPosition(tileInfo.position)
|
||||
setScrollTomapHolder()
|
||||
}
|
||||
allTiles.addActor(nationIcon)
|
||||
}
|
||||
|
@ -118,7 +97,7 @@ class MinimapHolder(mapHolder: WorldMapHolder): Table(){
|
|||
pack()
|
||||
}
|
||||
|
||||
fun getWrappedMinimap(): Table {
|
||||
private fun getWrappedMinimap(): Table {
|
||||
val internalMinimapWrapper = Table()
|
||||
// // Temporarily disabled until we can make them work nicely together
|
||||
// val sizePercent = worldScreen.game.settings.minimapSize
|
||||
|
@ -141,7 +120,7 @@ class MinimapHolder(mapHolder: WorldMapHolder): Table(){
|
|||
return externalMinimapWrapper
|
||||
}
|
||||
|
||||
fun getToggleIcons():Table{
|
||||
private fun getToggleIcons():Table{
|
||||
val toggleIconTable=Table()
|
||||
val settings = UncivGame.Current.settings
|
||||
|
||||
|
|
Loading…
Reference in a new issue