[Linting] Some minor code purity stuff I came across (#10537)

* Centralize shift and control key detection (Unit multiselect now with right-shift too)

* Lint of an ugly curly brace placement - otherwise the original was fine

* Answer open question in comment

* Follow a Gdx 1.12 deprecation

* Another clarifying comment - on ScrollPane's built-in potential surprise that the constructor calls its own overridable public methods
This commit is contained in:
SomeTroglodyte
2023-11-22 22:58:57 +01:00
committed by GitHub
parent 4c8db02dfd
commit 8bd2363361
12 changed files with 34 additions and 40 deletions

View File

@ -256,11 +256,7 @@ open class UncivGame(val isConsoleMode: Boolean = false) : Game(), PlatformSpeci
throw UnsupportedOperationException("Use pushScreen or replaceCurrentScreen instead")
}
override fun getScreen(): BaseScreen? {
val curScreen = super.getScreen()
return if (curScreen == null) { null } else { curScreen as BaseScreen
}
}
override fun getScreen(): BaseScreen? = super.getScreen() as? BaseScreen
private fun setScreen(newScreen: BaseScreen) {
debug("Setting new screen: %s, screenStack: %s", newScreen, screenStack)