implemented player position editing
This commit is contained in:
parent
5bf5a605aa
commit
fc31794ef4
|
@ -87,7 +87,12 @@ nameC = Controller
|
|||
}
|
||||
|
||||
positionC :: Controller
|
||||
positionC = undefined
|
||||
positionC = Controller
|
||||
{ drawController = drawPrompt editPlayerPosPrompt
|
||||
, handleController = \e -> do
|
||||
promptHandler editPlayerPosPrompt e
|
||||
return True
|
||||
}
|
||||
|
||||
ytdGoalsC :: Controller
|
||||
ytdGoalsC = undefined
|
||||
|
|
|
@ -22,6 +22,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||
module Mtlstats.Prompt.EditPlayer
|
||||
( editPlayerNumPrompt
|
||||
, editPlayerNamePrompt
|
||||
, editPlayerPosPrompt
|
||||
) where
|
||||
|
||||
import Control.Monad.Extra (whenJustM)
|
||||
|
@ -42,6 +43,11 @@ editPlayerNamePrompt :: Prompt
|
|||
editPlayerNamePrompt = strPrompt "Player name: " $
|
||||
editPlayer . (pName .~)
|
||||
|
||||
-- | Prompt to edit a player's position
|
||||
editPlayerPosPrompt :: Prompt
|
||||
editPlayerPosPrompt = strPrompt "Player position: " $
|
||||
editPlayer . (pPosition .~)
|
||||
|
||||
editPlayer :: (Player -> Player) -> Action ()
|
||||
editPlayer f =
|
||||
whenJustM (gets (^.progMode.editPlayerStateL.epsSelectedPlayer)) $ \pid ->
|
||||
|
|
Loading…
Reference in New Issue
Block a user