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