Files
loop/src/Dodge/Data/HUD.hs
T
2024-10-25 22:19:04 +01:00

62 lines
1.5 KiB
Haskell

{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.HUD where
import Data.IntMap
import Control.Lens
import Dodge.Data.Button
import Dodge.Data.Combine
import Dodge.Data.FloorItem
import Dodge.Data.SelectionList
import Geometry.Data
data HUDElement
= DisplayInventory
{ _subInventory :: SubInventory
, _diSections :: IntMap (SelectionSection ())
, _diSelection :: Maybe (Int, Int)
, _diFilters :: IntMap (Maybe String)
, _diSelectionExtra :: Int
}
| DisplayCarte
data MouseInventorySelection
= MouseInvSelect
{_misSelStart :: (Int, Int), _misMaybeEnd :: Maybe (Int, Int)}
| MouseInvDrag
| MouseInvNothing
data SubInventory
= NoSubInventory
{ _nsSelected :: MouseInventorySelection
, _nsMouseOver :: Maybe (Int, Int)
}
| ExamineInventory
| CombineInventory
{ _ciSections :: IntMap (SelectionSection CombinableItem)
, _ciSelection :: Maybe (Int, Int)
, _ciFilters :: IntMap (Maybe String)
}
| LockedInventory
| DisplayTerminal {_termID :: Int}
-- deriving (Eq, Ord, Show, Read) --Generic, Flat)
data HUD = HUD
{ _hudElement :: HUDElement
, _carteCenter :: Point2
, _carteZoom :: Float
, _carteRot :: Float
, _closeObjects :: [Either FloorItem Button]
}
-- deriving (Eq, Ord, Show, Read) --Generic, Flat)
makeLenses ''HUD
makeLenses ''HUDElement
makeLenses ''SubInventory
makeLenses ''MouseInventorySelection