From ed240c6a38f8baecdabd659835e0179f9184531d Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Mon, 6 Apr 2020 15:14:48 -0400 Subject: [PATCH] only search through active players/goalies on game input --- src/Mtlstats/Prompt/NewGame.hs | 6 +++--- src/Mtlstats/Prompt/NewGame/GoalieInput.hs | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Mtlstats/Prompt/NewGame.hs b/src/Mtlstats/Prompt/NewGame.hs index eb35b06..b864a91 100644 --- a/src/Mtlstats/Prompt/NewGame.hs +++ b/src/Mtlstats/Prompt/NewGame.hs @@ -76,7 +76,7 @@ recordGoalPrompt -> Int -- ^ The goal number -> Prompt -recordGoalPrompt game goal = selectPlayerPrompt +recordGoalPrompt game goal = selectActivePlayerPrompt ( "*** GAME " ++ padNum 2 game ++ " ***\n" ++ "Who scored goal number " ++ show goal ++ "? " ) $ modify . (progMode.gameStateL.goalBy .~) @@ -90,7 +90,7 @@ recordAssistPrompt -> Int -- ^ The assist number -> Prompt -recordAssistPrompt game goal assist = selectPlayerPrompt +recordAssistPrompt game goal assist = selectActivePlayerPrompt ( "*** GAME " ++ padNum 2 game ++ " ***\n" ++ "Goal: " ++ show goal ++ "\n" ++ "Assist #" ++ show assist ++ ": " @@ -104,7 +104,7 @@ recordAssistPrompt game goal assist = selectPlayerPrompt -- | Prompts for the player to assign penalty minutes to pMinPlayerPrompt :: Prompt -pMinPlayerPrompt = selectPlayerPrompt +pMinPlayerPrompt = selectActivePlayerPrompt "Assign penalty minutes to: " $ \case Nothing -> modify $ progMode.gameStateL.gamePMinsRecorded .~ True diff --git a/src/Mtlstats/Prompt/NewGame/GoalieInput.hs b/src/Mtlstats/Prompt/NewGame/GoalieInput.hs index 3e87aec..df5e6d4 100644 --- a/src/Mtlstats/Prompt/NewGame/GoalieInput.hs +++ b/src/Mtlstats/Prompt/NewGame/GoalieInput.hs @@ -36,7 +36,8 @@ import Mtlstats.Types -- | Prompts for a goalie who played in the game selectGameGoaliePrompt :: Prompt -selectGameGoaliePrompt = selectGoaliePrompt "Which goalie played this game: " $ +selectGameGoaliePrompt = selectActiveGoaliePrompt + "Which goalie played this game: " $ \case Nothing -> modify finishGoalieEntry Just n -> modify $ progMode.gameStateL.gameSelectedGoalie ?~ n