diff --git a/src/Mtlstats/Control/EditPlayer.hs b/src/Mtlstats/Control/EditPlayer.hs index 49ae3f1..aade0e0 100644 --- a/src/Mtlstats/Control/EditPlayer.hs +++ b/src/Mtlstats/Control/EditPlayer.hs @@ -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 diff --git a/src/Mtlstats/Prompt/EditPlayer.hs b/src/Mtlstats/Prompt/EditPlayer.hs index 7fcabc7..6890395 100644 --- a/src/Mtlstats/Prompt/EditPlayer.hs +++ b/src/Mtlstats/Prompt/EditPlayer.hs @@ -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 ->