Reset game buffer when joining a new match

This commit is contained in:
Trevor Slocum 2023-09-18 23:15:32 -07:00
parent 40acdc03e1
commit 379ec0197c

12
app.go
View file

@ -690,11 +690,15 @@ func HandleEvents(c *Client, b *GameBoard) {
b.Board.Player2.Name = ev.Player
}
b.Update()
gameInProgress = true
showCreateGameDialog = false
showJoinGameDialog = false
setScreen(ScreenGame)
if ev.Player == c.Username {
gameInProgress = true
showCreateGameDialog = false
showJoinGameDialog = false
setScreen(ScreenGame)
gameBuffer.SetText("")
gameLogged = false
} else {
lg(fmt.Sprintf("%s joined the match.", ev.Player))
}