From 307bccb7d076d490d2cf92d1257d42604c964a98 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Fri, 13 Dec 2019 14:31:42 +0200 Subject: [PATCH] Added tutorial task for viewing stats breakdown Added an animation to "Pick language" on the language picker screen, because someone actually got stuck on that 0_0 --- core/src/com/unciv/logic/civilization/CivInfoStats.kt | 3 ++- core/src/com/unciv/ui/EmpireOverviewScreen.kt | 1 + core/src/com/unciv/ui/LanguagePickerScreen.kt | 6 ++++++ core/src/com/unciv/ui/worldscreen/WorldScreen.kt | 3 +++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/logic/civilization/CivInfoStats.kt b/core/src/com/unciv/logic/civilization/CivInfoStats.kt index 6acc5f46d5..67da7b9c42 100644 --- a/core/src/com/unciv/logic/civilization/CivInfoStats.kt +++ b/core/src/com/unciv/logic/civilization/CivInfoStats.kt @@ -17,7 +17,8 @@ class CivInfoStats(val civInfo: CivilizationInfo){ val baseUnitCost = 0.5f val freeUnits = 3 var unitsToPayFor = civInfo.getCivUnits() - if(civInfo.policies.isAdopted("Oligarchy")) unitsToPayFor = unitsToPayFor.filterNot { it.getTile().isCityCenter() } + if(civInfo.policies.isAdopted("Oligarchy")) + unitsToPayFor = unitsToPayFor.filterNot { it.getTile().isCityCenter() } var numberOfUnitsToPayFor = max(0f, unitsToPayFor.count().toFloat() - freeUnits) if(civInfo.nation.unique=="67% chance to earn 25 Gold and recruit a Barbarian unit from a conquered encampment, -25% land units maintenance."){ diff --git a/core/src/com/unciv/ui/EmpireOverviewScreen.kt b/core/src/com/unciv/ui/EmpireOverviewScreen.kt index 81ce454f90..e383686ab9 100644 --- a/core/src/com/unciv/ui/EmpireOverviewScreen.kt +++ b/core/src/com/unciv/ui/EmpireOverviewScreen.kt @@ -44,6 +44,7 @@ class EmpireOverviewScreen : CameraStageBaseScreen(){ val setStatsInfoButton = TextButton("Stats".tr(),skin) setStatsInfoButton.onClick { + game.settings.addCompletedTutorialTask("See your stats breakdown") centerTable.clear() centerTable.add(ScrollPane(Table().apply { defaults().pad(40f) diff --git a/core/src/com/unciv/ui/LanguagePickerScreen.kt b/core/src/com/unciv/ui/LanguagePickerScreen.kt index 2b4a939143..e5dc771821 100644 --- a/core/src/com/unciv/ui/LanguagePickerScreen.kt +++ b/core/src/com/unciv/ui/LanguagePickerScreen.kt @@ -2,6 +2,7 @@ package com.unciv.ui import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.scenes.scene2d.Touchable +import com.badlogic.gdx.scenes.scene2d.actions.Actions import com.badlogic.gdx.scenes.scene2d.ui.Label import com.badlogic.gdx.scenes.scene2d.ui.Table import com.unciv.UncivGame @@ -69,6 +70,11 @@ class LanguagePickerScreen: PickerScreen(){ it.onClick { chosenLanguage = it.language rightSideButton.enable() + rightSideButton.clearActions() + rightSideButton.addAction(Actions.forever(Actions.sequence( + Actions.color(Color.GREEN,0.5f), + Actions.color(Color.WHITE,0.5f) + ))) update() } topTable.add(it).pad(10f).row() diff --git a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt index 2e8f140233..06d39684fb 100644 --- a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt +++ b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt @@ -252,6 +252,9 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() { if(viewingCiv.getCivUnits().any { it.type.isAirUnit() } && !completedTasks.contains("Move an air unit")) return "Move an air unit!\nSelect an air unit > select another city withing range > " + "\nMove the unit to the other city" + if(!completedTasks.contains("See your stats breakdown")) + return "See your stats breakdown!\nEnter the Overview screen (top right corner) >" + + "\nClick on 'Stats'" return "" }