Flatten HUDElement

This commit is contained in:
2025-08-26 16:46:02 +01:00
parent 596880f76a
commit 9034c409e1
24 changed files with 255 additions and 270 deletions
+15 -18
View File
@@ -5,42 +5,36 @@
module Dodge.Data.HUD where
import qualified Data.IntSet as IS
import Dodge.Data.Item.Location
import NewInt
import Control.Lens
import Data.IntMap
import Data.IntSet (IntSet)
import qualified Data.IntSet as IS
import Dodge.Data.Combine
import Dodge.Data.Item.Location
import Dodge.Data.SelectionList
import Geometry.Data
data HUDElement
= DisplayInventory
{ _subInventory :: SubInventory
, _diSections :: IMSS ()
, _diSelection :: Maybe (Int, Int, IntSet)
, _diInvFilter :: Maybe String
, _diCloseFilter :: Maybe String
}
import NewInt
data SubInventory
= NoSubInventory
| ExamineInventory
| MapperInventory
{_mapInvOffset :: Point2
| MapperInventory
{ _mapInvOffset :: Point2
, _mapInvZoom :: Float
, _mapInvItmID :: NewInt ItmInt
}
| CombineInventory
{ _ciSections :: IntMap (SelectionSection CombinableItem)
{ _ciSections :: IMSS CombinableItem
, _ciSelection :: Maybe (Int, Int, IS.IntSet)
, _ciFilter :: Maybe String
}
| DisplayTerminal {_termID :: Int}
data HUD = HUD
{ _hudElement :: HUDElement
{ _subInventory :: SubInventory
, _diSections :: IMSS ()
, _diSelection :: Maybe (Int, Int, IntSet)
, _diInvFilter :: Maybe String
, _diCloseFilter :: Maybe String
, _carteCenter :: Point2
, _carteZoom :: Float
, _carteRot :: Float
@@ -48,6 +42,9 @@ data HUD = HUD
, _closeButtons :: [Int]
}
data Selection
= Sel {_slSec :: Int, _slInt :: Int, _slSet :: IS.IntSet}
| NoSel
makeLenses ''HUD
makeLenses ''HUDElement
makeLenses ''SubInventory
+1 -3
View File
@@ -36,9 +36,7 @@ data SelectionSection a = SelectionSection
type IMSS a = IntMap (SelectionSection a)
data SelectionWidth
= FixedSelectionWidth Int
| UseItemWidth
data SelectionWidth = FixedSelectionWidth Int | UseItemWidth
data SelectionItem a
= SelItem