prompt for away team score
This commit is contained in:
parent
3626dde6fc
commit
74809ced2e
|
@ -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
|
||||
|
|
|
@ -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 ?~)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user