Skip to content

Commit

Permalink
Minor changes to help text
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben9922 committed Apr 9, 2023
1 parent fee10bd commit 31036c5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,28 +367,29 @@ func (m model) View() string {

switch m.view {
case PointSelection:
infoText = append(infoText, "", "Choose where to place your disk")
if slices.Contains(availablePoints, m.selectedPoint) {
infoText = append(infoText, "", lipgloss.NewStyle().
Foreground(lipgloss.Color("241")).
Render("arrow keys: move • enter: place tile • q: exit"))
infoText = append(infoText, lipgloss.NewStyle().
Foreground(lipgloss.Color("#00cc00")).
Render("Can place disk here"))
} else {
infoText = append(infoText, "", lipgloss.NewStyle().
Foreground(lipgloss.Color("241")).
Render("arrow keys: move • q: exit"))
Render("arrow keys: move • enter: place tile • q: exit"))
} else {
infoText = append(infoText, lipgloss.NewStyle().
Foreground(lipgloss.Color("#cc0000")).
Render("Cannot place disk here"))
infoText = append(infoText, "", lipgloss.NewStyle().
Foreground(lipgloss.Color("241")).
Render("arrow keys: move • q: exit"))
}
case PointConfirmation:
if len(m.disksFlipped) == 0 {
infoText = append(infoText, "", "No disks flipped this time")
} else {
infoText = append(infoText, "", fmt.Sprintf("%s flipped %d disks!", m.currentPlayer, len(m.disksFlipped)))
}
infoText = append(infoText, lipgloss.NewStyle().
infoText = append(infoText, "", lipgloss.NewStyle().
Foreground(lipgloss.Color("241")).
Render("any key: continue"))
}
Expand Down

0 comments on commit 31036c5

Please sign in to comment.