From 14386f9c7da622579bde395d764b2b638562278a Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Thu, 13 Feb 2020 15:23:40 -0500 Subject: [PATCH] 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