From 19b243abfe3068c1792eaa8a517d327cde1bcd5e Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Tue, 11 Apr 2023 11:28:24 +0300 Subject: [PATCH] 'Display' options organized into subcatagories - kudos @Ouaz --- .../jsons/translations/template.properties | 54 +++++++++++++------ .../com/unciv/ui/popups/options/DisplayTab.kt | 50 ++++++++++------- 2 files changed, 68 insertions(+), 36 deletions(-) diff --git a/android/assets/jsons/translations/template.properties b/android/assets/jsons/translations/template.properties index 9e167d4370..ee0a4a8fa1 100644 --- a/android/assets/jsons/translations/template.properties +++ b/android/assets/jsons/translations/template.properties @@ -678,12 +678,16 @@ Visit repository = ## Display tab Display = +### Screen subgroup + +Screen = Screen Mode = Windowed = Fullscreen = Borderless = -Screen orientation = +Screen Size = + Landscape (fixed) = Portrait (fixed) = Auto (sensor adjusted) = @@ -691,30 +695,46 @@ Auto (sensor adjusted) = ### Enable panning the map when you move the mouse to the edge of the window Map mouse auto-scroll = Map panning speed = -Order trade offers by amount = -Experimental Demographics scoreboard = -Unit icon opacity = -Enable display cutout (requires restart) = -Show zoom buttons in world screen = -Show worked tiles = -Show resources and improvements = -Show tile yields = -Show unit movement arrows = -Show pixel units = -Show pixel improvements = -Minimap size = +### Graphics subgroup + +Tileset = +Unitset = +UI Skin = + +### UI subgroup + +UI = + Notifications on world screen = Disabled = Hidden = Visible = Permanent = +Minimap size = + Show tutorials = Reset tutorials = Do you want to reset completed tutorials? = Reset = +Show zoom buttons in world screen = +Experimental Demographics scoreboard = + +### Visual Hints subgroup + +Visual Hints = +Show worked tiles = +Show resources and improvements = +Show tile yields = +Show unit movement arrows = +Show pixel units = +Show pixel improvements = +Unit icon opacity = + +### Performance subgroup + Continuous rendering = Experimental rendering improvements = When disabled, saves battery life but certain animations will be suspended = @@ -757,11 +777,15 @@ Generate translation files = Translation files are generated successfully. = Fastlane files are generated successfully. = +Screen orientation = + Font family = Font size multiplier = Default Font = Enable Easter Eggs = +Order trade offers by amount = +Enable display cutout (requires restart) = ## Keys tab Keys = @@ -1441,10 +1465,6 @@ Defence bonus = Movement cost = for = Missing translations: = -Screen Size = -Tileset = -Unitset = -UI Skin = Create = Improvements = Loading... = diff --git a/core/src/com/unciv/ui/popups/options/DisplayTab.kt b/core/src/com/unciv/ui/popups/options/DisplayTab.kt index 3848c02abd..a9f39803f5 100644 --- a/core/src/com/unciv/ui/popups/options/DisplayTab.kt +++ b/core/src/com/unciv/ui/popups/options/DisplayTab.kt @@ -12,17 +12,18 @@ import com.unciv.models.metadata.ScreenSize import com.unciv.models.skins.SkinCache import com.unciv.models.tilesets.TileSetCache import com.unciv.models.translations.tr -import com.unciv.ui.images.ImageGetter -import com.unciv.ui.screens.newgamescreen.TranslatedSelectBox -import com.unciv.ui.popups.ConfirmPopup -import com.unciv.ui.screens.basescreen.BaseScreen import com.unciv.ui.components.UncivSlider import com.unciv.ui.components.WrappableLabel +import com.unciv.ui.components.extensions.addSeparator import com.unciv.ui.components.extensions.brighten import com.unciv.ui.components.extensions.onChange import com.unciv.ui.components.extensions.onClick import com.unciv.ui.components.extensions.toLabel import com.unciv.ui.components.extensions.toTextButton +import com.unciv.ui.images.ImageGetter +import com.unciv.ui.popups.ConfirmPopup +import com.unciv.ui.screens.basescreen.BaseScreen +import com.unciv.ui.screens.newgamescreen.TranslatedSelectBox import com.unciv.ui.screens.worldscreen.NotificationsScroll import com.unciv.utils.Display import com.unciv.utils.ScreenMode @@ -39,7 +40,11 @@ fun displayTab( val settings = optionsPopup.settings + add("Screen".toLabel(fontSize = 24)).colspan(2).row() + addScreenModeSelectBox(this, settings, optionsPopup.selectBoxMinWidth) + addScreenSizeSelectBox(this, settings, optionsPopup.selectBoxMinWidth, onChange) + if (Gdx.app.type == Application.ApplicationType.Desktop) { optionsPopup.addCheckbox(this, "Map mouse auto-scroll", settings.mapAutoScroll, true) { @@ -50,29 +55,36 @@ fun displayTab( addScrollSpeedSlider(this, settings, optionsPopup.selectBoxMinWidth) } + addSeparator() + add("Graphics".toLabel(fontSize = 24)).colspan(2).row() + + addTileSetSelectBox(this, settings, optionsPopup.selectBoxMinWidth, onChange) + addUnitSetSelectBox(this, settings, optionsPopup.selectBoxMinWidth, onChange) + addSkinSelectBox(this, settings, optionsPopup.selectBoxMinWidth, onChange) + + addSeparator() + add("UI".toLabel(fontSize = 24)).colspan(2).row() + + addNotificationScrollSelect(this, settings, optionsPopup.selectBoxMinWidth) + addMinimapSizeSlider(this, settings, optionsPopup.selectBoxMinWidth) + optionsPopup.addCheckbox(this, "Show tutorials", settings.showTutorials, updateWorld = true, newRow = false) { settings.showTutorials = it } + 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 } + + addSeparator() + add("Visual Hints".toLabel(fontSize = 24)).colspan(2).row() + optionsPopup.addCheckbox(this, "Show unit movement arrows", settings.showUnitMovements, true) { settings.showUnitMovements = it } optionsPopup.addCheckbox(this, "Show tile yields", settings.showTileYields, true) { settings.showTileYields = it } // JN optionsPopup.addCheckbox(this, "Show worked tiles", settings.showWorkedTiles, true) { settings.showWorkedTiles = it } optionsPopup.addCheckbox(this, "Show resources and improvements", settings.showResourcesAndImprovements, true) { settings.showResourcesAndImprovements = it } - optionsPopup.addCheckbox(this, "Show tutorials", settings.showTutorials, updateWorld = true, newRow = false) { settings.showTutorials = it } - addResetTutorials(this, settings) optionsPopup.addCheckbox(this, "Show pixel improvements", settings.showPixelImprovements, true) { settings.showPixelImprovements = it } - optionsPopup.addCheckbox(this, "Experimental Demographics scoreboard", settings.useDemographics, true) { settings.useDemographics = it } - optionsPopup.addCheckbox(this, "Show zoom buttons in world screen", settings.showZoomButtons, true) { settings.showZoomButtons = it } - - addNotificationScrollSelect(this, settings, optionsPopup.selectBoxMinWidth) - - addMinimapSizeSlider(this, settings, optionsPopup.selectBoxMinWidth) addUnitIconAlphaSlider(this, settings, optionsPopup.selectBoxMinWidth) - addScreenSizeSelectBox(this, settings, optionsPopup.selectBoxMinWidth, onChange) - - addTileSetSelectBox(this, settings, optionsPopup.selectBoxMinWidth, onChange) - - addUnitSetSelectBox(this, settings, optionsPopup.selectBoxMinWidth, onChange) - - addSkinSelectBox(this, settings, optionsPopup.selectBoxMinWidth, onChange) + addSeparator() + add("Performance".toLabel(fontSize = 24)).colspan(2).row() optionsPopup.addCheckbox(this, "Continuous rendering", settings.continuousRendering) { settings.continuousRendering = it