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 -- key, label, value
[ ( '1', "Edit number", set EGNumber ) [ ( '1', "Edit number", set EGNumber )
, ( '2', "Edit name", set EGName ) , ( '2', "Edit name", set EGName )
, ( '3', "Toggle rookie flag", toggle ) , ( '3', "Toggle rookie flag", toggleRookie )
, ( '4', "Edit YTD stats", set EGYtd ) , ( '4', "Toggle active flag", toggleActive )
, ( '5', "Edit Lifetime stats", set EGLifetime ) , ( '5', "Edit YTD stats", set EGYtd )
, ( '6', "Edit Lifetime stats", set EGLifetime )
, ( 'R', "Return to Edit Menu", edit ) , ( 'R', "Return to Edit Menu", edit )
] ]
where where
set mode = progMode.editGoalieStateL.egsMode .~ mode set mode = progMode.editGoalieStateL.egsMode .~ mode
toggle = editSelectedGoalie (gRookie %~ not) toggleRookie = editSelectedGoalie (gRookie %~ not)
toggleActive = editSelectedGoalie (gActive %~ not)
-- | The 'Goalie' YTD edit menu -- | The 'Goalie' YTD edit menu
editGoalieYtdMenu :: Menu () editGoalieYtdMenu :: Menu ()

View File

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