prompt for game month
This commit is contained in:
parent
79f8df50a0
commit
bd0cffc56c
|
@ -46,6 +46,9 @@ handleEvent e = gets (view progMode) >>= \case
|
|||
| null $ gs^.gameYear -> do
|
||||
promptHandler gameYearPrompt e
|
||||
return True
|
||||
| null $ gs^.gameMonth -> do
|
||||
menuHandler gameMonthMenu e
|
||||
return True
|
||||
| null $ gs^.gameType -> do
|
||||
menuHandler gameTypeMenu e
|
||||
return True
|
||||
|
|
|
@ -26,6 +26,7 @@ module Mtlstats.Menu (
|
|||
-- * Menus
|
||||
mainMenu,
|
||||
newSeasonMenu,
|
||||
gameMonthMenu,
|
||||
gameTypeMenu
|
||||
) where
|
||||
|
||||
|
@ -72,6 +73,26 @@ newSeasonMenu = Menu "*** SEASON TYPE ***" ()
|
|||
modify startNewGame
|
||||
]
|
||||
|
||||
-- | Requests the month in which the game took place
|
||||
gameMonthMenu :: Menu ()
|
||||
gameMonthMenu = Menu "Month:" () $ map
|
||||
(\(ch, name, val) ->
|
||||
MenuItem ch name $
|
||||
modify $ progMode.gameStateL.gameMonth ?~ val)
|
||||
[ ( 'A', "January", 1 )
|
||||
, ( 'B', "February", 2 )
|
||||
, ( 'C', "March", 3 )
|
||||
, ( 'D', "April", 4 )
|
||||
, ( 'E', "May", 5 )
|
||||
, ( 'F', "June", 6 )
|
||||
, ( 'G', "July", 7 )
|
||||
, ( 'H', "August", 8 )
|
||||
, ( 'I', "September", 9 )
|
||||
, ( 'J', "October", 10 )
|
||||
, ( 'K', "November", 11 )
|
||||
, ( 'L', "December", 12 )
|
||||
]
|
||||
|
||||
-- | The game type menu (home/away)
|
||||
gameTypeMenu :: Menu ()
|
||||
gameTypeMenu = Menu "*** GAME TYPE ***" ()
|
||||
|
|
|
@ -41,6 +41,7 @@ draw s = do
|
|||
NewSeason -> drawMenu newSeasonMenu
|
||||
NewGame gs
|
||||
| null $ gs^.gameYear -> drawPrompt gameYearPrompt s
|
||||
| null $ gs^.gameMonth -> drawMenu gameMonthMenu
|
||||
| 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