Merge pull request #8 from mtlstats/away-score
prompt for away team score
This commit is contained in:
commit
bb44598b64
|
@ -48,4 +48,7 @@ handleEvent e = gets (view progMode) >>= \case
|
||||||
| null $ gs ^. homeScore -> do
|
| null $ gs ^. homeScore -> do
|
||||||
promptHandler homeScorePrompt e
|
promptHandler homeScorePrompt e
|
||||||
return True
|
return True
|
||||||
|
| null $ gs ^. awayScore -> do
|
||||||
|
promptHandler awayScorePrompt e
|
||||||
|
return True
|
||||||
| otherwise -> undefined
|
| otherwise -> undefined
|
||||||
|
|
|
@ -25,7 +25,8 @@ module Mtlstats.Prompt (
|
||||||
promptHandler,
|
promptHandler,
|
||||||
numPrompt,
|
numPrompt,
|
||||||
-- * Individual prompts
|
-- * Individual prompts
|
||||||
homeScorePrompt
|
homeScorePrompt,
|
||||||
|
awayScorePrompt
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Control.Monad (when)
|
import Control.Monad (when)
|
||||||
|
@ -79,3 +80,7 @@ numPrompt pStr act = Prompt
|
||||||
homeScorePrompt :: Prompt
|
homeScorePrompt :: Prompt
|
||||||
homeScorePrompt = numPrompt "Home score: " $
|
homeScorePrompt = numPrompt "Home score: " $
|
||||||
modify . (progMode . homeScoreL ?~)
|
modify . (progMode . homeScoreL ?~)
|
||||||
|
|
||||||
|
awayScorePrompt :: Prompt
|
||||||
|
awayScorePrompt = numPrompt "Away score: " $
|
||||||
|
modify . (progMode . awayScoreL ?~)
|
||||||
|
|
|
@ -42,6 +42,7 @@ draw s = do
|
||||||
NewGame gs
|
NewGame gs
|
||||||
| null $ gs ^. gameType -> drawMenu gameTypeMenu
|
| null $ gs ^. gameType -> drawMenu gameTypeMenu
|
||||||
| null $ gs ^. homeScore -> drawPrompt homeScorePrompt s
|
| null $ gs ^. homeScore -> drawPrompt homeScorePrompt s
|
||||||
|
| null $ gs ^. awayScore -> drawPrompt awayScorePrompt s
|
||||||
| otherwise -> undefined
|
| otherwise -> undefined
|
||||||
C.render
|
C.render
|
||||||
void $ C.setCursorMode cm
|
void $ C.setCursorMode cm
|
||||||
|
|
Loading…
Reference in New Issue
Block a user