diff --git a/src/Mtlstats/Control.hs b/src/Mtlstats/Control.hs index 11653ec..d3b6f54 100644 --- a/src/Mtlstats/Control.hs +++ b/src/Mtlstats/Control.hs @@ -349,7 +349,12 @@ getGoalieNumC = Controller } getGoalieNameC :: Controller -getGoalieNameC = undefined +getGoalieNameC = Controller + { drawController = drawPrompt goalieNamePrompt + , handleController = \e -> do + promptHandler goalieNamePrompt e + return True + } confirmCreateGoalieC :: Controller confirmCreateGoalieC = undefined diff --git a/src/Mtlstats/Prompt.hs b/src/Mtlstats/Prompt.hs index fd5e490..4d3ae45 100644 --- a/src/Mtlstats/Prompt.hs +++ b/src/Mtlstats/Prompt.hs @@ -41,7 +41,8 @@ module Mtlstats.Prompt ( recordAssistPrompt, pMinPlayerPrompt, assignPMinsPrompt, - goalieNumPrompt + goalieNumPrompt, + goalieNamePrompt ) where import Control.Monad (when) @@ -250,5 +251,9 @@ goalieNumPrompt :: Prompt goalieNumPrompt = numPrompt "Goalie number: " $ modify . (progMode.createGoalieStateL.cgsNumber ?~) +goalieNamePrompt :: Prompt +goalieNamePrompt = strPrompt "Goalie name: " $ + modify . (progMode.createGoalieStateL.cgsName .~) + drawSimplePrompt :: String -> ProgState -> C.Update () drawSimplePrompt pStr s = C.drawString $ pStr ++ s^.inputBuffer