Skip to content

Commit

Permalink
Changes (#12846)
Browse files Browse the repository at this point in the history
  • Loading branch information
itanasi authored Jan 22, 2025
1 parent 35b21d9 commit 05d246c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/src/com/unciv/ui/components/input/KeyboardBinding.kt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ enum class KeyboardBinding(
// Unit actions - name MUST correspond to UnitActionType.name because the shorthand constructor
// there looks up bindings here by name - which also means we must not use UnitActionType
// here as it will not be guaranteed to already be fully initialized.
SwapUnits(Category.UnitActions,"Swap units", 'y'),
SwapUnits(Category.UnitActions, "Swap units", 'y'),
Automate(Category.UnitActions, 'm'),
ConnectRoad(Category.UnitActions, "Connect road", 'c'),
StopAutomation(Category.UnitActions,"Stop automation", 'm'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ class IdleUnitButton (
add(image).size(imageSize).pad(10f,20f)
enable()
keyShortcuts.add(keyShortcutBind)
addTooltip(keyShortcutBind)
onActivation {
onActivation (binding = keyShortcutBind) {

val idleUnits = unitTable.worldScreen.viewingCiv.units.getIdleUnits()
if (idleUnits.none()) return@onActivation
Expand Down
6 changes: 4 additions & 2 deletions core/src/com/unciv/ui/screens/worldscreen/unit/UnitTable.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ import com.unciv.ui.screens.pickerscreens.UnitRenamePopup
import com.unciv.ui.screens.worldscreen.WorldScreen

class UnitTable(val worldScreen: WorldScreen) : Table() {
private val prevIdleUnitButton = IdleUnitButton(this,worldScreen.mapHolder,true, KeyboardBinding.PrevIdleButton)
private val nextIdleUnitButton = IdleUnitButton(this,worldScreen.mapHolder,false, KeyboardBinding.NextIdleButton)
private val prevIdleUnitButton =
IdleUnitButton(this, worldScreen.mapHolder, true, KeyboardBinding.PrevIdleButton)
private val nextIdleUnitButton =
IdleUnitButton(this, worldScreen.mapHolder, false, KeyboardBinding.NextIdleButton)
private val unitIconHolder = Table()
private val unitNameLabel = "".toLabel(fontSize = 24)
private val unitIconNameGroup = Table()
Expand Down

0 comments on commit 05d246c

Please sign in to comment.