aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-02-04 12:59:42 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2025-08-20 15:46:39 +0200
commitf4f883141ddc69413743cb278b67a5cd41d508a0 (patch)
treefd2fa7b2c8cae9c62bd564a48fd47990f56deaea
parent8802f30ff720fcb64d9207c4cb673dc6805390c2 (diff)
downloadmuhqs-game-f4f883141ddc69413743cb278b67a5cd41d508a0.tar.gz
muhqs-game-f4f883141ddc69413743cb278b67a5cd41d508a0.zip
set textInput input value to the specified player name
Only setting the label gives the user the wronmg impression and does not return any input.
-rw-r--r--go/client/startMenu.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/go/client/startMenu.go b/go/client/startMenu.go
index 9d5d6129..234a1570 100644
--- a/go/client/startMenu.go
+++ b/go/client/startMenu.go
@@ -43,18 +43,18 @@ func (m *StartMenu) build() {
playerLabel.Bg = color.Black
m.widgets = append(m.widgets, playerLabel)
- playerInputLabel := "player name"
- if m.playerName != "" {
- playerInputLabel = m.playerName
- }
-
playerInput := ui.NewTextInput(
(m.width-START_BUTTON_WIDTH)/2,
(m.height-START_BUTTON_HEIGHT)/2-START_BUTTON_HEIGHT,
START_BUTTON_WIDTH,
START_BUTTON_HEIGHT,
- playerInputLabel,
+ "player name",
)
+
+ if m.playerName != "" {
+ playerInput.AddInput([]rune(m.playerName))
+ }
+
m.widgets = append(m.widgets, playerInput)
m.widgets = append(m.widgets, ui.NewSimpleButton(