mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-08 14:57:58 +07:00
Allow the Space key to close Alert popups with no actual choice (#10085)
This commit is contained in:
@ -9,7 +9,6 @@ import com.unciv.logic.battle.Battle
|
||||
import com.unciv.logic.city.City
|
||||
import com.unciv.logic.civilization.AlertType
|
||||
import com.unciv.logic.civilization.Civilization
|
||||
import com.unciv.logic.civilization.LocationAction
|
||||
import com.unciv.logic.civilization.NotificationCategory
|
||||
import com.unciv.logic.civilization.PopupAlert
|
||||
import com.unciv.logic.civilization.diplomacy.DiplomaticModifiers
|
||||
@ -64,6 +63,10 @@ class AlertPopup(
|
||||
private fun getCity(cityId: String) = gameInfo.getCities().first { it.id == cityId }
|
||||
//endregion
|
||||
|
||||
// This redirects all addCloseButton uses with only text and no action to accept the space key
|
||||
private fun addCloseButton(text: String = Constants.close) =
|
||||
addCloseButton(text, KeyboardBinding.NextTurnAlternate, null)
|
||||
|
||||
init {
|
||||
// This makes the buttons fill up available width. See comments in #9559.
|
||||
// To implement a middle ground, I would either simply replace growX() with minWidth(240f) or so,
|
||||
|
Reference in New Issue
Block a user