place game number header above relevant prompts
This commit is contained in:
parent
6136151614
commit
8dd4896f07
|
@ -95,7 +95,7 @@ gameMonthMenu = Menu "Month:" () $ map
|
|||
|
||||
-- | The game type menu (home/away)
|
||||
gameTypeMenu :: Menu ()
|
||||
gameTypeMenu = Menu "*** GAME TYPE ***" ()
|
||||
gameTypeMenu = Menu "Game type:" ()
|
||||
[ MenuItem '1' "Home Game" $
|
||||
modify $ progMode.gameStateL.gameType ?~ HomeGame
|
||||
, MenuItem '2' "Away Game" $
|
||||
|
|
|
@ -25,6 +25,7 @@ import Control.Monad (void)
|
|||
import Lens.Micro ((^.))
|
||||
import qualified UI.NCurses as C
|
||||
|
||||
import Mtlstats.Format
|
||||
import Mtlstats.Menu
|
||||
import Mtlstats.Prompt
|
||||
import Mtlstats.Types
|
||||
|
@ -40,18 +41,22 @@ draw s = do
|
|||
MainMenu -> drawMenu mainMenu
|
||||
NewSeason -> drawMenu newSeasonMenu
|
||||
NewGame gs
|
||||
| null $ gs^.gameYear -> drawPrompt gameYearPrompt s
|
||||
| null $ gs^.gameMonth -> drawMenu gameMonthMenu
|
||||
| null $ gs^.gameDay -> drawPrompt gameDayPrompt s
|
||||
| null $ gs^.gameType -> drawMenu gameTypeMenu
|
||||
| null $ gs^.otherTeam -> drawPrompt otherTeamPrompt s
|
||||
| null $ gs^.homeScore -> drawPrompt homeScorePrompt s
|
||||
| null $ gs^.awayScore -> drawPrompt awayScorePrompt s
|
||||
| null $ gs^.overtimeFlag -> overtimePrompt
|
||||
| null $ gs^.gameYear -> header s >> drawPrompt gameYearPrompt s
|
||||
| null $ gs^.gameMonth -> header s >> drawMenu gameMonthMenu
|
||||
| null $ gs^.gameDay -> header s >> drawPrompt gameDayPrompt s
|
||||
| null $ gs^.gameType -> header s >> drawMenu gameTypeMenu
|
||||
| null $ gs^.otherTeam -> header s >> drawPrompt otherTeamPrompt s
|
||||
| null $ gs^.homeScore -> header s >> drawPrompt homeScorePrompt s
|
||||
| null $ gs^.awayScore -> header s >> drawPrompt awayScorePrompt s
|
||||
| null $ gs^.overtimeFlag -> header s >> overtimePrompt
|
||||
| otherwise -> undefined
|
||||
C.render
|
||||
void $ C.setCursorMode cm
|
||||
|
||||
header :: ProgState -> C.Update ()
|
||||
header s = C.drawString $
|
||||
"*** GAME " ++ padNum 2 (s^.database.dbGames) ++ " ***\n"
|
||||
|
||||
overtimePrompt :: C.Update C.CursorMode
|
||||
overtimePrompt = do
|
||||
C.drawString "Did the game go into overtime? (Y/N)"
|
||||
|
|
Loading…
Reference in New Issue
Block a user