mtlstats/src/Mtlstats/UI.hs
2019-08-20 10:41:15 -04:00

53 lines
1.3 KiB
Haskell

{- |
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.UI (draw) where
import Lens.Micro ((^.))
import qualified UI.NCurses as C
import Mtlstats.Types
-- | Drawing function
draw :: ProgState -> C.Curses ()
draw s = do
w <- C.defaultWindow
C.updateWindow w $ do
C.clear
case s ^. progMode of
MainMenu -> mainMenu
NewSeason -> newSeason
C.render
mainMenu :: C.Update ()
mainMenu = C.drawString $ unlines
[ "*** MAIN MENU ***"
, "1) New Season"
, "2) Exit"
]
newSeason :: C.Update ()
newSeason = C.drawString $ unlines
[ "*** SEASON TYPE ***"
, "1) Regular Season"
, "2) Playoffs"
]