{-# LANGUAGE DeriveGeneric #-}
module Game.LambdaHack.Client.UI.HumanCmd
( CmdCategory(..), categoryDescription
, CmdArea(..), areaDescription
, CmdTriple, HumanCmd(..)
, TriggerItem(..), TriggerTile(..)
) where
import Prelude ()
import Game.LambdaHack.Common.Prelude
import Control.DeepSeq
import Data.Binary
import GHC.Generics (Generic)
import qualified NLP.Miniutter.English as MU
import Game.LambdaHack.Common.Misc
import Game.LambdaHack.Common.Vector
import qualified Game.LambdaHack.Content.TileKind as TK
data CmdCategory =
CmdMainMenu | CmdDashboard | CmdItemMenu
| CmdMove | CmdItem | CmdAim | CmdMeta | CmdMouse
| CmdInternal | CmdNoHelp | CmdDebug | CmdMinimal
deriving (Show, Read, Eq, Generic)
instance NFData CmdCategory
instance Binary CmdCategory
categoryDescription :: CmdCategory -> Text
categoryDescription CmdMainMenu = "Main menu"
categoryDescription CmdDashboard = "Dashboard"
categoryDescription CmdItemMenu = "Item menu commands"
categoryDescription CmdMove = "Terrain exploration and alteration"
categoryDescription CmdItem = "Remaining item-related commands"
categoryDescription CmdAim = "Aiming"
categoryDescription CmdMeta = "Assorted"
categoryDescription CmdMouse = "Mouse"
categoryDescription CmdInternal = "Internal"
categoryDescription CmdNoHelp = "Ignored in help"
categoryDescription CmdDebug = "Debug"
categoryDescription CmdMinimal = "The minimal command set"
data CmdArea =
CaMessage
| CaMapLeader
| CaMapParty
| CaMap
| CaLevelNumber
| CaArenaName
| CaPercentSeen
| CaXhairDesc
| CaSelected
| CaCalmGauge
| CaHPGauge
| CaTargetDesc
deriving (Show, Read, Eq, Ord, Generic)
instance NFData CmdArea
instance Binary CmdArea
areaDescription :: CmdArea -> Text
areaDescription ca = case ca of
CaMessage -> "message line"
CaMapLeader -> "leader on map"
CaMapParty -> "party on map"
CaMap -> "the map area"
CaLevelNumber -> "level number"
CaArenaName -> "level caption"
CaPercentSeen -> "percent seen"
CaXhairDesc -> "x-hair info"
CaSelected -> "party roster"
CaCalmGauge -> "Calm gauge"
CaHPGauge -> "HP gauge"
CaTargetDesc -> "target info"
type CmdTriple = ([CmdCategory], Text, HumanCmd)
data HumanCmd =
Macro [String]
| ByArea [(CmdArea, HumanCmd)]
| ByAimMode {exploration :: HumanCmd, aiming :: HumanCmd}
| ComposeIfLocal HumanCmd HumanCmd
| ComposeUnlessError HumanCmd HumanCmd
| Compose2ndLocal HumanCmd HumanCmd
| LoopOnNothing HumanCmd
| ExecuteIfClear HumanCmd
| Wait
| Wait10
| MoveDir Vector
| RunDir Vector
| RunOnceAhead
| MoveOnceToXhair
| RunOnceToXhair
| ContinueToXhair
| MoveItem [CStore] CStore (Maybe MU.Part) Bool
| Project
| Apply
| AlterDir [TriggerTile]
| AlterWithPointer [TriggerTile]
| Help
| Hint
| ItemMenu
| MainMenu
| Dashboard
| GameDifficultyIncr
| GameWolfToggle
| GameFishToggle
| GameScenarioIncr
| GameRestart
| GameExit
| GameSave
| Tactic
| Automate
| SortSlots
| ChooseItem ItemDialogMode
| ChooseItemMenu ItemDialogMode
| ChooseItemProject [TriggerItem]
| ChooseItemApply [TriggerItem]
| PickLeader Int
| PickLeaderWithPointer
| MemberCycle
| MemberBack
| SelectActor
| SelectNone
| SelectWithPointer
| Repeat Int
| Record
| History
| MarkVision
| MarkSmell
| MarkSuspect
| SettingsMenu
| ChallengesMenu
| PrintScreen
| Cancel
| Accept
| TgtClear
| ItemClear
| MoveXhair Vector Int
| AimTgt
| AimFloor
| AimEnemy
| AimItem
| AimAscend Int
| EpsIncr Bool
| XhairUnknown
| XhairItem
| XhairStair Bool
| XhairPointerFloor
| XhairPointerEnemy
| AimPointerFloor
| AimPointerEnemy
deriving (Show, Read, Eq, Ord, Generic)
instance NFData HumanCmd
instance Binary HumanCmd
data TriggerItem =
TriggerItem {tiverb :: MU.Part, tiobject :: MU.Part, tisymbols :: [Char]}
deriving (Show, Eq, Ord, Generic)
instance Read TriggerItem where
readsPrec = error $ "parsing of TriggerItem not implemented" `showFailure` ()
instance NFData TriggerItem
instance Binary TriggerItem
data TriggerTile =
TriggerTile {ttverb :: MU.Part, ttobject :: MU.Part, ttfeature :: TK.Feature}
deriving (Show, Eq, Ord, Generic)
instance Read TriggerTile where
readsPrec = error $ "parsing of TriggerTile not implemented" `showFailure` ()
instance NFData TriggerTile
instance Binary TriggerTile