prompt for day of month game took place

This commit is contained in:
Jonathan Lamothe 2019-08-31 12:42:11 -04:00
parent bd0cffc56c
commit eef773b7fa
3 changed files with 10 additions and 0 deletions

View File

@ -49,6 +49,9 @@ handleEvent e = gets (view progMode) >>= \case
| null $ gs^.gameMonth -> do
menuHandler gameMonthMenu e
return True
| null $ gs^.gameDay -> do
promptHandler gameDayPrompt e
return True
| null $ gs^.gameType -> do
menuHandler gameTypeMenu e
return True

View File

@ -27,6 +27,7 @@ module Mtlstats.Prompt (
numPrompt,
-- * Individual prompts
gameYearPrompt,
gameDayPrompt,
otherTeamPrompt,
homeScorePrompt,
awayScorePrompt
@ -99,6 +100,11 @@ gameYearPrompt :: Prompt
gameYearPrompt = numPrompt "Game year: " $
modify . (progMode.gameStateL.gameYear ?~)
-- | Prompts for the day of the month the game took place
gameDayPrompt :: Prompt
gameDayPrompt = numPrompt "Day of month: " $
modify . (progMode.gameStateL.gameDay ?~)
-- | Prompts for the other team name
otherTeamPrompt :: Prompt
otherTeamPrompt = strPrompt "Other team: " $

View File

@ -42,6 +42,7 @@ draw s = do
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