implemented lifetime goals editing
This commit is contained in:
parent
c9b198d106
commit
9840e5a90e
|
@ -119,7 +119,12 @@ ytdPMinC = Controller
|
|||
}
|
||||
|
||||
ltGoalsC :: Controller
|
||||
ltGoalsC = undefined
|
||||
ltGoalsC = Controller
|
||||
{ drawController = drawPrompt editPlayerLtGoalsPrompt
|
||||
, handleController = \e -> do
|
||||
promptHandler editPlayerLtGoalsPrompt e
|
||||
return True
|
||||
}
|
||||
|
||||
ltAssistsC :: Controller
|
||||
ltAssistsC = undefined
|
||||
|
|
|
@ -26,6 +26,7 @@ module Mtlstats.Prompt.EditPlayer
|
|||
, editPlayerYtdGoalsPrompt
|
||||
, editPlayerYtdAssistsPrompt
|
||||
, editPlayerYtdPMinPrompt
|
||||
, editPlayerLtGoalsPrompt
|
||||
) where
|
||||
|
||||
import Control.Monad.Extra (whenJustM)
|
||||
|
@ -66,6 +67,11 @@ editPlayerYtdPMinPrompt :: Prompt
|
|||
editPlayerYtdPMinPrompt = numPrompt "Year-to-date penalty minutes: " $
|
||||
editPlayer . (pYtd.psPMin .~)
|
||||
|
||||
-- | Prompt to edit a player's lifetime goals
|
||||
editPlayerLtGoalsPrompt :: Prompt
|
||||
editPlayerLtGoalsPrompt = numPrompt "Lifetime goals: " $
|
||||
editPlayer . (pLifetime.psGoals .~)
|
||||
|
||||
editPlayer :: (Player -> Player) -> Action ()
|
||||
editPlayer f =
|
||||
whenJustM (gets (^.progMode.editPlayerStateL.epsSelectedPlayer)) $ \pid ->
|
||||
|
|
Loading…
Reference in New Issue
Block a user