implemented lifetime penalty minutes editing

This commit is contained in:
Jonathan Lamothe 2019-11-01 06:48:25 -04:00
parent a07c8a0242
commit b57f12310b
2 changed files with 12 additions and 1 deletions

View File

@ -135,4 +135,9 @@ ltAssistsC = Controller
}
ltPMinC :: Controller
ltPMinC = undefined
ltPMinC = Controller
{ drawController = drawPrompt editPlayerLtPMinPrompt
, handleController = \e -> do
promptHandler editPlayerLtPMinPrompt e
return True
}

View File

@ -28,6 +28,7 @@ module Mtlstats.Prompt.EditPlayer
, editPlayerYtdPMinPrompt
, editPlayerLtGoalsPrompt
, editPlayerLtAssistsPrompt
, editPlayerLtPMinPrompt
) where
import Control.Monad.Extra (whenJustM)
@ -78,6 +79,11 @@ editPlayerLtAssistsPrompt :: Prompt
editPlayerLtAssistsPrompt = numPrompt "Lifetime assists: " $
editPlayer . (pLifetime.psAssists .~)
-- | Prompt to edit a player's lifetime penalty minutes
editPlayerLtPMinPrompt :: Prompt
editPlayerLtPMinPrompt = numPrompt "Lifetime penalty minutes: " $
editPlayer . (pLifetime.psPMin .~)
editPlayer :: (Player -> Player) -> Action ()
editPlayer f =
whenJustM (gets (^.progMode.editPlayerStateL.epsSelectedPlayer)) $ \pid ->