From 3e92fa1272ff37ef8ccf0d295925a66a4787110f Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 4 Feb 2023 12:59:42 +0100 Subject: 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. --- go/client/startMenu.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'go/client/startMenu.go') 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( -- cgit v1.2.3