{-# LANGUAGE DeriveGeneric #-}
-- | Options that affect the behaviour of the client.
module Game.LambdaHack.Client.ClientOptions
  ( ClientOptions(..), defClientOptions
  ) where

import Prelude ()

import Game.LambdaHack.Core.Prelude

import Data.Binary
import GHC.Generics (Generic)

-- | Options that affect the behaviour of the client (but not game rules).
data ClientOptions = ClientOptions
  { ClientOptions -> Maybe Text
sgtkFontFamily     :: Maybe Text
      -- ^ Font family to use for the GTK main game window.
  , ClientOptions -> Maybe Text
sdlFontFile        :: Maybe Text
      -- ^ Font file to use for the SDL2 main game window.
  , ClientOptions -> Maybe Int
sdlScalableSizeAdd :: Maybe Int
      -- ^ Pixels to add to map cells on top of scalable font max glyph height.
      --   To get symmetric padding, add an even number.
  , ClientOptions -> Maybe Int
sdlBitmapSizeAdd   :: Maybe Int
      -- ^ Pixels to add to map cells on top of fixed font max glyph height.
      --   To get symmetric padding, add an even number.
  , ClientOptions -> Maybe Int
sscalableFontSize  :: Maybe Int
      -- ^ Font size to use for the main game window.
  , ClientOptions -> Maybe Int
slogPriority       :: Maybe Int
      -- ^ How much to log (e.g., from SDL). 1 is all, 5 is errors, the default.
  , ClientOptions -> Maybe Int
smaxFps            :: Maybe Int
      -- ^ Maximal frames per second.
      -- This is better low and fixed, to avoid jerkiness and delays
      -- that tell the player there are many intelligent enemies on the level.
      -- That's better than scaling AI sofistication down based
      -- on the FPS setting and machine speed.
  , ClientOptions -> Bool
sdisableAutoYes    :: Bool
      -- ^ Never auto-answer all prompts, even if under AI control.
  , ClientOptions -> Maybe Bool
snoAnim            :: Maybe Bool
      -- ^ Don't show any animations.
  , ClientOptions -> Bool
snewGameCli        :: Bool
      -- ^ Start a new game, overwriting the save file.
  , ClientOptions -> Bool
sbenchmark         :: Bool
      -- ^ Don't create directories and files and show time stats.
  , ClientOptions -> Maybe Text
stitle             :: Maybe Text
  , ClientOptions -> Maybe FilePath
sfontDir           :: Maybe FilePath
  , ClientOptions -> FilePath
ssavePrefixCli     :: String
      -- ^ Prefix of the save game file name.
  , ClientOptions -> Bool
sfrontendTeletype  :: Bool
      -- ^ Whether to use the stdout/stdin frontend.
  , ClientOptions -> Bool
sfrontendNull      :: Bool
      -- ^ Whether to use null (no input/output) frontend.
  , ClientOptions -> Bool
sfrontendLazy      :: Bool
      -- ^ Whether to use lazy (output not even calculated) frontend.
  , ClientOptions -> Bool
sdbgMsgCli         :: Bool
      -- ^ Show clients' internal debug messages.
  , ClientOptions -> Maybe Int
sstopAfterSeconds  :: Maybe Int
  , ClientOptions -> Maybe Int
sstopAfterFrames   :: Maybe Int
  , ClientOptions -> Bool
sprintEachScreen   :: Bool
  , ClientOptions -> Bool
sexposePlaces      :: Bool
  , ClientOptions -> Bool
sexposeItems       :: Bool
  , ClientOptions -> Bool
sexposeActors      :: Bool
  }
  deriving (Int -> ClientOptions -> ShowS
[ClientOptions] -> ShowS
ClientOptions -> FilePath
(Int -> ClientOptions -> ShowS)
-> (ClientOptions -> FilePath)
-> ([ClientOptions] -> ShowS)
-> Show ClientOptions
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
showList :: [ClientOptions] -> ShowS
$cshowList :: [ClientOptions] -> ShowS
show :: ClientOptions -> FilePath
$cshow :: ClientOptions -> FilePath
showsPrec :: Int -> ClientOptions -> ShowS
$cshowsPrec :: Int -> ClientOptions -> ShowS
Show, ClientOptions -> ClientOptions -> Bool
(ClientOptions -> ClientOptions -> Bool)
-> (ClientOptions -> ClientOptions -> Bool) -> Eq ClientOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClientOptions -> ClientOptions -> Bool
$c/= :: ClientOptions -> ClientOptions -> Bool
== :: ClientOptions -> ClientOptions -> Bool
$c== :: ClientOptions -> ClientOptions -> Bool
Eq, (forall x. ClientOptions -> Rep ClientOptions x)
-> (forall x. Rep ClientOptions x -> ClientOptions)
-> Generic ClientOptions
forall x. Rep ClientOptions x -> ClientOptions
forall x. ClientOptions -> Rep ClientOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClientOptions x -> ClientOptions
$cfrom :: forall x. ClientOptions -> Rep ClientOptions x
Generic)

instance Binary ClientOptions

-- | Default value of client options.
defClientOptions :: ClientOptions
defClientOptions :: ClientOptions
defClientOptions = $WClientOptions :: Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Bool
-> Maybe Bool
-> Bool
-> Bool
-> Maybe Text
-> Maybe FilePath
-> FilePath
-> Bool
-> Bool
-> Bool
-> Bool
-> Maybe Int
-> Maybe Int
-> Bool
-> Bool
-> Bool
-> Bool
-> ClientOptions
ClientOptions
  { sgtkFontFamily :: Maybe Text
sgtkFontFamily = Maybe Text
forall a. Maybe a
Nothing
  , sdlFontFile :: Maybe Text
sdlFontFile = Maybe Text
forall a. Maybe a
Nothing
  , sdlScalableSizeAdd :: Maybe Int
sdlScalableSizeAdd = Maybe Int
forall a. Maybe a
Nothing
  , sdlBitmapSizeAdd :: Maybe Int
sdlBitmapSizeAdd = Maybe Int
forall a. Maybe a
Nothing
  , sscalableFontSize :: Maybe Int
sscalableFontSize = Maybe Int
forall a. Maybe a
Nothing
  , slogPriority :: Maybe Int
slogPriority = Maybe Int
forall a. Maybe a
Nothing
  , smaxFps :: Maybe Int
smaxFps = Maybe Int
forall a. Maybe a
Nothing
  , sdisableAutoYes :: Bool
sdisableAutoYes = Bool
False
  , snoAnim :: Maybe Bool
snoAnim = Maybe Bool
forall a. Maybe a
Nothing
  , snewGameCli :: Bool
snewGameCli = Bool
False
  , sbenchmark :: Bool
sbenchmark = Bool
False
  , stitle :: Maybe Text
stitle = Maybe Text
forall a. Maybe a
Nothing
  , sfontDir :: Maybe FilePath
sfontDir = Maybe FilePath
forall a. Maybe a
Nothing
  , ssavePrefixCli :: FilePath
ssavePrefixCli = ""
  , sfrontendTeletype :: Bool
sfrontendTeletype = Bool
False
  , sfrontendNull :: Bool
sfrontendNull = Bool
False
  , sfrontendLazy :: Bool
sfrontendLazy = Bool
False
  , sdbgMsgCli :: Bool
sdbgMsgCli = Bool
False
  , sstopAfterSeconds :: Maybe Int
sstopAfterSeconds = Maybe Int
forall a. Maybe a
Nothing
  , sstopAfterFrames :: Maybe Int
sstopAfterFrames = Maybe Int
forall a. Maybe a
Nothing
  , sprintEachScreen :: Bool
sprintEachScreen = Bool
False
  , sexposePlaces :: Bool
sexposePlaces = Bool
False
  , sexposeItems :: Bool
sexposeItems = Bool
False
  , sexposeActors :: Bool
sexposeActors = Bool
False
  }