mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-11 00:08:58 +07:00
Resolved #1364 - Policy picker screen won't appear from the world screen if there are no possible policies to pick
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -136,3 +136,4 @@ android/assets/maps/
|
|||||||
android/release/android.aab.sig
|
android/release/android.aab.sig
|
||||||
android/release/android-release.aab
|
android/release/android-release.aab
|
||||||
tests/build/
|
tests/build/
|
||||||
|
desktop/packr/
|
||||||
|
@ -50,7 +50,15 @@ class PolicyManager {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
fun canAdoptPolicy(): Boolean = freePolicies > 0 || storedCulture >= getCultureNeededForNextPolicy()
|
fun canAdoptPolicy(): Boolean {
|
||||||
|
if (freePolicies == 0 && storedCulture < getCultureNeededForNextPolicy())
|
||||||
|
return false
|
||||||
|
|
||||||
|
val hasAdoptablePolicies = GameBasics.PolicyBranches.values
|
||||||
|
.flatMap { it.policies.union(listOf(it)) }
|
||||||
|
.any { civInfo.policies.isAdoptable(it) }
|
||||||
|
return hasAdoptablePolicies
|
||||||
|
}
|
||||||
|
|
||||||
fun adopt(policy: Policy, branchCompletion: Boolean = false) {
|
fun adopt(policy: Policy, branchCompletion: Boolean = false) {
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() {
|
|||||||
if(!isSomethingOpen && isPlayersTurn) {
|
if(!isSomethingOpen && isPlayersTurn) {
|
||||||
when {
|
when {
|
||||||
!gameInfo.oneMoreTurnMode && gameInfo.civilizations.any { it.victoryManager.hasWon() } -> game.setScreen(VictoryScreen())
|
!gameInfo.oneMoreTurnMode && gameInfo.civilizations.any { it.victoryManager.hasWon() } -> game.setScreen(VictoryScreen())
|
||||||
viewingCiv.policies.freePolicies > 0 -> game.setScreen(PolicyPickerScreen(this))
|
viewingCiv.policies.freePolicies > 0 && viewingCiv.policies.canAdoptPolicy() -> game.setScreen(PolicyPickerScreen(this))
|
||||||
viewingCiv.greatPeople.freeGreatPeople > 0 -> game.setScreen(GreatPersonPickerScreen())
|
viewingCiv.greatPeople.freeGreatPeople > 0 -> game.setScreen(GreatPersonPickerScreen())
|
||||||
viewingCiv.popupAlerts.any() -> AlertPopup(this, viewingCiv.popupAlerts.first())
|
viewingCiv.popupAlerts.any() -> AlertPopup(this, viewingCiv.popupAlerts.first())
|
||||||
viewingCiv.tradeRequests.isNotEmpty() -> TradePopup(this)
|
viewingCiv.tradeRequests.isNotEmpty() -> TradePopup(this)
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
import com.badlogicgames.packr.Packr
|
||||||
|
import com.badlogicgames.packr.PackrConfig
|
||||||
|
|
||||||
apply plugin: "kotlin"
|
apply plugin: "kotlin"
|
||||||
|
|
||||||
sourceCompatibility = 1.6
|
sourceCompatibility = 1.6
|
||||||
@ -39,20 +42,20 @@ task dist(dependsOn: classes, type: Jar) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//task packrWindows(){
|
task packrWindows(){
|
||||||
// PackrConfig config = new PackrConfig();
|
PackrConfig config = new PackrConfig()
|
||||||
// config.platform = PackrConfig.Platform.Windows32;
|
config.platform = PackrConfig.Platform.Windows64
|
||||||
// config.jdk = "/User/badlogic/Downloads/openjdk-for-mac.zip";
|
config.jdk = "https://github.com/ojdkbuild/ojdkbuild/releases/download/java-1.8.0-openjdk-1.8.0.232-1.b09/java-1.8.0-openjdk-1.8.0.232-1.b09.ojdkbuild.windows.x86_64.zip"
|
||||||
// config.executable = "myapp";
|
config.executable = "Unciv"
|
||||||
// config.classpath = Arrays.asList("myjar.jar");
|
config.classpath = Arrays.asList("desktop/build/libs/${appName}.jar".toString())
|
||||||
// config.removePlatformLibs = config.classpath;
|
config.removePlatformLibs = config.classpath
|
||||||
// config.mainClass = "com.my.app.MainClass";
|
config.mainClass = project.ext.mainClassName
|
||||||
// config.vmArgs = Arrays.asList("Xmx1G");
|
config.vmArgs = Arrays.asList("Xmx1G")
|
||||||
// config.minimizeJre = "soft";
|
config.minimizeJre = "soft"
|
||||||
// config.outDir = new File("out-mac");
|
config.outDir = new File("desktop/packr")
|
||||||
//
|
|
||||||
// new Packr().pack(config);
|
new Packr().pack(config)
|
||||||
//}
|
}
|
||||||
|
|
||||||
eclipse {
|
eclipse {
|
||||||
project {
|
project {
|
||||||
@ -71,8 +74,3 @@ task afterEclipseImport(description: "Post processing after project generation",
|
|||||||
printer.print(classpath)
|
printer.print(classpath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
|
||||||
//dependencies {
|
|
||||||
// implementation "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
|
|
||||||
// implementation project(path: ':core')
|
|
||||||
//}
|
|
@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"classPath": [
|
|
||||||
"myjar.jar"
|
|
||||||
],
|
|
||||||
"mainClass": "com.my.app.MainClass",
|
|
||||||
"vmArgs": [
|
|
||||||
"-Xmx1G"
|
|
||||||
]
|
|
||||||
}
|
|
Reference in New Issue
Block a user