implemented year-to-date goal editing
This commit is contained in:
parent
fc31794ef4
commit
4e9b3f635d
@ -95,7 +95,12 @@ positionC = Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
ytdGoalsC :: Controller
|
ytdGoalsC :: Controller
|
||||||
ytdGoalsC = undefined
|
ytdGoalsC = Controller
|
||||||
|
{ drawController = drawPrompt editPlayerYtdGoalsPrompt
|
||||||
|
, handleController = \e -> do
|
||||||
|
promptHandler editPlayerYtdGoalsPrompt e
|
||||||
|
return True
|
||||||
|
}
|
||||||
|
|
||||||
ytdAssistsC :: Controller
|
ytdAssistsC :: Controller
|
||||||
ytdAssistsC = undefined
|
ytdAssistsC = undefined
|
||||||
|
@ -23,6 +23,7 @@ module Mtlstats.Prompt.EditPlayer
|
|||||||
( editPlayerNumPrompt
|
( editPlayerNumPrompt
|
||||||
, editPlayerNamePrompt
|
, editPlayerNamePrompt
|
||||||
, editPlayerPosPrompt
|
, editPlayerPosPrompt
|
||||||
|
, editPlayerYtdGoalsPrompt
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Control.Monad.Extra (whenJustM)
|
import Control.Monad.Extra (whenJustM)
|
||||||
@ -48,6 +49,11 @@ editPlayerPosPrompt :: Prompt
|
|||||||
editPlayerPosPrompt = strPrompt "Player position: " $
|
editPlayerPosPrompt = strPrompt "Player position: " $
|
||||||
editPlayer . (pPosition .~)
|
editPlayer . (pPosition .~)
|
||||||
|
|
||||||
|
-- | Prompt to edit a player's year-to-date goals
|
||||||
|
editPlayerYtdGoalsPrompt :: Prompt
|
||||||
|
editPlayerYtdGoalsPrompt = numPrompt "Year-to-date goals: " $
|
||||||
|
editPlayer . (pYtd.psGoals .~)
|
||||||
|
|
||||||
editPlayer :: (Player -> Player) -> Action ()
|
editPlayer :: (Player -> Player) -> Action ()
|
||||||
editPlayer f =
|
editPlayer f =
|
||||||
whenJustM (gets (^.progMode.editPlayerStateL.epsSelectedPlayer)) $ \pid ->
|
whenJustM (gets (^.progMode.editPlayerStateL.epsSelectedPlayer)) $ \pid ->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user