diff --git a/src/Mtlstats/Events.hs b/src/Mtlstats/Events.hs index c2cde21..154c168 100644 --- a/src/Mtlstats/Events.hs +++ b/src/Mtlstats/Events.hs @@ -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 diff --git a/src/Mtlstats/Prompt.hs b/src/Mtlstats/Prompt.hs index 12b1a0c..e25e2b3 100644 --- a/src/Mtlstats/Prompt.hs +++ b/src/Mtlstats/Prompt.hs @@ -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: " $ diff --git a/src/Mtlstats/UI.hs b/src/Mtlstats/UI.hs index b1b70db..5ded87c 100644 --- a/src/Mtlstats/UI.hs +++ b/src/Mtlstats/UI.hs @@ -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