Future tech can now be constantly researched!

This commit is contained in:
Yair Morgenstern 2018-07-01 17:05:30 +03:00
parent 837195293c
commit 4593bed7dc
5 changed files with 24 additions and 14 deletions

View File

@ -294,6 +294,14 @@
German:"Aus ZWischenablage laden"
Dutch:"Gekopieerde data laden"
}
// New game screen
"Start game!":{}
"Civilization:":{}
"World size:":{}
"Number of enemies:":{}
"Victory status":{
Italian:"Stato di vittoria"

View File

@ -57,7 +57,8 @@ class TechManager {
// We finished it!
techsInProgress.remove(currentTechnology)
techsToResearch.remove(currentTechnology)
if(currentTechnology!="Future Tech")
techsToResearch.remove(currentTechnology)
techsResearched.add(currentTechnology)
civInfo.addNotification("Research of [$currentTechnology] has completed!", null, Color.BLUE)

View File

@ -11,6 +11,7 @@ import com.unciv.ui.pickerscreens.PickerScreen
import com.unciv.ui.utils.addClickListener
import com.unciv.ui.utils.disable
import com.unciv.ui.utils.enable
import com.unciv.ui.utils.tr
import com.unciv.ui.worldscreen.WorldScreen
class NewGameScreen: PickerScreen(){
@ -18,7 +19,7 @@ class NewGameScreen: PickerScreen(){
val table = Table()
table.skin= skin
table.add("Civilization: ")
table.add("Civilization:".tr())
val civSelectBox = SelectBox<String>(skin)
val civArray = Array<String>()
GameBasics.Civilizations.keys.filterNot { it=="Barbarians" }.forEach{civArray.add(it)}
@ -26,7 +27,7 @@ class NewGameScreen: PickerScreen(){
civSelectBox.selected = civSelectBox.items.first()
table.add(civSelectBox).pad(10f).row()
table.add("World size: ")
table.add("World size:".tr())
val worldSizeToRadius=LinkedHashMap<String,Int>()
worldSizeToRadius["Small"] = 10
worldSizeToRadius["Medium"] = 20
@ -39,7 +40,7 @@ class NewGameScreen: PickerScreen(){
table.add(worldSizeSelectBox).pad(10f).row()
table.add("Number of enemies: ")
table.add("Number of enemies:".tr())
val enemiesSelectBox = SelectBox<Int>(skin)
val enemiesArray=Array<Int>()
(1..5).forEach { enemiesArray.add(it) }
@ -48,11 +49,11 @@ class NewGameScreen: PickerScreen(){
table.add(enemiesSelectBox).pad(10f).row()
rightSideButton.enable()
rightSideButton.setText("Start game!")
rightSideButton.setText("Start game!".tr())
rightSideButton.addClickListener {
Gdx.input.inputProcessor = null // remove input processing - nothing will be clicked!
rightSideButton.disable()
rightSideButton.setText("Working...")
rightSideButton.setText("Working...".tr())
kotlin.concurrent.thread { // Creating a new game can tke a while and we don't want ANRs
newGame = GameStarter().startNewGame(

View File

@ -24,7 +24,7 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen()
// All these are to counter performance problems when updating buttons for all techs.
private var researchableTechs = GameBasics.Technologies.keys
.filter { civTech.canBeResearched(it) }.toHashSet()
private val LightBlue = Color.BLUE.cpy().lerp(Color.WHITE, 0.3f)
private val lightBlue = Color.BLUE.cpy().lerp(Color.WHITE, 0.3f)
private val turnsToTech = GameBasics.Technologies.values.associateBy ({ it.name },{civTech.turnsToTech(it.name)})
constructor(freeTechPick: Boolean, civInfo: CivilizationInfo) : this(civInfo) {
@ -88,17 +88,15 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen()
for (techName in techNameToButton.keys) {
val TB = techNameToButton[techName]!!
when {
civTech.isResearched(techName) -> TB.color = Color.GREEN
techsToResearch.contains(techName) -> TB.color = LightBlue
civTech.isResearched(techName) && techName!="Future Tech" -> TB.color = Color.GREEN
techsToResearch.contains(techName) -> TB.color = lightBlue
researchableTechs.contains(techName) -> TB.color = Color.WHITE
else -> TB.color = Color.BLACK
}
TB.isChecked = false
var text = techName.tr()
if (techName == selectedTech?.name) {
TB.isChecked = true
TB.color = TB.color.cpy().lerp(Color.LIGHT_GRAY, 0.5f)
}
@ -106,7 +104,9 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen()
text += " (" + techsToResearch.indexOf(techName) + ")"
}
if (!civTech.isResearched(techName)) text += "\r\n" + turnsToTech[techName] + " {turns}".tr()
if (!civTech.isResearched(techName) || techName=="Future Tech")
text += "\r\n" + turnsToTech[techName] + " {turns}".tr()
TB.setText(text)
}
}
@ -119,7 +119,7 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen()
return
}
if (civTech.isResearched(tech.name)) {
if (civTech.isResearched(tech.name) && tech.name!="Future Tech") {
rightSideButton.setText("Pick a tech".tr())
rightSideButton.disable()
setButtonsInfo()

View File

@ -122,7 +122,7 @@ class WorldScreen : CameraStageBaseScreen() {
Gdx.input.inputProcessor = null // remove input processing - nothing will be clicked!
nextTurnButton.disable()
nextTurnButton.setText("Working...")
nextTurnButton.setText("Working...".tr())
kotlin.concurrent.thread {
game.gameInfo.nextTurn()