prompt for other team
This commit is contained in:
parent
0f9f76ce4e
commit
9ba91f1f01
|
@ -45,6 +45,9 @@ handleEvent e = gets (view progMode) >>= \case
|
||||||
| null $ gs ^. gameType -> do
|
| null $ gs ^. gameType -> do
|
||||||
menuHandler gameTypeMenu e
|
menuHandler gameTypeMenu e
|
||||||
return True
|
return True
|
||||||
|
| null $ gs ^. otherTeam -> do
|
||||||
|
promptHandler otherTeamPrompt e
|
||||||
|
return True
|
||||||
| null $ gs ^. homeScore -> do
|
| null $ gs ^. homeScore -> do
|
||||||
promptHandler homeScorePrompt e
|
promptHandler homeScorePrompt e
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -26,6 +26,7 @@ module Mtlstats.Prompt (
|
||||||
strPrompt,
|
strPrompt,
|
||||||
numPrompt,
|
numPrompt,
|
||||||
-- * Individual prompts
|
-- * Individual prompts
|
||||||
|
otherTeamPrompt,
|
||||||
homeScorePrompt,
|
homeScorePrompt,
|
||||||
awayScorePrompt
|
awayScorePrompt
|
||||||
) where
|
) where
|
||||||
|
@ -92,6 +93,10 @@ numPrompt pStr act = Prompt
|
||||||
, promptFunctionKey = const $ return ()
|
, promptFunctionKey = const $ return ()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
otherTeamPrompt :: Prompt
|
||||||
|
otherTeamPrompt = strPrompt "Other team: " $
|
||||||
|
modify . (progMode . otherTeamL .~)
|
||||||
|
|
||||||
homeScorePrompt :: Prompt
|
homeScorePrompt :: Prompt
|
||||||
homeScorePrompt = numPrompt "Home score: " $
|
homeScorePrompt = numPrompt "Home score: " $
|
||||||
modify . (progMode . homeScoreL ?~)
|
modify . (progMode . homeScoreL ?~)
|
||||||
|
|
|
@ -41,6 +41,7 @@ draw s = do
|
||||||
NewSeason -> drawMenu newSeasonMenu
|
NewSeason -> drawMenu newSeasonMenu
|
||||||
NewGame gs
|
NewGame gs
|
||||||
| null $ gs ^. gameType -> drawMenu gameTypeMenu
|
| null $ gs ^. gameType -> drawMenu gameTypeMenu
|
||||||
|
| null $ gs ^. otherTeam -> drawPrompt otherTeamPrompt s
|
||||||
| null $ gs ^. homeScore -> drawPrompt homeScorePrompt s
|
| null $ gs ^. homeScore -> drawPrompt homeScorePrompt s
|
||||||
| null $ gs ^. awayScore -> drawPrompt awayScorePrompt s
|
| null $ gs ^. awayScore -> drawPrompt awayScorePrompt s
|
||||||
| otherwise -> undefined
|
| otherwise -> undefined
|
||||||
|
|
Loading…
Reference in New Issue
Block a user