- commit
- c28818af137a70d5fe351950e953a02358edda4f
- parent
- fd26c81dd315d4afababdcbfa3398d5732fa47b1
- author
- Dami <dami.etoile@gmail.com>
| M | hashiwokakero/ | 4 | ++++ |
| M | hitori/ | 4 | ++++ |
| M | lightsout/ | 4 | ++++ |
| M | nonogram/ | 3 | +++ |
| M | nurikabe/ | 4 | ++++ |
| M | sudoku/ | 4 | ++++ |
| M | wordsearch/ | 3 | +++ |
@@ -132,6 +132,10 @@ func (m Model) View() string {
132132 title := game.TitleBarView("Hashiwokakero", m.modeTitle, solved)133133 grid := gridView(m, solved)134134 info := infoView(&m.puzzle)135+ if solved {136+ return game.ComposeGameViewRows(title, grid, game.StaticRow(info))137+ }138+135139 selected := m.selectedIsland != nil136140 status := statusBarView(selected, m.showFullHelp)137141 @@ -102,6 +102,10 @@ func (m *Model) toggleMark(mark cellMark) {
102102 func (m Model) View() string {103103 title := game.TitleBarView("Hitori", m.modeTitle, m.solved)104104 grid := gridView(m.numbers, m.marks, m.cursor, m.solved, m.conflicts)105+ if m.solved {106+ return game.ComposeGameView(title, grid)107+ }108+105109 status := statusBarView(m.showFullHelp)106110 return game.ComposeGameViewRows(title, grid, game.StableRow(status, statusBarView(false), statusBarView(true)))107111 }@@ -89,6 +89,10 @@ func (m Model) View() string {
8989 9090 title := game.TitleBarView("Lights Out", m.modeTitle, solved)9191 grid := gridView(m.grid, m.cursor, solved)92+ if solved {93+ return game.ComposeGameView(title, grid)94+ }95+9296 status := statusBarView(m.showFullHelp)9397 9498 return game.ComposeGameViewRows(title, grid, game.StableRow(status, statusBarView(false), statusBarView(true)))@@ -190,6 +190,9 @@ func (m Model) View() string {
190190 s2 := lipgloss.JoinHorizontal(lipgloss.Top, r, g)191191 192192 grid := lipgloss.JoinVertical(lipgloss.Center, s1, s2)193+ if m.solved {194+ return game.ComposeGameView(title, grid)195+ }193196 194197 return game.ComposeGameViewRows(title, grid, game.StableRow(status, statusBarView(false), statusBarView(true)))195198 }@@ -190,6 +190,10 @@ func (m Model) islandTarget(current cellState) cellState {
190190 func (m Model) View() string {191191 title := game.TitleBarView("Nurikabe", m.modeTitle, m.solved)192192 grid := gridView(m)193+ if m.solved {194+ return game.ComposeGameView(title, grid)195+ }196+193197 status := statusBarView(m.showFullHelp)194198 return game.ComposeGameViewRows(title, grid, game.StableRow(status, statusBarView(false), statusBarView(true)))195199 }@@ -96,6 +96,10 @@ func (m Model) View() string {
9696 solved := isSolvedWith(m.grid, m.conflicts)9797 title := game.TitleBarView("Sudoku", m.modeTitle, solved)9898 grid := renderGrid(m, solved, m.conflicts)99+ if solved {100+ return game.ComposeGameView(title, grid)101+ }102+99103 status := statusBarView(m.showFullHelp)100104 101105 return game.ComposeGameViewRows(title, grid, game.StableRow(status, statusBarView(false), statusBarView(true)))@@ -100,6 +100,9 @@ func renderView(m Model) string {
100100 101101 spacer := strings.Repeat(" ", 2)102102 mainView := lipgloss.JoinHorizontal(lipgloss.Top, gridView, spacer, wordListView)103+ if m.solved {104+ return game.ComposeGameView(title, mainView)105+ }103106 104107 status := statusBarView(m.showFullHelp)105108