mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-03 22:22:51 +07:00
Added keyboard shortcut to toggle World Screen UI elements (#8211)
* AbsoluteUnits - Mongolian Uniques
* Added keyboard shortcut to toggle World Screen UI elements
Ctrl+U to toggle
* Update WorldScreen.kt
* Added a pesky space
* Remove "Experimental" warning text
* Revert "Remove "Experimental" warning text"
This reverts commit 3c8456db95
.
This commit is contained in:
parent
994169944a
commit
8d0acd0647
@ -232,7 +232,7 @@
|
||||
"If you have a keyboard, some shortcut keys become available. Unit command or improvement picker keys, for example, are shown directly in their corresponding buttons.",
|
||||
"On the world screen the hotkeys are as follows:", "Space or 'N' - Next unit or turn\n'E' - Empire overview (last viewed page)\n'+', '-' - Zoom in / out\nHome - center on capital or open its city screen if already centered",
|
||||
"F1 - Open Civilopedia\nF2 - Empire overview Trades\nF3 - Empire overview Units\nF4 - Empire overview Diplomacy\nF5 - Social policies\nF6 - Technologies\nF7 - Empire overview Cities\nF8 - Victory Progress\nF9 - Empire overview Stats\nF10 - Empire overview Resources\nF11 - Quicksave\nF12 - Quickload",
|
||||
"Ctrl-R - Toggle tile resource display\nCtrl-Y - Toggle tile yield display\nCtrl-O - Game options\nCtrl-S - Save game\nCtrl-L - Load game"
|
||||
"Ctrl-R - Toggle tile resource display\nCtrl-Y - Toggle tile yield display\nCtrl-O - Game options\nCtrl-S - Save game\nCtrl-L - Load game\nCtrl-U - Toggle UI (World Screen only)"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -1425,6 +1425,7 @@ Pillaging this improvement yields [stats] =
|
||||
Pillaging this improvement yields approximately [stats] =
|
||||
Needs removal of terrain features to be built =
|
||||
Unit type =
|
||||
Toggle UI (World Screen only) =
|
||||
|
||||
# Policies
|
||||
|
||||
|
@ -133,6 +133,8 @@ class WorldScreen(
|
||||
|
||||
private val events = EventBus.EventReceiver()
|
||||
|
||||
var uiEnabled = true
|
||||
|
||||
|
||||
init {
|
||||
// notifications are right-aligned, they take up only as much space as necessary.
|
||||
@ -254,6 +256,21 @@ class WorldScreen(
|
||||
globalShortcuts.add(KeyCharAndCode.ctrl('Q')) { game.popScreen() } // WorldScreen is the last screen, so this quits
|
||||
globalShortcuts.add(Input.Keys.NUMPAD_ADD) { this.mapHolder.zoomIn() } // '+' Zoom
|
||||
globalShortcuts.add(Input.Keys.NUMPAD_SUBTRACT) { this.mapHolder.zoomOut() } // '-' Zoom
|
||||
|
||||
globalShortcuts.add(KeyCharAndCode.ctrl('U')){
|
||||
uiEnabled = !uiEnabled
|
||||
topBar.isVisible = uiEnabled
|
||||
statusButtons.isVisible = uiEnabled
|
||||
techPolicyAndDiplomacy.isVisible = uiEnabled
|
||||
tutorialTaskTable.isVisible = uiEnabled
|
||||
bottomTileInfoTable.isVisible = uiEnabled
|
||||
unitActionsTable.isVisible = uiEnabled
|
||||
notificationsScroll.isVisible = uiEnabled
|
||||
minimapWrapper.isVisible = uiEnabled
|
||||
bottomUnitTable.isVisible = uiEnabled
|
||||
battleTable.isVisible = uiEnabled && battleTable.update() != hide()
|
||||
fogOfWarButton.isVisible = uiEnabled && viewingCiv.isSpectator()
|
||||
}
|
||||
}
|
||||
|
||||
private fun addKeyboardListener() {
|
||||
@ -362,6 +379,7 @@ class WorldScreen(
|
||||
// and we don't get any silly concurrency problems!
|
||||
private fun update() {
|
||||
|
||||
if(uiEnabled){
|
||||
displayTutorialsOnUpdate()
|
||||
|
||||
bottomUnitTable.update()
|
||||
@ -390,6 +408,7 @@ class WorldScreen(
|
||||
|
||||
unitActionsTable.update(bottomUnitTable.selectedUnit)
|
||||
unitActionsTable.y = bottomUnitTable.height
|
||||
}
|
||||
|
||||
mapHolder.resetArrows()
|
||||
if (UncivGame.Current.settings.showUnitMovements) {
|
||||
|
Loading…
Reference in New Issue
Block a user