From 6d77caaa146144b448ea7de36cc925b0e5d46344 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Thu, 13 Feb 2020 02:31:20 -0500 Subject: [PATCH 01/12] added cpsRookieFlag and cgsRookieFlag --- src/Mtlstats/Types.hs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Mtlstats/Types.hs b/src/Mtlstats/Types.hs index 275d382..b2adc9e 100644 --- a/src/Mtlstats/Types.hs +++ b/src/Mtlstats/Types.hs @@ -88,11 +88,13 @@ module Mtlstats.Types ( cpsNumber, cpsName, cpsPosition, + cpsRookieFlag, cpsSuccessCallback, cpsFailureCallback, -- ** CreateGoalieState Lenses cgsNumber, cgsName, + cgsRookieFlag, cgsSuccessCallback, cgsFailureCallback, -- ** EditPlayerState Lenses @@ -328,6 +330,8 @@ data CreatePlayerState = CreatePlayerState -- ^ The player's name , _cpsPosition :: String -- ^ The player's position + , _cpsRookieFlag :: Maybe Bool + -- ^ Indicates whether or not the player is a rookie , _cpsSuccessCallback :: Action () -- ^ The function to call on success , _cpsFailureCallback :: Action () @@ -336,10 +340,12 @@ data CreatePlayerState = CreatePlayerState -- | Goalie creation status data CreateGoalieState = CreateGoalieState - { _cgsNumber :: Maybe Int + { _cgsNumber :: Maybe Int -- ^ The goalie's number - , _cgsName :: String + , _cgsName :: String -- ^ The goalie's name + , _cgsRookieFlag :: Maybe Bool + -- ^ Indicates whether or not the goalie is a rookie , _cgsSuccessCallback :: Action () -- ^ The function to call on success , _cgsFailureCallback :: Action () @@ -807,6 +813,7 @@ newCreatePlayerState = CreatePlayerState { _cpsNumber = Nothing , _cpsName = "" , _cpsPosition = "" + , _cpsRookieFlag = Nothing , _cpsSuccessCallback = return () , _cpsFailureCallback = return () } @@ -816,6 +823,7 @@ newCreateGoalieState :: CreateGoalieState newCreateGoalieState = CreateGoalieState { _cgsNumber = Nothing , _cgsName = "" + , _cgsRookieFlag = Nothing , _cgsSuccessCallback = return () , _cgsFailureCallback = return () } From fefa217df11faffd08d5485669b6d4939db0bc95 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Thu, 13 Feb 2020 02:55:51 -0500 Subject: [PATCH 02/12] implemented Mtlstats.Control.CreatePlayer.getRookieFlagC ...also refactored some other controllers to use promptController --- src/Mtlstats/Control/CreatePlayer.hs | 34 ++++++++++++---------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/src/Mtlstats/Control/CreatePlayer.hs b/src/Mtlstats/Control/CreatePlayer.hs index 01b8275..9283d1a 100644 --- a/src/Mtlstats/Control/CreatePlayer.hs +++ b/src/Mtlstats/Control/CreatePlayer.hs @@ -35,32 +35,28 @@ import Mtlstats.Types -- | Handles player creation createPlayerC :: CreatePlayerState -> Controller createPlayerC cps - | null $ cps^.cpsNumber = getPlayerNumC - | null $ cps^.cpsName = getPlayerNameC - | null $ cps^.cpsPosition = getPlayerPosC - | otherwise = confirmCreatePlayerC + | 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 } From 4315b40732e394069ee82888b3bb3710ef35bdc1 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Thu, 13 Feb 2020 03:10:02 -0500 Subject: [PATCH 03/12] added rookie flag to player creation confirmation --- src/Mtlstats/Control/CreatePlayer.hs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Mtlstats/Control/CreatePlayer.hs b/src/Mtlstats/Control/CreatePlayer.hs index 9283d1a..dcc3232 100644 --- a/src/Mtlstats/Control/CreatePlayer.hs +++ b/src/Mtlstats/Control/CreatePlayer.hs @@ -23,11 +23,11 @@ module Mtlstats.Control.CreatePlayer (createPlayerC) where import Control.Monad (join) import Control.Monad.Trans.State (gets, modify) -import Data.Maybe (fromJust) import Lens.Micro ((^.), (.~), (?~), (%~), to) import qualified UI.NCurses as C import Mtlstats.Actions +import Mtlstats.Format import Mtlstats.Handlers import Mtlstats.Prompt import Mtlstats.Types @@ -64,10 +64,16 @@ confirmCreatePlayerC :: Controller confirmCreatePlayerC = Controller { drawController = \s -> do let cps = s^.progMode.createPlayerStateL - C.drawString $ " Player number: " ++ show (fromJust $ cps^.cpsNumber) ++ "\n" - C.drawString $ " Player name: " ++ cps^.cpsName ++ "\n" - C.drawString $ "Player position: " ++ cps^.cpsPosition ++ "\n\n" - C.drawString "Create player: are you sure? (Y/N)" + C.drawString $ unlines + $ labelTable + [ ( "Player number", maybe "?" show $ cps^.cpsNumber ) + , ( "Player name", cps^.cpsName ) + , ( "Player position", cps^.cpsPosition ) + , ( "Rookie", maybe "?" show $ cps^.cpsRookieFlag ) + ] + ++ [ "" + , "Create player: are you sure? (Y/N)" + ] return C.CursorInvisible , handleController = \e -> do case ynHandler e of From c22849bb3bc6ec408a3a47279f15f06ad8758ff2 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Thu, 13 Feb 2020 10:35:35 -0500 Subject: [PATCH 04/12] set rookie flag on player creation --- src/Mtlstats/Actions.hs | 4 +++- test/ActionsSpec.hs | 51 +++++++++++++++++++++++++---------------- 2 files changed, 34 insertions(+), 21 deletions(-) diff --git a/src/Mtlstats/Actions.hs b/src/Mtlstats/Actions.hs index 4e13f23..e89884a 100644 --- a/src/Mtlstats/Actions.hs +++ b/src/Mtlstats/Actions.hs @@ -161,11 +161,13 @@ editSelectedGoalie f s = fromMaybe s $ do addPlayer :: ProgState -> ProgState addPlayer s = fromMaybe s $ do let cps = s^.progMode.createPlayerStateL - num <- cps^.cpsNumber + num <- cps^.cpsNumber + rFlag <- cps^.cpsRookieFlag let name = cps^.cpsName pos = cps^.cpsPosition player = newPlayer num name pos + & pRookie .~ rFlag Just $ s & database.dbPlayers %~ (++[player]) diff --git a/test/ActionsSpec.hs b/test/ActionsSpec.hs index 1f7666a..bcfa98e 100644 --- a/test/ActionsSpec.hs +++ b/test/ActionsSpec.hs @@ -312,28 +312,39 @@ editSelectedGoalieSpec = describe "editSelectedGoalie" $ mapM_ goalie' n = newGoalie n "foo" addPlayerSpec :: Spec -addPlayerSpec = describe "addPlayer" $ do - let - p1 = newPlayer 1 "Joe" "centre" - p2 = newPlayer 2 "Bob" "defense" - db = newDatabase - & dbPlayers .~ [p1] - s pm = newProgState - & progMode .~ pm - & database .~ db +addPlayerSpec = describe "addPlayer" $ mapM_ + (\(label, expectation, pm, players) -> context label $ + it expectation $ let + ps = newProgState + & progMode .~ pm + & database.dbPlayers .~ [joe] + ps' = addPlayer ps + in ps'^.database.dbPlayers `shouldBe` players) - context "data available" $ - it "should create the player" $ let - s' = addPlayer $ s $ CreatePlayer $ newCreatePlayerState - & cpsNumber ?~ 2 - & cpsName .~ "Bob" - & cpsPosition .~ "defense" - in s'^.database.dbPlayers `shouldBe` [p1, p2] + -- label, expectation, progMode, players + [ ( "wrong mode", failure, MainMenu, [joe] ) + , ( "missing number", failure, noNum, [joe] ) + , ( "missing rookie flag", failure, noRookie, [joe] ) + , ( "rookie", success, mkRookie, [joe, rookie] ) + , ( "normal player", success, mkNormal, [joe, normal] ) + ] - context "data unavailable" $ - it "should not create the player" $ let - s' = addPlayer $ s MainMenu - in s'^.database.dbPlayers `shouldBe` [p1] + where + failure = "should not create the player" + success = "should create the player" + noNum = mkpm Nothing (Just False) + noRookie = mkpm (Just 3) Nothing + mkRookie = mkpm (Just 3) (Just True) + mkNormal = mkpm (Just 3) (Just False) + joe = newPlayer 2 "Joe" "centre" + rookie = bob True + normal = bob False + bob rf = newPlayer 3 "Bob" "defense" & pRookie .~ rf + mkpm n rf = CreatePlayer $ newCreatePlayerState + & cpsNumber .~ n + & cpsName .~ "Bob" + & cpsPosition .~ "defense" + & cpsRookieFlag .~ rf addGoalieSpec :: Spec addGoalieSpec = describe "addGoalie" $ do From 2941998058ccd18382e822dd73030e0ddd2da7de Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Thu, 13 Feb 2020 11:08:32 -0500 Subject: [PATCH 05/12] only edit player lifetime stats if rookie ...on new player creation --- src/Mtlstats/Control/CreatePlayer.hs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Mtlstats/Control/CreatePlayer.hs b/src/Mtlstats/Control/CreatePlayer.hs index dcc3232..42049f2 100644 --- a/src/Mtlstats/Control/CreatePlayer.hs +++ b/src/Mtlstats/Control/CreatePlayer.hs @@ -21,7 +21,6 @@ along with this program. If not, see . module Mtlstats.Control.CreatePlayer (createPlayerC) where -import Control.Monad (join) import Control.Monad.Trans.State (gets, modify) import Lens.Micro ((^.), (.~), (?~), (%~), to) import qualified UI.NCurses as C @@ -76,18 +75,22 @@ confirmCreatePlayerC = Controller ] return C.CursorInvisible , handleController = \e -> do + cps <- gets (^.progMode.createPlayerStateL) + let + success = cps^.cpsSuccessCallback + failure = cps^.cpsFailureCallback case ynHandler e of Just True -> do pid <- gets (^.database.dbPlayers.to length) - cb <- gets (^.progMode.createPlayerStateL.cpsSuccessCallback) - modify - $ (progMode.editPlayerStateL + let rookie = cps^.cpsRookieFlag == Just True + modify addPlayer + if rookie + then success + else modify (progMode.editPlayerStateL %~ (epsSelectedPlayer ?~ pid) . (epsMode .~ EPLtGoals True) - . (epsCallback .~ cb)) - . addPlayer - Just False -> - join $ gets (^.progMode.createPlayerStateL.cpsFailureCallback) + . (epsCallback .~ success)) + Just False -> failure Nothing -> return () return True } From fe28e96145096869524ed5ad1604ba6628c59c5f Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Thu, 13 Feb 2020 14:45:43 -0500 Subject: [PATCH 06/12] use promptController in Mtlstats.Control.CreateGoalie --- src/Mtlstats/Control/CreateGoalie.hs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/Mtlstats/Control/CreateGoalie.hs b/src/Mtlstats/Control/CreateGoalie.hs index 7f20116..43befb4 100644 --- a/src/Mtlstats/Control/CreateGoalie.hs +++ b/src/Mtlstats/Control/CreateGoalie.hs @@ -40,20 +40,10 @@ createGoalieC cgs | otherwise = confirmCreateGoalieC getGoalieNumC :: Controller -getGoalieNumC = Controller - { drawController = drawPrompt goalieNumPrompt - , handleController = \e -> do - promptHandler goalieNumPrompt e - return True - } +getGoalieNumC = promptController goalieNumPrompt getGoalieNameC :: Controller -getGoalieNameC = Controller - { drawController = drawPrompt goalieNamePrompt - , handleController = \e -> do - promptHandler goalieNamePrompt e - return True - } +getGoalieNameC = promptController goalieNamePrompt confirmCreateGoalieC :: Controller confirmCreateGoalieC = Controller From ec10aa799850af1c5bacf716fbf20e7fe862c7e3 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Thu, 13 Feb 2020 14:57:29 -0500 Subject: [PATCH 07/12] ask if a new goalie is a rookie --- src/Mtlstats/Control/CreateGoalie.hs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/Mtlstats/Control/CreateGoalie.hs b/src/Mtlstats/Control/CreateGoalie.hs index 43befb4..69e3a1f 100644 --- a/src/Mtlstats/Control/CreateGoalie.hs +++ b/src/Mtlstats/Control/CreateGoalie.hs @@ -35,9 +35,10 @@ import Mtlstats.Types -- | Handles goalie creation createGoalieC :: CreateGoalieState -> Controller createGoalieC cgs - | null $ cgs^.cgsNumber = getGoalieNumC - | null $ cgs^.cgsName = getGoalieNameC - | otherwise = confirmCreateGoalieC + | null $ cgs^.cgsNumber = getGoalieNumC + | null $ cgs^.cgsName = getGoalieNameC + | null $ cgs^.cgsRookieFlag = getRookieFlagC + | otherwise = confirmCreateGoalieC getGoalieNumC :: Controller getGoalieNumC = promptController goalieNumPrompt @@ -45,6 +46,16 @@ getGoalieNumC = promptController goalieNumPrompt getGoalieNameC :: Controller getGoalieNameC = promptController goalieNamePrompt +getRookieFlagC :: Controller +getRookieFlagC = Controller + { drawController = const $ do + C.drawString "Is this goalie a rookie? (Y/N)" + return C.CursorInvisible + , handleController = \e -> do + modify $ progMode.createGoalieStateL.cgsRookieFlag .~ ynHandler e + return True + } + confirmCreateGoalieC :: Controller confirmCreateGoalieC = Controller { drawController = \s -> do From 14386f9c7da622579bde395d764b2b638562278a Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Thu, 13 Feb 2020 15:23:40 -0500 Subject: [PATCH 08/12] display whether or not goalie is a rookie on creation confirmation --- src/Mtlstats/Control/CreateGoalie.hs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Mtlstats/Control/CreateGoalie.hs b/src/Mtlstats/Control/CreateGoalie.hs index 69e3a1f..1be1929 100644 --- a/src/Mtlstats/Control/CreateGoalie.hs +++ b/src/Mtlstats/Control/CreateGoalie.hs @@ -23,11 +23,11 @@ module Mtlstats.Control.CreateGoalie (createGoalieC) where import Control.Monad (join) import Control.Monad.Trans.State (gets, modify) -import Data.Maybe (fromJust) import Lens.Micro ((^.), (.~), (?~), (%~), to) import qualified UI.NCurses as C import Mtlstats.Actions +import Mtlstats.Format import Mtlstats.Handlers import Mtlstats.Prompt import Mtlstats.Types @@ -61,11 +61,14 @@ 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)" - ] + $ labelTable + [ ( "Goalie number", maybe "?" show $ cgs^.cgsNumber ) + , ( "Goalie name", cgs^.cgsName ) + , ( "Rookie", maybe "?" show $ cgs^.cgsRookieFlag ) + ] + ++ [ "" + , "Create goalie: are you sure? (Y/N)" + ] return C.CursorInvisible , handleController = \e -> do case ynHandler e of From e51953650c88ca76a97bb69f42b5a7eb6eb82e19 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Thu, 13 Feb 2020 19:45:36 -0500 Subject: [PATCH 09/12] set rookie flag appropriately on goalie creation --- src/Mtlstats/Actions.hs | 4 +++- test/ActionsSpec.hs | 49 +++++++++++++++++++++++++---------------- 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/src/Mtlstats/Actions.hs b/src/Mtlstats/Actions.hs index e89884a..ea97a55 100644 --- a/src/Mtlstats/Actions.hs +++ b/src/Mtlstats/Actions.hs @@ -175,10 +175,12 @@ addPlayer s = fromMaybe s $ do addGoalie :: ProgState -> ProgState addGoalie s = fromMaybe s $ do let cgs = s^.progMode.createGoalieStateL - num <- cgs^.cgsNumber + num <- cgs^.cgsNumber + rFlag <- cgs^.cgsRookieFlag let name = cgs^.cgsName goalie = newGoalie num name + & gRookie .~ rFlag Just $ s & database.dbGoalies %~ (++[goalie]) diff --git a/test/ActionsSpec.hs b/test/ActionsSpec.hs index bcfa98e..f0cb89a 100644 --- a/test/ActionsSpec.hs +++ b/test/ActionsSpec.hs @@ -347,27 +347,38 @@ addPlayerSpec = describe "addPlayer" $ mapM_ & cpsRookieFlag .~ rf addGoalieSpec :: Spec -addGoalieSpec = describe "addGoalie" $ do - let - g1 = newGoalie 2 "Joe" - g2 = newGoalie 3 "Bob" - db = newDatabase - & dbGoalies .~ [g1] - s pm = newProgState - & database .~ db - & progMode .~ pm +addGoalieSpec = describe "addGoalie" $ mapM_ + (\(label, expectation, pm, goalies) -> context label $ + it expectation $ let + ps = newProgState + & progMode .~ pm + & database.dbGoalies .~ [joe] + ps' = addGoalie ps + in ps'^.database.dbGoalies `shouldBe` goalies) - context "data available" $ - it "should create the goalie" $ let - s' = addGoalie $ s $ CreateGoalie $ newCreateGoalieState - & cgsNumber ?~ 3 - & cgsName .~ "Bob" - in s'^.database.dbGoalies `shouldBe` [g1, g2] + -- label, expectation, progMode, expected goalies + [ ( "wrong mode", failure, MainMenu, [joe] ) + , ( "no number", failure, noNum, [joe] ) + , ( "no rookie flag", failure, noRookie, [joe] ) + , ( "rookie", success, mkRookie, [joe, rookie] ) + , ( "normal goalie", success, mkNormal, [joe, normal] ) + ] - context "data unavailable" $ - it "should not create the goalie" $ let - s' = addGoalie $ s MainMenu - in s'^.database.dbGoalies `shouldBe` [g1] + where + failure = "should not create the goalie" + success = "should create the goalie" + noNum = cgs Nothing (Just False) + noRookie = cgs (Just 3) Nothing + mkRookie = cgs (Just 3) (Just True) + mkNormal = cgs (Just 3) (Just False) + joe = newGoalie 2 "Joe" + rookie = bob True + normal = bob False + bob r = newGoalie 3 "Bob" & gRookie .~ r + cgs n rf = CreateGoalie $ newCreateGoalieState + & cgsNumber .~ n + & cgsName .~ "Bob" + & cgsRookieFlag .~ rf resetCreatePlayerStateSpec :: Spec resetCreatePlayerStateSpec = describe "resetCreatePlayerState" $ let From 6bb4601e6b3c5c093535f130fa99e1355d514069 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Thu, 13 Feb 2020 20:03:27 -0500 Subject: [PATCH 10/12] only ask for goalie lifetime stats when not rookie --- src/Mtlstats/Control/CreateGoalie.hs | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/Mtlstats/Control/CreateGoalie.hs b/src/Mtlstats/Control/CreateGoalie.hs index 1be1929..ae4cd27 100644 --- a/src/Mtlstats/Control/CreateGoalie.hs +++ b/src/Mtlstats/Control/CreateGoalie.hs @@ -21,7 +21,6 @@ along with this program. If not, see . module Mtlstats.Control.CreateGoalie (createGoalieC) where -import Control.Monad (join) import Control.Monad.Trans.State (gets, modify) import Lens.Micro ((^.), (.~), (?~), (%~), to) import qualified UI.NCurses as C @@ -71,18 +70,22 @@ confirmCreateGoalieC = Controller ] return C.CursorInvisible , handleController = \e -> do + cgs <- gets (^.progMode.createGoalieStateL) + let + success = cgs^.cgsSuccessCallback + failure = cgs^.cgsFailureCallback case ynHandler e of Just True -> do gid <- gets (^.database.dbGoalies.to length) - cb <- gets (^.progMode.createGoalieStateL.cgsSuccessCallback) - modify - $ (progMode.editGoalieStateL + let rookie = cgs^.cgsRookieFlag == Just True + modify addGoalie + if rookie + then success + else modify $ progMode.editGoalieStateL %~ (egsSelectedGoalie ?~ gid) - . (egsMode .~ EGLtGames True) - . (egsCallback .~ cb)) - . addGoalie - Just False -> - join $ gets (^.progMode.createGoalieStateL.cgsFailureCallback) - Nothing -> return () + . (egsMode .~ EGLtGames True) + . (egsCallback .~ success) + Just False -> failure + Nothing -> return () return True } From 214710661a95454f5b83cf9ba14839682088b6a7 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Thu, 13 Feb 2020 20:08:10 -0500 Subject: [PATCH 11/12] code cleanup --- src/Mtlstats/Control/CreateGoalie.hs | 4 ++-- src/Mtlstats/Control/CreatePlayer.hs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Mtlstats/Control/CreateGoalie.hs b/src/Mtlstats/Control/CreateGoalie.hs index ae4cd27..d902210 100644 --- a/src/Mtlstats/Control/CreateGoalie.hs +++ b/src/Mtlstats/Control/CreateGoalie.hs @@ -83,8 +83,8 @@ confirmCreateGoalieC = Controller then success else modify $ progMode.editGoalieStateL %~ (egsSelectedGoalie ?~ gid) - . (egsMode .~ EGLtGames True) - . (egsCallback .~ success) + . (egsMode .~ EGLtGames True) + . (egsCallback .~ success) Just False -> failure Nothing -> return () return True diff --git a/src/Mtlstats/Control/CreatePlayer.hs b/src/Mtlstats/Control/CreatePlayer.hs index 42049f2..2aeb4d2 100644 --- a/src/Mtlstats/Control/CreatePlayer.hs +++ b/src/Mtlstats/Control/CreatePlayer.hs @@ -86,10 +86,10 @@ confirmCreatePlayerC = Controller modify addPlayer if rookie then success - else modify (progMode.editPlayerStateL + else modify $ progMode.editPlayerStateL %~ (epsSelectedPlayer ?~ pid) - . (epsMode .~ EPLtGoals True) - . (epsCallback .~ success)) + . (epsMode .~ EPLtGoals True) + . (epsCallback .~ success) Just False -> failure Nothing -> return () return True From 7c4b7331e813590d7023798e2083550b02f00214 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Thu, 13 Feb 2020 20:12:00 -0500 Subject: [PATCH 12/12] updated change log --- ChangeLog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog.md b/ChangeLog.md index fa5d06a..008ee0b 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -2,6 +2,7 @@ ## current - Added autocomplete to player position prompt +- Don't prompt for lifetime stats on rookie player/goalie creation ## 0.12.0 - Edit lifetime stats on new player/goalie creation