Rethink item ammo to item consumables, start item type datatype
This commit is contained in:
@@ -11,7 +11,7 @@ data Configuration = Configuration
|
||||
, _volume_music :: Float
|
||||
, _wall_textured :: Bool
|
||||
, _cloud_shadows :: Bool
|
||||
, _resolution_factor :: Int -- ^ Higher values divide screen size, i.e. make the resolution worse
|
||||
, _resolution_factor :: ResFactor
|
||||
, _windowX :: Float
|
||||
, _windowY :: Float
|
||||
, _windowPosX :: Int
|
||||
@@ -25,6 +25,17 @@ data Configuration = Configuration
|
||||
, _debug_pathing :: Bool
|
||||
}
|
||||
deriving (Generic, Show)
|
||||
data ResFactor = FullRes | HalfRes | QuarterRes
|
||||
deriving (Generic, Show, Eq, Ord, Enum, Bounded)
|
||||
instance ToJSON ResFactor where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON ResFactor
|
||||
resFactorNum :: ResFactor -> Int
|
||||
resFactorNum rf = case rf of
|
||||
FullRes -> 1
|
||||
HalfRes -> 2
|
||||
QuarterRes -> 4
|
||||
|
||||
makeLenses ''Configuration
|
||||
|
||||
instance ToJSON Configuration where
|
||||
@@ -39,7 +50,7 @@ defaultConfig = Configuration
|
||||
, _volume_music = 1
|
||||
, _wall_textured = True
|
||||
, _cloud_shadows = True
|
||||
, _resolution_factor = 1
|
||||
, _resolution_factor = FullRes
|
||||
, _windowX = 800
|
||||
, _windowY = 600
|
||||
, _windowPosX = 0
|
||||
|
||||
Reference in New Issue
Block a user