This commit is contained in:
alexban011 2022-07-08 15:48:41 +03:00 committed by GitHub
parent 3422e161ad
commit 33237d5a59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View File

@ -101,6 +101,7 @@ class ModManagementScreen(
init { init {
//setDefaultCloseAction(screen) // this would initialize the new MainMenuScreen immediately //setDefaultCloseAction(screen) // this would initialize the new MainMenuScreen immediately
rightSideButton.isVisible = false
closeButton.onActivation { closeButton.onActivation {
val tileSets = ImageGetter.getAvailableTilesets() val tileSets = ImageGetter.getAvailableTilesets()
if (game.settings.tileSet !in tileSets) { if (game.settings.tileSet !in tileSets) {
@ -399,6 +400,7 @@ class ModManagementScreen(
private fun onlineButtonAction(repo: Github.Repo, button: Button) { private fun onlineButtonAction(repo: Github.Repo, button: Button) {
syncOnlineSelected(repo.name, button) syncOnlineSelected(repo.name, button)
showModDescription(repo.name) showModDescription(repo.name)
rightSideButton.isVisible = true
rightSideButton.clearListeners() rightSideButton.clearListeners()
rightSideButton.enable() rightSideButton.enable()
val label = if (installedModInfo[repo.name]?.state?.hasUpdate == true) val label = if (installedModInfo[repo.name]?.state?.hasUpdate == true)
@ -523,7 +525,10 @@ class ModManagementScreen(
// Prevent building up listeners. The virgin Button has one: for mouseover styling. // Prevent building up listeners. The virgin Button has one: for mouseover styling.
// The captures for our listener shouldn't need updating, so assign only once // The captures for our listener shouldn't need updating, so assign only once
if (mod.button.listeners.none { it.javaClass.`package`.name.startsWith("com.unciv") }) if (mod.button.listeners.none { it.javaClass.`package`.name.startsWith("com.unciv") })
mod.button.onClick { installedButtonAction(mod) } mod.button.onClick {
rightSideButton.isVisible = true
installedButtonAction(mod)
}
val decoratedButton = Table() val decoratedButton = Table()
decoratedButton.add(mod.button) decoratedButton.add(mod.button)
decoratedButton.add(mod.state.container).align(Align.center+Align.left) decoratedButton.add(mod.state.container).align(Align.center+Align.left)

View File

@ -82,6 +82,7 @@ class LoadGameScreen(previousScreen:BaseScreen) : LoadOrSaveScreen() {
rightSideTable.initRightSideTable() rightSideTable.initRightSideTable()
rightSideButton.onActivation { onLoadGame() } rightSideButton.onActivation { onLoadGame() }
rightSideButton.keyShortcuts.add(KeyCharAndCode.RETURN) rightSideButton.keyShortcuts.add(KeyCharAndCode.RETURN)
rightSideButton.isVisible = false
} }
override fun resetWindowState() { override fun resetWindowState() {
@ -93,6 +94,7 @@ class LoadGameScreen(previousScreen:BaseScreen) : LoadOrSaveScreen() {
override fun onExistingSaveSelected(saveGameFile: FileHandle) { override fun onExistingSaveSelected(saveGameFile: FileHandle) {
copySavedGameToClipboardButton.enable() copySavedGameToClipboardButton.enable()
rightSideButton.isVisible = true
rightSideButton.setText("Load [$selectedSave]".tr()) rightSideButton.setText("Load [$selectedSave]".tr())
rightSideButton.enable() rightSideButton.enable()
} }

View File

@ -101,6 +101,7 @@ abstract class LoadOrSaveScreen(
selectedSave = saveGameFile.name() selectedSave = saveGameFile.name()
showSaveInfo(saveGameFile) showSaveInfo(saveGameFile)
rightSideButton.isVisible = true
onExistingSaveSelected(saveGameFile) onExistingSaveSelected(saveGameFile)
} }