From db8bbd978612a6a0886fe98b66f413737744a4bf Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Fri, 11 Oct 2019 22:24:27 -0400 Subject: [PATCH] added scrollOffset field to ProgState --- src/Mtlstats/Types.hs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Mtlstats/Types.hs b/src/Mtlstats/Types.hs index 31ddf14..a310c51 100644 --- a/src/Mtlstats/Types.hs +++ b/src/Mtlstats/Types.hs @@ -42,6 +42,7 @@ module Mtlstats.Types ( database, progMode, inputBuffer, + scrollOffset, -- ** ProgMode Lenses gameStateL, createPlayerStateL, @@ -172,12 +173,14 @@ type Action a = StateT ProgState C.Curses a -- | Represents the program state data ProgState = ProgState - { _database :: Database + { _database :: Database -- ^ The data to be saved - , _progMode :: ProgMode + , _progMode :: ProgMode -- ^ The program's mode - , _inputBuffer :: String + , _inputBuffer :: String -- ^ Buffer for user input + , _scrollOffset :: Int + -- ^ The scrolling offset for the display } -- | The program mode @@ -507,9 +510,10 @@ createPlayerStateL = lens -- | Constructor for a 'ProgState' newProgState :: ProgState newProgState = ProgState - { _database = newDatabase - , _progMode = MainMenu - , _inputBuffer = "" + { _database = newDatabase + , _progMode = MainMenu + , _inputBuffer = "" + , _scrollOffset = 0 } -- | Constructor for a 'GameState'