mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-16 10:49:17 +07:00
Add a setting to forbid closing popups by clicking behind them (#10539)
* Add a setting to forbit closing popups by clicking behind them * Change default checkbox state to false * Update template and Russian translation
This commit is contained in:
@ -746,6 +746,7 @@ Reset = Сбросить
|
||||
|
||||
Show zoom buttons in world screen = Показывать кнопки масштабирования на экране мира
|
||||
Experimental Demographics scoreboard = Экспериментальная таблица рейтинга
|
||||
Never close popups by clicking outside = Не закрывать всплывающие окна нажатием на их фон
|
||||
|
||||
Size of Unitset art in Civilopedia = Размер изображений палитры юнитов в Цивилопедии
|
||||
|
||||
|
@ -746,6 +746,7 @@ Reset =
|
||||
|
||||
Show zoom buttons in world screen =
|
||||
Experimental Demographics scoreboard =
|
||||
Never close popups by clicking outside =
|
||||
|
||||
Size of Unitset art in Civilopedia =
|
||||
|
||||
|
@ -81,6 +81,7 @@ class GameSettings {
|
||||
var visualMods = HashSet<String>()
|
||||
var useDemographics: Boolean = false
|
||||
var showZoomButtons: Boolean = false
|
||||
var forbidPopupClickBehindToClose: Boolean = false
|
||||
|
||||
var notificationsLogMaxTurns = 5
|
||||
|
||||
|
@ -18,6 +18,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
|
||||
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener
|
||||
import com.badlogic.gdx.utils.Align
|
||||
import com.unciv.Constants
|
||||
import com.unciv.GUI
|
||||
import com.unciv.logic.event.EventBus
|
||||
import com.unciv.ui.components.widgets.AutoScrollPane
|
||||
import com.unciv.ui.components.extensions.addSeparator
|
||||
@ -227,7 +228,7 @@ open class Popup(
|
||||
/** Allow closing a popup by clicking 'outside', Android-style, but only if a Close button exists */
|
||||
private fun getBehindClickListener() = object : ClickListener() {
|
||||
override fun clicked(event: InputEvent?, x: Float, y: Float) {
|
||||
if (!clickBehindToClose) return
|
||||
if (!clickBehindToClose || GUI.getSettings().forbidPopupClickBehindToClose) return
|
||||
// Since Gdx doesn't limit events to the actually `hit` actors...
|
||||
if (event?.target != this@Popup) return
|
||||
close()
|
||||
|
@ -71,6 +71,7 @@ fun displayTab(
|
||||
addResetTutorials(this, settings)
|
||||
optionsPopup.addCheckbox(this, "Show zoom buttons in world screen", settings.showZoomButtons, true) { settings.showZoomButtons = it }
|
||||
optionsPopup.addCheckbox(this, "Experimental Demographics scoreboard", settings.useDemographics, true) { settings.useDemographics = it }
|
||||
optionsPopup.addCheckbox(this, "Never close popups by clicking outside", settings.forbidPopupClickBehindToClose, false) { settings.forbidPopupClickBehindToClose = it }
|
||||
addPediaUnitArtSizeSlider(this, settings, optionsPopup.selectBoxMinWidth)
|
||||
|
||||
addSeparator()
|
||||
|
Reference in New Issue
Block a user