broke Mtlstats.Menu.EditGoalie module off from Mtlstats.Menu

This commit is contained in:
Jonathan Lamothe 2019-11-12 09:48:15 -05:00
parent f1f0ffef99
commit 3c9b7dd989
3 changed files with 45 additions and 5 deletions

View File

@ -27,6 +27,7 @@ import Lens.Micro ((^.))
import UI.NCurses as C import UI.NCurses as C
import Mtlstats.Menu import Mtlstats.Menu
import Mtlstats.Menu.EditGoalie
import Mtlstats.Prompt import Mtlstats.Prompt
import Mtlstats.Prompt.EditGoalie import Mtlstats.Prompt.EditGoalie
import Mtlstats.Types import Mtlstats.Types

View File

@ -31,7 +31,6 @@ module Mtlstats.Menu (
gameMonthMenu, gameMonthMenu,
gameTypeMenu, gameTypeMenu,
editPlayerMenu, editPlayerMenu,
editGoalieMenu,
gameGoalieMenu gameGoalieMenu
) where ) where
@ -172,10 +171,6 @@ editPlayerMenu = Menu "*** EDIT PLAYER ***" () $ map
, ( '0', "Finished editing", Nothing ) , ( '0', "Finished editing", Nothing )
] ]
-- | The 'Goalie' edit menu
editGoalieMenu :: Menu ()
editGoalieMenu = undefined
-- | Game goalie selection menu -- | Game goalie selection menu
gameGoalieMenu :: ProgState -> Menu () gameGoalieMenu :: ProgState -> Menu ()
gameGoalieMenu s = let gameGoalieMenu s = let

View File

@ -0,0 +1,44 @@
{- |
mtlstats
Copyright (C) 2019 Rhéal Lamothe
<rheal.lamothe@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-}
module Mtlstats.Menu.EditGoalie (editGoalieMenu) where
import Control.Monad.Trans.State (modify)
import Data.Maybe (maybe)
import Lens.Micro ((.~))
import Mtlstats.Types
import Mtlstats.Types.Menu
-- | The 'Goalie' edit menu
editGoalieMenu :: Menu ()
editGoalieMenu = Menu "*** EDIT GOALTENDER ***" () $ map
(\(key, label, val) -> MenuItem key label $ modify $ maybe
(progMode .~ MainMenu)
(progMode.editGoalieStateL.egsMode .~)
val)
-- key, label, value
[ ( '1', "Edit number", Just EGNumber )
, ( '2', "Edit name", Just EGName )
, ( '3', "Edit YTD stats", Just EGYtd )
, ( '4', "Edit Lifetime stats", Just EGLifetime )
, ( 'R', "Return to Main Menu", Nothing )
]