prompt for away team score

This commit is contained in:
Jonathan Lamothe 2019-08-24 20:14:49 -04:00
parent 3626dde6fc
commit 74809ced2e
3 changed files with 10 additions and 1 deletions

View File

@ -48,4 +48,7 @@ handleEvent e = gets (view progMode) >>= \case
| null $ gs ^. homeScore -> do
promptHandler homeScorePrompt e
return True
| null $ gs ^. awayScore -> do
promptHandler awayScorePrompt e
return True
| otherwise -> undefined

View File

@ -25,7 +25,8 @@ module Mtlstats.Prompt (
promptHandler,
numPrompt,
-- * Individual prompts
homeScorePrompt
homeScorePrompt,
awayScorePrompt
) where
import Control.Monad (when)
@ -79,3 +80,7 @@ numPrompt pStr act = Prompt
homeScorePrompt :: Prompt
homeScorePrompt = numPrompt "Home score: " $
modify . (progMode . homeScoreL ?~)
awayScorePrompt :: Prompt
awayScorePrompt = numPrompt "Away score: " $
modify . (progMode . awayScoreL ?~)

View File

@ -42,6 +42,7 @@ draw s = do
NewGame gs
| null $ gs ^. gameType -> drawMenu gameTypeMenu
| null $ gs ^. homeScore -> drawPrompt homeScorePrompt s
| null $ gs ^. awayScore -> drawPrompt awayScorePrompt s
| otherwise -> undefined
C.render
void $ C.setCursorMode cm