added goalie creation to main menu

This commit is contained in:
Jonathan Lamothe
2019-10-30 01:29:16 -04:00
parent e94bf59c81
commit 67bb12920c
3 changed files with 24 additions and 6 deletions
+14 -5
View File
@@ -31,6 +31,7 @@ module Mtlstats.Actions
, updateGameStats
, validateGameDate
, createPlayer
, createGoalie
, addPlayer
, recordGoalAssists
, awardGoal
@@ -139,13 +140,21 @@ validateGameDate s = fromMaybe s $ do
-- | Starts player creation mode
createPlayer :: ProgState -> ProgState
createPlayer = let
cb = modify $ progMode .~ MainMenu
cps
= newCreatePlayerState
& cpsSuccessCallback .~ cb
& cpsFailureCallback .~ cb
callback = modify $ progMode .~ MainMenu
cps = newCreatePlayerState
& cpsSuccessCallback .~ callback
& cpsFailureCallback .~ callback
in progMode .~ CreatePlayer cps
-- | Starts goalie creation mode
createGoalie :: ProgState -> ProgState
createGoalie = let
callback = modify $ progMode .~ MainMenu
cgs = newCreateGoalieState
& cgsSuccessCallback .~ callback
& cgsFailureCallback .~ callback
in progMode .~ CreateGoalie cgs
-- | Adds the entered player to the roster
addPlayer :: ProgState -> ProgState
addPlayer s = fromMaybe s $ do