implemented Mtlstats.Control.CreatePlayer.getRookieFlagC
...also refactored some other controllers to use promptController
This commit is contained in:
parent
6d77caaa14
commit
fefa217df1
|
@ -38,29 +38,25 @@ createPlayerC cps
|
|||
| null $ cps^.cpsNumber = getPlayerNumC
|
||||
| null $ cps^.cpsName = getPlayerNameC
|
||||
| null $ cps^.cpsPosition = getPlayerPosC
|
||||
| null $ cps^.cpsRookieFlag = getRookieFlagC
|
||||
| otherwise = confirmCreatePlayerC
|
||||
|
||||
getPlayerNumC :: Controller
|
||||
getPlayerNumC = Controller
|
||||
{ drawController = drawPrompt playerNumPrompt
|
||||
, handleController = \e -> do
|
||||
promptHandler playerNumPrompt e
|
||||
return True
|
||||
}
|
||||
getPlayerNumC = promptController playerNumPrompt
|
||||
|
||||
getPlayerNameC :: Controller
|
||||
getPlayerNameC = Controller
|
||||
{ drawController = drawPrompt playerNamePrompt
|
||||
, handleController = \e -> do
|
||||
promptHandler playerNamePrompt e
|
||||
return True
|
||||
}
|
||||
getPlayerNameC = promptController playerNamePrompt
|
||||
|
||||
getPlayerPosC :: Controller
|
||||
getPlayerPosC = Controller
|
||||
{ drawController = drawPrompt playerPosPrompt
|
||||
getPlayerPosC = promptController playerPosPrompt
|
||||
|
||||
getRookieFlagC :: Controller
|
||||
getRookieFlagC = Controller
|
||||
{ drawController = const $ do
|
||||
C.drawString "Is this player a rookie? (Y/N)"
|
||||
return C.CursorInvisible
|
||||
, handleController = \e -> do
|
||||
promptHandler playerPosPrompt e
|
||||
modify $ progMode.createPlayerStateL.cpsRookieFlag .~ ynHandler e
|
||||
return True
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user