prompt for game year
This commit is contained in:
parent
f718757bea
commit
0798786d36
|
@ -43,6 +43,9 @@ handleEvent e = gets (view progMode) >>= \case
|
|||
MainMenu -> menuHandler mainMenu e
|
||||
NewSeason -> menuHandler newSeasonMenu e >> return True
|
||||
NewGame gs
|
||||
| null $ gs^.gameYear -> do
|
||||
promptHandler gameYearPrompt e
|
||||
return True
|
||||
| null $ gs^.gameType -> do
|
||||
menuHandler gameTypeMenu e
|
||||
return True
|
||||
|
|
|
@ -26,6 +26,7 @@ module Mtlstats.Prompt (
|
|||
strPrompt,
|
||||
numPrompt,
|
||||
-- * Individual prompts
|
||||
gameYearPrompt,
|
||||
otherTeamPrompt,
|
||||
homeScorePrompt,
|
||||
awayScorePrompt
|
||||
|
@ -93,6 +94,11 @@ numPrompt pStr act = Prompt
|
|||
, promptFunctionKey = const $ return ()
|
||||
}
|
||||
|
||||
-- | Prompts for the game year
|
||||
gameYearPrompt :: Prompt
|
||||
gameYearPrompt = numPrompt "Game year: " $
|
||||
modify . (progMode.gameStateL.gameYear ?~)
|
||||
|
||||
-- | Prompts for the other team name
|
||||
otherTeamPrompt :: Prompt
|
||||
otherTeamPrompt = strPrompt "Other team: " $
|
||||
|
|
|
@ -40,6 +40,7 @@ draw s = do
|
|||
MainMenu -> drawMenu mainMenu
|
||||
NewSeason -> drawMenu newSeasonMenu
|
||||
NewGame gs
|
||||
| null $ gs^.gameYear -> drawPrompt gameYearPrompt s
|
||||
| null $ gs^.gameType -> drawMenu gameTypeMenu
|
||||
| null $ gs^.otherTeam -> drawPrompt otherTeamPrompt s
|
||||
| null $ gs^.homeScore -> drawPrompt homeScorePrompt s
|
||||
|
|
Loading…
Reference in New Issue
Block a user