Resolved #595 - Added release version to options table

This commit is contained in:
Yair Morgenstern 2019-03-21 22:46:49 +02:00
parent 1dc6a2cf2d
commit 69d3703543
8 changed files with 10 additions and 8 deletions

View file

@ -11,6 +11,7 @@ public class AndroidLauncher extends AndroidApplication {
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
initialize(new UnCivGame(), config);
String version = BuildConfig.VERSION_NAME;
initialize(new UnCivGame(version), config);
}
}

View file

@ -9,7 +9,7 @@ import com.unciv.ui.LanguagePickerScreen
import com.unciv.ui.utils.ImageGetter
import com.unciv.ui.worldscreen.WorldScreen
class UnCivGame : Game() {
class UnCivGame(val version: String) : Game() {
var gameInfo: GameInfo = GameInfo()
lateinit var settings : GameSettings

View file

@ -82,7 +82,7 @@ class Automation {
&& cityInfo.getTiles().any { it.isWater() && it.hasViewableResource(cityInfo.civInfo) && it.improvement == null }
val isAtWar = cityInfo.civInfo.isAtWar()
val cityProduction = cityInfo.cityStats.currentCityStats.production.toFloat()
val cityProduction = cityInfo.cityStats.currentCityStats.production
var buildingValues = HashMap<String, Float>()
//Food buildings : Granary and lighthouse and hospital
@ -136,7 +136,7 @@ class Automation {
//Wonders
if (buildableWonders.isNotEmpty()) {
val citiesBuildingWonders = cityInfo.civInfo.cities
.filter { it.cityConstructions.isBuildingWonder() }.size
.count { it.cityConstructions.isBuildingWonder() }
val wonder = buildableWonders.getRandom()
buildingValues[wonder.name] = wonder.cost / cityProduction * (citiesBuildingWonders + 1) / 5.0f
}

View file

@ -5,7 +5,6 @@ import com.badlogic.gdx.scenes.scene2d.ui.Button
import com.unciv.UnCivGame
import com.unciv.logic.civilization.GreatPersonManager
import com.unciv.models.gamebasics.GameBasics
import com.unciv.models.gamebasics.tr
import com.unciv.models.gamebasics.unit.BaseUnit
import com.unciv.ui.utils.ImageGetter
import com.unciv.ui.utils.onClick

View file

@ -68,7 +68,6 @@ class CityButton(val city: CityInfo, internal val tileGroup: WorldTileGroup, ski
}
pack()
setOrigin(Align.center)
toFront()
touchable = Touchable.enabled
}

View file

@ -60,6 +60,9 @@ class WorldScreenOptionsTable(screen:WorldScreen) : PopupTable(screen){
addSoundEffectsVolumeSlider()
add("Version".toLabel())
add(UnCivGame.Current.version.toLabel()).row()
addButton("Close"){ remove() }
pack() // Needed to show the background.

View file

@ -20,6 +20,6 @@ class DesktopLauncher {
TexturePacker.process(settings, "../images", ".", "game");
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
new LwjglApplication(new UnCivGame(), config);
new LwjglApplication(new UnCivGame("Desktop"), config);
}
}

View file

@ -10,7 +10,7 @@ class IOSLauncher extends IOSApplication.Delegate {
@Override
protected IOSApplication createApplication() {
IOSApplicationConfiguration config = new IOSApplicationConfiguration();
return new IOSApplication(new com.unciv.UnCivGame(), config);
return new IOSApplication(new com.unciv.UnCivGame("IOS"), config);
}
public static void main(String[] argv) {