implemented editPlayerNamePrompt
This commit is contained in:
parent
911a61ba57
commit
5bf5a605aa
@ -34,12 +34,17 @@ import Mtlstats.Util
|
|||||||
|
|
||||||
-- | Prompt to edit a player's number
|
-- | Prompt to edit a player's number
|
||||||
editPlayerNumPrompt :: Prompt
|
editPlayerNumPrompt :: Prompt
|
||||||
editPlayerNumPrompt = numPrompt "Player number: " $ \n ->
|
editPlayerNumPrompt = numPrompt "Player number: " $
|
||||||
whenJustM (gets (^.progMode.editPlayerStateL.epsSelectedPlayer)) $ \pid ->
|
editPlayer . (pNumber .~)
|
||||||
modify
|
|
||||||
$ (database.dbPlayers %~ modifyNth pid (pNumber .~ n))
|
|
||||||
. (progMode.editPlayerStateL.epsMode .~ EPMenu)
|
|
||||||
|
|
||||||
-- | Prompt to edit a player's name
|
-- | Prompt to edit a player's name
|
||||||
editPlayerNamePrompt :: Prompt
|
editPlayerNamePrompt :: Prompt
|
||||||
editPlayerNamePrompt = undefined
|
editPlayerNamePrompt = strPrompt "Player name: " $
|
||||||
|
editPlayer . (pName .~)
|
||||||
|
|
||||||
|
editPlayer :: (Player -> Player) -> Action ()
|
||||||
|
editPlayer f =
|
||||||
|
whenJustM (gets (^.progMode.editPlayerStateL.epsSelectedPlayer)) $ \pid ->
|
||||||
|
modify
|
||||||
|
$ (database.dbPlayers %~ modifyNth pid f)
|
||||||
|
. (progMode.editPlayerStateL.epsMode .~ EPMenu)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user