Files
loop/src/Dodge/Config/Data.hs
T

56 lines
1.7 KiB
Haskell

{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE StrictData #-}
module Dodge.Config.Data
where
import Data.Aeson
import GHC.Generics
import Control.Lens
data Configuration = Configuration
{ _volume_master :: Float
, _volume_sound :: Float
, _volume_music :: Float
, _wall_textured :: Bool
, _cloud_shadows :: Bool
, _resolution_factor :: Int -- ^ Higher values divide screen size, i.e. make the resolution worse
, _windowX :: Float
, _windowY :: Float
, _windowPosX :: Int
, _windowPosY :: Int
, _rotate_to_wall :: Bool
, _show_sound :: Bool
, _debug_seconds_frame :: Bool
, _debug_noclip :: Bool
, _debug_cr_status :: Bool
, _debug_view_boundaries :: Bool
, _debug_pathing :: Bool
}
deriving (Generic, Show)
makeLenses ''Configuration
instance ToJSON Configuration where
toEncoding = genericToEncoding defaultOptions
instance FromJSON Configuration
defaultConfig :: Configuration
defaultConfig = Configuration
{ _volume_master = 1
, _volume_sound = 1
, _volume_music = 1
, _wall_textured = True
, _cloud_shadows = True
, _resolution_factor = 1
, _windowX = 800
, _windowY = 600
, _windowPosX = 0
, _windowPosY = 0
, _rotate_to_wall = True
, _show_sound = False
, _debug_seconds_frame = True
, _debug_noclip = False
, _debug_cr_status = False
, _debug_view_boundaries = False
, _debug_pathing = False
}