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^.cpsNumber = getPlayerNumC
|
||||||
| null $ cps^.cpsName = getPlayerNameC
|
| null $ cps^.cpsName = getPlayerNameC
|
||||||
| null $ cps^.cpsPosition = getPlayerPosC
|
| null $ cps^.cpsPosition = getPlayerPosC
|
||||||
|
| null $ cps^.cpsRookieFlag = getRookieFlagC
|
||||||
| otherwise = confirmCreatePlayerC
|
| otherwise = confirmCreatePlayerC
|
||||||
|
|
||||||
getPlayerNumC :: Controller
|
getPlayerNumC :: Controller
|
||||||
getPlayerNumC = Controller
|
getPlayerNumC = promptController playerNumPrompt
|
||||||
{ drawController = drawPrompt playerNumPrompt
|
|
||||||
, handleController = \e -> do
|
|
||||||
promptHandler playerNumPrompt e
|
|
||||||
return True
|
|
||||||
}
|
|
||||||
|
|
||||||
getPlayerNameC :: Controller
|
getPlayerNameC :: Controller
|
||||||
getPlayerNameC = Controller
|
getPlayerNameC = promptController playerNamePrompt
|
||||||
{ drawController = drawPrompt playerNamePrompt
|
|
||||||
, handleController = \e -> do
|
|
||||||
promptHandler playerNamePrompt e
|
|
||||||
return True
|
|
||||||
}
|
|
||||||
|
|
||||||
getPlayerPosC :: Controller
|
getPlayerPosC :: Controller
|
||||||
getPlayerPosC = Controller
|
getPlayerPosC = promptController playerPosPrompt
|
||||||
{ drawController = drawPrompt playerPosPrompt
|
|
||||||
|
getRookieFlagC :: Controller
|
||||||
|
getRookieFlagC = Controller
|
||||||
|
{ drawController = const $ do
|
||||||
|
C.drawString "Is this player a rookie? (Y/N)"
|
||||||
|
return C.CursorInvisible
|
||||||
, handleController = \e -> do
|
, handleController = \e -> do
|
||||||
promptHandler playerPosPrompt e
|
modify $ progMode.createPlayerStateL.cpsRookieFlag .~ ynHandler e
|
||||||
return True
|
return True
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user