implemented goalie name prompt

This commit is contained in:
Jonathan Lamothe 2019-10-25 00:45:39 -04:00
parent ec914a38b1
commit 0812ae3ddd
2 changed files with 12 additions and 2 deletions

View File

@ -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

View File

@ -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