diff --git a/core/src/com/unciv/ui/mapeditor/MapEditorModsTab.kt b/core/src/com/unciv/ui/mapeditor/MapEditorModsTab.kt index 3e3e8584de..a701fd0780 100644 --- a/core/src/com/unciv/ui/mapeditor/MapEditorModsTab.kt +++ b/core/src/com/unciv/ui/mapeditor/MapEditorModsTab.kt @@ -131,7 +131,7 @@ class MapEditorModsTab( add(inc.toLabel()).row() } add(ScrollPane(incompatibilityTable)).colspan(2) - .maxHeight(stage.height * 0.8f).row() + .maxHeight(stageToShowOn.height * 0.8f).row() addGoodSizedLabel("Change map to fit selected ruleset?", 24).colspan(2).row() addButtonInRow(Constants.yes, 'y') { onOK() diff --git a/core/src/com/unciv/ui/newgamescreen/PlayerPickerTable.kt b/core/src/com/unciv/ui/newgamescreen/PlayerPickerTable.kt index 80bff7ade7..0c01e12914 100644 --- a/core/src/com/unciv/ui/newgamescreen/PlayerPickerTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/PlayerPickerTable.kt @@ -344,7 +344,7 @@ private class NationPickerPopup( private val ruleset = previousScreen.ruleset // This Popup's body has two halves of same size, either side by side or arranged vertically // depending on screen proportions - determine height for one of those - private val partHeight = stage.height * (if (stage.isNarrowerThan4to3()) 0.45f else 0.8f) + private val partHeight = stageToShowOn.height * (if (stageToShowOn.isNarrowerThan4to3()) 0.45f else 0.8f) private val civBlocksWidth = playerPicker.civBlocksWidth private val nationListTable = Table() private val nationListScroll = ScrollPane(nationListTable) @@ -356,7 +356,7 @@ private class NationPickerPopup( nationListScroll.setOverscroll(false, false) add(nationListScroll).size( civBlocksWidth + 10f, partHeight ) // +10, because the nation table has a 5f pad, for a total of +10f - if (stage.isNarrowerThan4to3()) row() + if (stageToShowOn.isNarrowerThan4to3()) row() nationDetailsScroll.setOverscroll(false, false) add(nationDetailsScroll).size(civBlocksWidth + 10f, partHeight) // Same here, see above diff --git a/core/src/com/unciv/ui/options/MultiplayerTab.kt b/core/src/com/unciv/ui/options/MultiplayerTab.kt index f9a5c7e51e..4d72af1f59 100644 --- a/core/src/com/unciv/ui/options/MultiplayerTab.kt +++ b/core/src/com/unciv/ui/options/MultiplayerTab.kt @@ -154,7 +154,7 @@ private fun addMultiplayerServerOptions( }).colspan(2).row() tab.add(connectionToServerButton.onClick { - val popup = Popup(optionsPopup.stage).apply { + val popup = Popup(optionsPopup.stageToShowOn).apply { addGoodSizedLabel("Awaiting response...").row() } popup.open(true) diff --git a/core/src/com/unciv/ui/popup/ToastPopup.kt b/core/src/com/unciv/ui/popup/ToastPopup.kt index ca07331870..dd182394d7 100644 --- a/core/src/com/unciv/ui/popup/ToastPopup.kt +++ b/core/src/com/unciv/ui/popup/ToastPopup.kt @@ -11,7 +11,7 @@ import kotlinx.coroutines.delay * This is an unobtrusive popup which will close itself after a given amount of time. * Default time is two seconds (in milliseconds) */ -class ToastPopup (message: String, stage: Stage, val time: Long = 2000) : Popup(stage){ +class ToastPopup (message: String, stageToShowOn: Stage, val time: Long = 2000) : Popup(stageToShowOn){ constructor(message: String, screen: BaseScreen, time: Long = 2000) : this(message, screen.stage, time) @@ -24,7 +24,7 @@ class ToastPopup (message: String, stage: Stage, val time: Long = 2000) : Popup( open() //move it to the top so its not in the middle of the screen //have to be done after open() because open() centers the popup - y = stage.height - (height + 20f) + y = stageToShowOn.height - (height + 20f) } private fun startTimer(){ diff --git a/core/src/com/unciv/ui/popup/YesNoPopup.kt b/core/src/com/unciv/ui/popup/YesNoPopup.kt index 057970aa6f..f67ff1e6b8 100644 --- a/core/src/com/unciv/ui/popup/YesNoPopup.kt +++ b/core/src/com/unciv/ui/popup/YesNoPopup.kt @@ -17,10 +17,10 @@ import com.unciv.ui.utils.extensions.toLabel */ open class YesNoPopup( question: String, - stage: Stage, + stageToShowOn: Stage, restoreDefault: () -> Unit = {}, action: () -> Unit -) : Popup(stage) { +) : Popup(stageToShowOn) { constructor( question: String,