From 9980a095edeab06fe16d8238bd2f6a1e7588c1d7 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Tue, 17 Dec 2019 12:04:11 -0500 Subject: [PATCH] added edit menu to main menu --- src/Mtlstats/Actions.hs | 5 +++++ src/Mtlstats/Menu.hs | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Mtlstats/Actions.hs b/src/Mtlstats/Actions.hs index fc03ec1..def83fd 100644 --- a/src/Mtlstats/Actions.hs +++ b/src/Mtlstats/Actions.hs @@ -30,6 +30,7 @@ module Mtlstats.Actions , removeChar , createPlayer , createGoalie + , edit , editPlayer , editGoalie , addPlayer @@ -97,6 +98,10 @@ createGoalie = let & cgsFailureCallback .~ callback in progMode .~ CreateGoalie cgs +-- | Launches the edit menu +edit :: ProgState -> ProgState +edit = undefined + -- | Starts the player editing process editPlayer :: ProgState -> ProgState editPlayer = progMode .~ EditPlayer newEditPlayerState diff --git a/src/Mtlstats/Menu.hs b/src/Mtlstats/Menu.hs index 28c57da..ef9594a 100644 --- a/src/Mtlstats/Menu.hs +++ b/src/Mtlstats/Menu.hs @@ -118,10 +118,8 @@ mainMenu = Menu "*** MAIN MENU ***" True modify createPlayer >> return True , MenuItem '4' "Create Goalie" $ modify createGoalie >> return True - , MenuItem '5' "Edit Player" $ - modify editPlayer >> return True - , MenuItem '6' "Edit Goalie" $ - modify editGoalie >> return True + , MenuItem '5' "Edit" $ + modify edit >> return True , MenuItem 'X' "Exit" $ do db <- gets $ view database liftIO $ do