Allow undoing moves via backspace key
This commit is contained in:
parent
25d2c6f11a
commit
d19aeaef1b
2 changed files with 7 additions and 0 deletions
|
@ -1,5 +1,7 @@
|
|||
1.4.1:
|
||||
- Fix locale detection on Windows and Linux
|
||||
- Support undoing moves using backspace key
|
||||
- Support confirming moves using enter key
|
||||
|
||||
1.4.0:
|
||||
- Auto-scale font size to fit text
|
||||
|
|
|
@ -2221,6 +2221,11 @@ func (g *Game) handleInput(keys []ebiten.Key) error {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
case ebiten.KeyBackspace:
|
||||
if len(inputBuffer.Text()) == 0 && !g.board.gameState.Spectating && g.board.gameState.Turn == g.board.gameState.PlayerNumber && len(g.board.gameState.Moves) > 0 && !g.board.menuGrid.Visible() && !g.board.settingsGrid.Visible() && !g.board.changePasswordGrid.Visible() && !g.board.leaveGameGrid.Visible() {
|
||||
g.board.selectUndo()
|
||||
return nil
|
||||
}
|
||||
case ebiten.KeyEnter:
|
||||
if g.board.changePasswordGrid.Visible() {
|
||||
g.board.selectChangePassword()
|
||||
|
|
Loading…
Reference in a new issue