diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-02-04 12:59:42 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-01-27 16:43:46 +0100 |
| commit | 3e92fa1272ff37ef8ccf0d295925a66a4787110f (patch) | |
| tree | 4c7bd38abfcf5cf75e07afe7dab4eeb511808daa /go/client/startMenu.go | |
| parent | 642b2e14532f906fe133bf2d05bb132ebb53d9ef (diff) | |
| download | muhqs-game-3e92fa1272ff37ef8ccf0d295925a66a4787110f.tar.gz muhqs-game-3e92fa1272ff37ef8ccf0d295925a66a4787110f.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.
Diffstat (limited to 'go/client/startMenu.go')
| -rw-r--r-- | go/client/startMenu.go | 12 |
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( |
