allow user to toggle active flag for Player/Goalie

This commit is contained in:
Jonathan Lamothe 2020-01-11 01:48:53 -05:00
parent 063bebfbb5
commit 75cd253f3f
2 changed files with 14 additions and 10 deletions

View File

@ -40,15 +40,17 @@ editGoalieMenu = Menu "*** EDIT GOALTENDER ***" () $ map
-- key, label, value
[ ( '1', "Edit number", set EGNumber )
, ( '2', "Edit name", set EGName )
, ( '3', "Toggle rookie flag", toggle )
, ( '4', "Edit YTD stats", set EGYtd )
, ( '5', "Edit Lifetime stats", set EGLifetime )
, ( '3', "Toggle rookie flag", toggleRookie )
, ( '4', "Toggle active flag", toggleActive )
, ( '5', "Edit YTD stats", set EGYtd )
, ( '6', "Edit Lifetime stats", set EGLifetime )
, ( 'R', "Return to Edit Menu", edit )
]
where
set mode = progMode.editGoalieStateL.egsMode .~ mode
toggle = editSelectedGoalie (gRookie %~ not)
set mode = progMode.editGoalieStateL.egsMode .~ mode
toggleRookie = editSelectedGoalie (gRookie %~ not)
toggleActive = editSelectedGoalie (gActive %~ not)
-- | The 'Goalie' YTD edit menu
editGoalieYtdMenu :: Menu ()

View File

@ -41,15 +41,17 @@ editPlayerMenu = Menu "*** EDIT PLAYER ***" () $ map
[ ( '1', "Edit number", set EPNumber )
, ( '2', "Edit name", set EPName )
, ( '3', "Edit position", set EPPosition )
, ( '4', "Toggle rookie flag", toggle )
, ( '5', "Edit YTD stats", set EPYtd )
, ( '6', "Edit lifetime stats", set EPLifetime )
, ( '4', "Toggle rookie flag", toggleRookie )
, ( '5', "Toggle active flag", toggleActive )
, ( '6', "Edit YTD stats", set EPYtd )
, ( '7', "Edit lifetime stats", set EPLifetime )
, ( 'R', "Return to Edit Menu", edit )
]
where
set mode = progMode.editPlayerStateL.epsMode .~ mode
toggle = editSelectedPlayer $ pRookie %~ not
set mode = progMode.editPlayerStateL.epsMode .~ mode
toggleRookie = editSelectedPlayer $ pRookie %~ not
toggleActive = editSelectedPlayer $ pActive %~ not
-- | The 'Player' YTD stats edit menu
editPlayerYtdMenu :: Menu ()