mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 22:06:05 -04:00
Nuclear Weapon setting moved to Options, s it can be more easily explored by players
This commit is contained in:
parent
dd28711ee7
commit
b1868accc5
Binary file not shown.
Before Width: | Height: | Size: 511 B After Width: | Height: | Size: 885 B |
BIN
android/Images/TileSets/FantasyHex/Tiles/Pasture2.png
Normal file
BIN
android/Images/TileSets/FantasyHex/Tiles/Pasture2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 594 B |
BIN
android/Images/TileSets/FantasyHex/Units/Cruiser.png
Normal file
BIN
android/Images/TileSets/FantasyHex/Units/Cruiser.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 341 B |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 274 KiB After Width: | Height: | Size: 275 KiB |
@ -74,7 +74,7 @@ class Technology {
|
|||||||
val replacedBuildings = enabledBuildings.mapNotNull { it.replaces }
|
val replacedBuildings = enabledBuildings.mapNotNull { it.replaces }
|
||||||
enabledBuildings = enabledBuildings.filter { it.name !in replacedBuildings }
|
enabledBuildings = enabledBuildings.filter { it.name !in replacedBuildings }
|
||||||
|
|
||||||
if (!civInfo.gameInfo.gameParameters.nuclearWeaponEnabled)
|
if (!UnCivGame.Current.settings.nuclearWeaponEnabled)
|
||||||
enabledBuildings=enabledBuildings.filterNot { it.name=="Manhattan Project" }
|
enabledBuildings=enabledBuildings.filterNot { it.name=="Manhattan Project" }
|
||||||
|
|
||||||
return enabledBuildings
|
return enabledBuildings
|
||||||
@ -88,7 +88,7 @@ class Technology {
|
|||||||
val replacedUnits = enabledUnits.mapNotNull { it.replaces }
|
val replacedUnits = enabledUnits.mapNotNull { it.replaces }
|
||||||
enabledUnits = enabledUnits.filter { it.name !in replacedUnits }
|
enabledUnits = enabledUnits.filter { it.name !in replacedUnits }
|
||||||
|
|
||||||
if (!civInfo.gameInfo.gameParameters.nuclearWeaponEnabled)
|
if (!UnCivGame.Current.settings.nuclearWeaponEnabled)
|
||||||
enabledUnits=enabledUnits.filterNot { it.uniques.contains("Requires Manhattan Project") }
|
enabledUnits=enabledUnits.filterNot { it.uniques.contains("Requires Manhattan Project") }
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.unciv.models.gamebasics.unit
|
package com.unciv.models.gamebasics.unit
|
||||||
|
|
||||||
import com.unciv.Constants
|
import com.unciv.Constants
|
||||||
|
import com.unciv.UnCivGame
|
||||||
import com.unciv.logic.city.CityConstructions
|
import com.unciv.logic.city.CityConstructions
|
||||||
import com.unciv.logic.city.IConstruction
|
import com.unciv.logic.city.IConstruction
|
||||||
import com.unciv.logic.civilization.CivilizationInfo
|
import com.unciv.logic.civilization.CivilizationInfo
|
||||||
@ -131,7 +132,7 @@ class BaseUnit : INamed, IConstruction {
|
|||||||
if (obsoleteTech!=null && civInfo.tech.isResearched(obsoleteTech!!)) return "Obsolete by $obsoleteTech"
|
if (obsoleteTech!=null && civInfo.tech.isResearched(obsoleteTech!!)) return "Obsolete by $obsoleteTech"
|
||||||
if (uniqueTo!=null && uniqueTo!=civInfo.civName) return "Unique to $uniqueTo"
|
if (uniqueTo!=null && uniqueTo!=civInfo.civName) return "Unique to $uniqueTo"
|
||||||
if (GameBasics.Units.values.any { it.uniqueTo==civInfo.civName && it.replaces==name }) return "Our unique unit replaces this"
|
if (GameBasics.Units.values.any { it.uniqueTo==civInfo.civName && it.replaces==name }) return "Our unique unit replaces this"
|
||||||
if (!civInfo.gameInfo.gameParameters.nuclearWeaponEnabled
|
if (!UnCivGame.Current.settings.nuclearWeaponEnabled
|
||||||
&& (name == "Manhattan Project" || uniques.contains("Requires Manhattan Project"))) return "Disabled by setting"
|
&& (name == "Manhattan Project" || uniques.contains("Requires Manhattan Project"))) return "Disabled by setting"
|
||||||
if (uniques.contains("Requires Manhattan Project") && !civInfo.containsBuildingUnique("Enables nuclear weapon"))
|
if (uniques.contains("Requires Manhattan Project") && !civInfo.containsBuildingUnique("Enables nuclear weapon"))
|
||||||
return "Requires Manhattan Project"
|
return "Requires Manhattan Project"
|
||||||
|
@ -17,7 +17,6 @@ class GameParameters { // Default values are the default new game
|
|||||||
var mapType = MapType.pangaea
|
var mapType = MapType.pangaea
|
||||||
var noBarbarians = false
|
var noBarbarians = false
|
||||||
var oneCityChallenge = false
|
var oneCityChallenge = false
|
||||||
var nuclearWeaponEnabled = false
|
|
||||||
var noRuins = false;
|
var noRuins = false;
|
||||||
var mapFileName: String? = null
|
var mapFileName: String? = null
|
||||||
var victoryTypes: ArrayList<VictoryType> = VictoryType.values().toCollection(ArrayList()) // By default, all victory types
|
var victoryTypes: ArrayList<VictoryType> = VictoryType.values().toCollection(ArrayList()) // By default, all victory types
|
||||||
|
@ -21,6 +21,7 @@ class GameSettings {
|
|||||||
var showMinimap: Boolean = true
|
var showMinimap: Boolean = true
|
||||||
var showPixelUnits: Boolean = false
|
var showPixelUnits: Boolean = false
|
||||||
var showPixelImprovements: Boolean = false
|
var showPixelImprovements: Boolean = false
|
||||||
|
var nuclearWeaponEnabled = false
|
||||||
|
|
||||||
var userId = ""
|
var userId = ""
|
||||||
|
|
||||||
|
@ -28,9 +28,7 @@ class NewGameScreenOptionsTable(val newGameParameters: GameParameters, val onMul
|
|||||||
addVictoryTypeCheckboxes()
|
addVictoryTypeCheckboxes()
|
||||||
addBarbariansCheckbox()
|
addBarbariansCheckbox()
|
||||||
addOneCityChallengeCheckbox()
|
addOneCityChallengeCheckbox()
|
||||||
addNuclearWeaponCheckbox()
|
|
||||||
addNoRuinsCheckbox()
|
addNoRuinsCheckbox()
|
||||||
|
|
||||||
addIsOnlineMultiplayerCheckbox()
|
addIsOnlineMultiplayerCheckbox()
|
||||||
|
|
||||||
pack()
|
pack()
|
||||||
@ -58,18 +56,6 @@ class NewGameScreenOptionsTable(val newGameParameters: GameParameters, val onMul
|
|||||||
add(oneCityChallengeCheckbox).colspan(2).row()
|
add(oneCityChallengeCheckbox).colspan(2).row()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun addNuclearWeaponCheckbox() {
|
|
||||||
add("HIGHLY EXPERIMENTAL - YOU HAVE BEEN WARNED!".tr()).colspan(2).row()
|
|
||||||
val nuclearWeaponCheckbox = CheckBox("Enable nuclear weapon".tr(), CameraStageBaseScreen.skin)
|
|
||||||
nuclearWeaponCheckbox.isChecked = newGameParameters.nuclearWeaponEnabled
|
|
||||||
nuclearWeaponCheckbox.addListener(object : ChangeListener() {
|
|
||||||
override fun changed(event: ChangeEvent?, actor: Actor?) {
|
|
||||||
newGameParameters.nuclearWeaponEnabled = nuclearWeaponCheckbox.isChecked
|
|
||||||
}
|
|
||||||
})
|
|
||||||
add(nuclearWeaponCheckbox).colspan(2).row()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun addNoRuinsCheckbox() {
|
private fun addNoRuinsCheckbox() {
|
||||||
val noRuinsCheckbox = CheckBox("No ancient ruins".tr(), CameraStageBaseScreen.skin)
|
val noRuinsCheckbox = CheckBox("No ancient ruins".tr(), CameraStageBaseScreen.skin)
|
||||||
noRuinsCheckbox.isChecked = newGameParameters.noRuins
|
noRuinsCheckbox.isChecked = newGameParameters.noRuins
|
||||||
|
@ -29,8 +29,8 @@ class TechButton(techName:String, val techManager: TechManager, isWorldScreen: B
|
|||||||
add(ImageGetter.getProgressBarVertical(2f, 50f, percentComplete, Color.BLUE, Color.WHITE))
|
add(ImageGetter.getProgressBarVertical(2f, 50f, percentComplete, Color.BLUE, Color.WHITE))
|
||||||
} else add().width(2f)
|
} else add().width(2f)
|
||||||
|
|
||||||
if (isWorldScreen) rightSide.add(text).row()
|
if (isWorldScreen) rightSide.add(text).padBottom(5f).row()
|
||||||
else rightSide.add(text).height(25f).row()
|
else rightSide.add(text).height(25f).padBottom(5f).row()
|
||||||
|
|
||||||
addTechEnabledIcons(techName, isWorldScreen, rightSide)
|
addTechEnabledIcons(techName, isWorldScreen, rightSide)
|
||||||
|
|
||||||
|
@ -104,6 +104,12 @@ class WorldScreenOptionsTable(val worldScreen:WorldScreen) : PopupTable(worldScr
|
|||||||
update()
|
update()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
innerTable.add("Enable nuclear weapons".toLabel())
|
||||||
|
innerTable.addButton(if (settings.nuclearWeaponEnabled) "Yes".tr() else "No".tr()) {
|
||||||
|
settings.nuclearWeaponEnabled = !settings.nuclearWeaponEnabled
|
||||||
|
update()
|
||||||
|
}
|
||||||
|
|
||||||
addLanguageSelectBox(innerTable)
|
addLanguageSelectBox(innerTable)
|
||||||
|
|
||||||
addResolutionSelectBox(innerTable)
|
addResolutionSelectBox(innerTable)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user