implemented confirmCreateGoalieC

This commit is contained in:
Jonathan Lamothe
2019-10-25 01:07:04 -04:00
parent ed31ce5b1d
commit 2d2ee61aae
2 changed files with 25 additions and 1 deletions
+20 -1
View File
@@ -357,7 +357,26 @@ getGoalieNameC = Controller
}
confirmCreateGoalieC :: Controller
confirmCreateGoalieC = undefined
confirmCreateGoalieC = Controller
{ drawController = \s -> do
let cgs = s^.progMode.createGoalieStateL
C.drawString $ unlines
[ "Goalie number: " ++ show (fromJust $ cgs^.cgsNumber)
, " Goalie name: " ++ cgs^.cgsName
, ""
, "Create goalie: are you sure? (Y/N)"
]
return C.CursorInvisible
, handleController = \e -> do
case ynHandler e of
Just True -> do
modify addGoalie
join $ gets (^.progMode.createGoalieStateL.cgsSuccessCallback)
Just False ->
join $ gets (^.progMode.createGoalieStateL.cgsFailureCallback)
Nothing -> return ()
return True
}
gameGoal :: ProgState -> (Int, Int)
gameGoal s =