implemented nameC

This commit is contained in:
Jonathan Lamothe 2019-11-01 06:10:37 -04:00
parent ece289d68d
commit 911a61ba57
2 changed files with 14 additions and 2 deletions

View File

@ -79,7 +79,12 @@ numberC = Controller
}
nameC :: Controller
nameC = undefined
nameC = Controller
{ drawController = drawPrompt editPlayerNamePrompt
, handleController = \e -> do
promptHandler editPlayerNamePrompt e
return True
}
positionC :: Controller
positionC = undefined

View File

@ -19,7 +19,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
-}
module Mtlstats.Prompt.EditPlayer (editPlayerNumPrompt) where
module Mtlstats.Prompt.EditPlayer
( editPlayerNumPrompt
, editPlayerNamePrompt
) where
import Control.Monad.Extra (whenJustM)
import Control.Monad.Trans.State (gets, modify)
@ -36,3 +39,7 @@ editPlayerNumPrompt = numPrompt "Player number: " $ \n ->
modify
$ (database.dbPlayers %~ modifyNth pid (pNumber .~ n))
. (progMode.editPlayerStateL.epsMode .~ EPMenu)
-- | Prompt to edit a player's name
editPlayerNamePrompt :: Prompt
editPlayerNamePrompt = undefined