mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-24 03:53:12 -04:00
fixed even more warnings (#8428)
* unused parameter `tile` * unchecked cast KMutableProperty0 * replaced Enum.declaringClass with declaringJavaClass to avoid errors in Kotlin 1.9 * removed unused parameter 'previousScreen' * removed usages of deprecated `religionEnabled`
This commit is contained in:
parent
e8fde017fe
commit
35a60d4903
@ -162,7 +162,7 @@ class MainMenuScreen: BaseScreen(), RecreateOnResize {
|
||||
|
||||
if (game.files.getSaves().any()) {
|
||||
val loadGameTable = getMenuButton("Load game", "OtherIcons/Load", 'l')
|
||||
{ game.pushScreen(LoadGameScreen(this)) }
|
||||
{ game.pushScreen(LoadGameScreen()) }
|
||||
column1.add(loadGameTable).row()
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ class TacticalDominanceZone {
|
||||
return id.startsWith('-')
|
||||
}
|
||||
|
||||
fun extend(tile: TileInfo) {
|
||||
fun extend() {
|
||||
tileCount += 1
|
||||
}
|
||||
}
|
||||
@ -214,7 +214,7 @@ class TacticalAnalysisMap {
|
||||
}
|
||||
}
|
||||
plotPositionToZoneId[tile.position] = zoneId
|
||||
zone.extend(tile)
|
||||
zone.extend()
|
||||
}
|
||||
|
||||
// Ensure that continents sizes are calculated
|
||||
@ -239,7 +239,7 @@ class TacticalAnalysisMap {
|
||||
val tile = stack.removeLastOrNull() ?: break
|
||||
val tileContinentSize = tile.tileMap.continentSizes[tile.getContinent()] ?: Int.MAX_VALUE
|
||||
plotPositionToZoneId[tile.position] = newId
|
||||
newZone.extend(tile)
|
||||
newZone.extend()
|
||||
|
||||
for (neighbor in tile.neighbors) {
|
||||
|
||||
|
@ -217,6 +217,7 @@ enum class GameSetting(
|
||||
|
||||
/** **Warning:** It is the obligation of the caller to select the same type [T] that the [kClass] of this property has */
|
||||
fun <T> getProperty(settings: GameSettings): KMutableProperty0<T> {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
return propertyGetter(settings) as KMutableProperty0<T>
|
||||
}
|
||||
}
|
||||
|
@ -1130,7 +1130,7 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
|
||||
return errorList
|
||||
}
|
||||
|
||||
fun getDeprecationAnnotation(): Deprecated? = declaringClass.getField(name)
|
||||
fun getDeprecationAnnotation(): Deprecated? = declaringJavaClass.getField(name)
|
||||
.getAnnotation(Deprecated::class.java)
|
||||
|
||||
}
|
||||
|
@ -15,7 +15,6 @@ import com.unciv.models.translations.tr
|
||||
import com.unciv.ui.pickerscreens.Github
|
||||
import com.unciv.ui.popup.Popup
|
||||
import com.unciv.ui.popup.ToastPopup
|
||||
import com.unciv.ui.utils.BaseScreen
|
||||
import com.unciv.ui.utils.KeyCharAndCode
|
||||
import com.unciv.ui.utils.UncivTooltip.Companion.addTooltip
|
||||
import com.unciv.ui.utils.extensions.disable
|
||||
@ -31,7 +30,7 @@ import com.unciv.utils.concurrency.Concurrency
|
||||
import com.unciv.utils.concurrency.launchOnGLThread
|
||||
import java.io.FileNotFoundException
|
||||
|
||||
class LoadGameScreen(previousScreen:BaseScreen) : LoadOrSaveScreen() {
|
||||
class LoadGameScreen : LoadOrSaveScreen() {
|
||||
private val copySavedGameToClipboardButton = getCopyExistingSaveToClipboardButton()
|
||||
private val errorLabel = "".toLabel(Color.RED).apply { isVisible = false }
|
||||
private val loadMissingModsButton = getLoadMissingModsButton()
|
||||
|
@ -251,7 +251,7 @@ class WorldScreen(
|
||||
})
|
||||
}
|
||||
globalShortcuts.add(KeyCharAndCode.ctrl('S')) { game.pushScreen(SaveGameScreen(gameInfo)) } // Save
|
||||
globalShortcuts.add(KeyCharAndCode.ctrl('L')) { game.pushScreen(LoadGameScreen(this)) } // Load
|
||||
globalShortcuts.add(KeyCharAndCode.ctrl('L')) { game.pushScreen(LoadGameScreen()) } // Load
|
||||
globalShortcuts.add(KeyCharAndCode.ctrl('Q')) { game.popScreen() } // WorldScreen is the last screen, so this quits
|
||||
globalShortcuts.add(Input.Keys.NUMPAD_ADD) { this.mapHolder.zoomIn() } // '+' Zoom
|
||||
globalShortcuts.add(Input.Keys.NUMPAD_SUBTRACT) { this.mapHolder.zoomOut() } // '-' Zoom
|
||||
|
@ -32,7 +32,7 @@ class WorldScreenMenuPopup(val worldScreen: WorldScreen) : Popup(worldScreen) {
|
||||
}.row()
|
||||
addButton("Load game") {
|
||||
close()
|
||||
worldScreen.game.pushScreen(LoadGameScreen(worldScreen))
|
||||
worldScreen.game.pushScreen(LoadGameScreen())
|
||||
}.row()
|
||||
|
||||
addButton("Start new game") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user