{-# LANGUAGE DeriveGeneric #-}
-- | UI client options.
module Game.LambdaHack.Client.UI.UIOptions
  ( UIOptions(..)
  ) where

import Prelude ()

import Game.LambdaHack.Core.Prelude

import Control.DeepSeq
import Data.Binary
import GHC.Generics (Generic)

import           Game.LambdaHack.Client.UI.HumanCmd
import qualified Game.LambdaHack.Client.UI.Key as K
import           Game.LambdaHack.Client.UI.Msg
import qualified Game.LambdaHack.Definition.Color as Color

-- | Options that affect the UI of the client.
data UIOptions = UIOptions
  { -- commands
    UIOptions -> [(KM, CmdTriple)]
uCommands           :: [(K.KM, CmdTriple)]
    -- hero names
  , UIOptions -> [(Int, (Text, Text))]
uHeroNames          :: [(Int, (Text, Text))]
    -- ui
  , UIOptions -> Bool
uVi                 :: Bool  -- ^ the option for Vi keys takes precendence
  , UIOptions -> Bool
uLaptop             :: Bool  -- ^ because the laptop keys are the default
  , UIOptions -> Text
uGtkFontFamily      :: Text
  , UIOptions -> Text
uSdlFontFile        :: Text
  , UIOptions -> Int
uSdlScalableSizeAdd :: Int
  , UIOptions -> Int
uSdlBitmapSizeAdd   :: Int
  , UIOptions -> Int
uScalableFontSize   :: Int
  , UIOptions -> Int
uHistoryMax         :: Int
  , UIOptions -> Int
uMaxFps             :: Int
  , UIOptions -> Bool
uNoAnim             :: Bool
  , UIOptions -> Int
uhpWarningPercent   :: Int
      -- ^ HP percent at which warning is emitted.
  , UIOptions -> Maybe [(MsgClass, Color)]
uMessageColors      :: Maybe [(MsgClass, Color.Color)]
  , UIOptions -> [String]
uCmdline            :: [String]
      -- ^ Hardwired commandline arguments to process.
  }
  deriving (Int -> UIOptions -> ShowS
[UIOptions] -> ShowS
UIOptions -> String
(Int -> UIOptions -> ShowS)
-> (UIOptions -> String)
-> ([UIOptions] -> ShowS)
-> Show UIOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UIOptions] -> ShowS
$cshowList :: [UIOptions] -> ShowS
show :: UIOptions -> String
$cshow :: UIOptions -> String
showsPrec :: Int -> UIOptions -> ShowS
$cshowsPrec :: Int -> UIOptions -> ShowS
Show, (forall x. UIOptions -> Rep UIOptions x)
-> (forall x. Rep UIOptions x -> UIOptions) -> Generic UIOptions
forall x. Rep UIOptions x -> UIOptions
forall x. UIOptions -> Rep UIOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UIOptions x -> UIOptions
$cfrom :: forall x. UIOptions -> Rep UIOptions x
Generic)

instance NFData UIOptions

instance Binary UIOptions