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
|
| null $ gs^.gameYear -> do
|
||||||
promptHandler gameYearPrompt e
|
promptHandler gameYearPrompt e
|
||||||
return True
|
return True
|
||||||
|
| null $ gs^.gameMonth -> do
|
||||||
|
menuHandler gameMonthMenu e
|
||||||
|
return True
|
||||||
| null $ gs^.gameType -> do
|
| null $ gs^.gameType -> do
|
||||||
menuHandler gameTypeMenu e
|
menuHandler gameTypeMenu e
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -26,6 +26,7 @@ module Mtlstats.Menu (
|
||||||
-- * Menus
|
-- * Menus
|
||||||
mainMenu,
|
mainMenu,
|
||||||
newSeasonMenu,
|
newSeasonMenu,
|
||||||
|
gameMonthMenu,
|
||||||
gameTypeMenu
|
gameTypeMenu
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
@ -72,6 +73,26 @@ newSeasonMenu = Menu "*** SEASON TYPE ***" ()
|
||||||
modify startNewGame
|
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)
|
-- | The game type menu (home/away)
|
||||||
gameTypeMenu :: Menu ()
|
gameTypeMenu :: Menu ()
|
||||||
gameTypeMenu = Menu "*** GAME TYPE ***" ()
|
gameTypeMenu = Menu "*** GAME TYPE ***" ()
|
||||||
|
|
|
@ -41,6 +41,7 @@ draw s = do
|
||||||
NewSeason -> drawMenu newSeasonMenu
|
NewSeason -> drawMenu newSeasonMenu
|
||||||
NewGame gs
|
NewGame gs
|
||||||
| null $ gs^.gameYear -> drawPrompt gameYearPrompt s
|
| null $ gs^.gameYear -> drawPrompt gameYearPrompt s
|
||||||
|
| null $ gs^.gameMonth -> drawMenu gameMonthMenu
|
||||||
| null $ gs^.gameType -> drawMenu gameTypeMenu
|
| null $ gs^.gameType -> drawMenu gameTypeMenu
|
||||||
| null $ gs^.otherTeam -> drawPrompt otherTeamPrompt s
|
| null $ gs^.otherTeam -> drawPrompt otherTeamPrompt s
|
||||||
| null $ gs^.homeScore -> drawPrompt homeScorePrompt s
|
| null $ gs^.homeScore -> drawPrompt homeScorePrompt s
|
||||||
|
|
Loading…
Reference in New Issue
Block a user