mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-04 23:40:01 +07:00
Resolved #595 - Added release version to options table
This commit is contained in:
@ -11,6 +11,7 @@ public class AndroidLauncher extends AndroidApplication {
|
|||||||
protected void onCreate (Bundle savedInstanceState) {
|
protected void onCreate (Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
|
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
|
||||||
initialize(new UnCivGame(), config);
|
String version = BuildConfig.VERSION_NAME;
|
||||||
|
initialize(new UnCivGame(version), config);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -9,7 +9,7 @@ import com.unciv.ui.LanguagePickerScreen
|
|||||||
import com.unciv.ui.utils.ImageGetter
|
import com.unciv.ui.utils.ImageGetter
|
||||||
import com.unciv.ui.worldscreen.WorldScreen
|
import com.unciv.ui.worldscreen.WorldScreen
|
||||||
|
|
||||||
class UnCivGame : Game() {
|
class UnCivGame(val version: String) : Game() {
|
||||||
var gameInfo: GameInfo = GameInfo()
|
var gameInfo: GameInfo = GameInfo()
|
||||||
lateinit var settings : GameSettings
|
lateinit var settings : GameSettings
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ class Automation {
|
|||||||
&& cityInfo.getTiles().any { it.isWater() && it.hasViewableResource(cityInfo.civInfo) && it.improvement == null }
|
&& cityInfo.getTiles().any { it.isWater() && it.hasViewableResource(cityInfo.civInfo) && it.improvement == null }
|
||||||
|
|
||||||
val isAtWar = cityInfo.civInfo.isAtWar()
|
val isAtWar = cityInfo.civInfo.isAtWar()
|
||||||
val cityProduction = cityInfo.cityStats.currentCityStats.production.toFloat()
|
val cityProduction = cityInfo.cityStats.currentCityStats.production
|
||||||
|
|
||||||
var buildingValues = HashMap<String, Float>()
|
var buildingValues = HashMap<String, Float>()
|
||||||
//Food buildings : Granary and lighthouse and hospital
|
//Food buildings : Granary and lighthouse and hospital
|
||||||
@ -136,7 +136,7 @@ class Automation {
|
|||||||
//Wonders
|
//Wonders
|
||||||
if (buildableWonders.isNotEmpty()) {
|
if (buildableWonders.isNotEmpty()) {
|
||||||
val citiesBuildingWonders = cityInfo.civInfo.cities
|
val citiesBuildingWonders = cityInfo.civInfo.cities
|
||||||
.filter { it.cityConstructions.isBuildingWonder() }.size
|
.count { it.cityConstructions.isBuildingWonder() }
|
||||||
val wonder = buildableWonders.getRandom()
|
val wonder = buildableWonders.getRandom()
|
||||||
buildingValues[wonder.name] = wonder.cost / cityProduction * (citiesBuildingWonders + 1) / 5.0f
|
buildingValues[wonder.name] = wonder.cost / cityProduction * (citiesBuildingWonders + 1) / 5.0f
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import com.badlogic.gdx.scenes.scene2d.ui.Button
|
|||||||
import com.unciv.UnCivGame
|
import com.unciv.UnCivGame
|
||||||
import com.unciv.logic.civilization.GreatPersonManager
|
import com.unciv.logic.civilization.GreatPersonManager
|
||||||
import com.unciv.models.gamebasics.GameBasics
|
import com.unciv.models.gamebasics.GameBasics
|
||||||
import com.unciv.models.gamebasics.tr
|
|
||||||
import com.unciv.models.gamebasics.unit.BaseUnit
|
import com.unciv.models.gamebasics.unit.BaseUnit
|
||||||
import com.unciv.ui.utils.ImageGetter
|
import com.unciv.ui.utils.ImageGetter
|
||||||
import com.unciv.ui.utils.onClick
|
import com.unciv.ui.utils.onClick
|
||||||
|
@ -68,7 +68,6 @@ class CityButton(val city: CityInfo, internal val tileGroup: WorldTileGroup, ski
|
|||||||
}
|
}
|
||||||
pack()
|
pack()
|
||||||
setOrigin(Align.center)
|
setOrigin(Align.center)
|
||||||
toFront()
|
|
||||||
touchable = Touchable.enabled
|
touchable = Touchable.enabled
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -60,6 +60,9 @@ class WorldScreenOptionsTable(screen:WorldScreen) : PopupTable(screen){
|
|||||||
|
|
||||||
addSoundEffectsVolumeSlider()
|
addSoundEffectsVolumeSlider()
|
||||||
|
|
||||||
|
add("Version".toLabel())
|
||||||
|
add(UnCivGame.Current.version.toLabel()).row()
|
||||||
|
|
||||||
addButton("Close"){ remove() }
|
addButton("Close"){ remove() }
|
||||||
|
|
||||||
pack() // Needed to show the background.
|
pack() // Needed to show the background.
|
||||||
|
@ -20,6 +20,6 @@ class DesktopLauncher {
|
|||||||
TexturePacker.process(settings, "../images", ".", "game");
|
TexturePacker.process(settings, "../images", ".", "game");
|
||||||
|
|
||||||
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
|
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
|
||||||
new LwjglApplication(new UnCivGame(), config);
|
new LwjglApplication(new UnCivGame("Desktop"), config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ class IOSLauncher extends IOSApplication.Delegate {
|
|||||||
@Override
|
@Override
|
||||||
protected IOSApplication createApplication() {
|
protected IOSApplication createApplication() {
|
||||||
IOSApplicationConfiguration config = new IOSApplicationConfiguration();
|
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) {
|
public static void main(String[] argv) {
|
Reference in New Issue
Block a user