Refactor section sizing

This commit is contained in:
2024-11-24 09:42:46 +00:00
parent 1e4fd1690f
commit 896b452539
5 changed files with 214 additions and 110 deletions
+5 -7
View File
@@ -1,5 +1,6 @@
module Dodge.Default.World where
import Color
import NewInt
import Control.Lens
import Data.Graph.Inductive.Graph hiding ((&))
@@ -163,8 +164,6 @@ defaultDisplayInventory :: HUDElement
defaultDisplayInventory =
DisplayInventory
{ _subInventory = NoSubInventory
-- {_nsSelected = MouseInvNothing
-- }
, _diSections = defaultInvSections
, _diSelection = Just (1,0)
, _diSelectionExtra = mempty
@@ -175,8 +174,10 @@ defaultDisplayInventory =
defaultInvSections :: IM.IntMap (SelectionSection ())
defaultInvSections = IM.fromDistinctAscList $
zip
[-1 ..]
[ defaultFiltSection
[-2 ..]
[ defaultSS & ssDescriptor .~ "STATUS"
& ssItems .~ IM.fromAscList [(0,SelectionItem ["STATUS"] 1 False white 0 ())]
, defaultFiltSection
, defaultInvSection
, defaultYouSection
, defaultFiltSection & ssIndent .~ 2
@@ -188,7 +189,6 @@ defaultSS :: SelectionSection a
defaultSS =
SelectionSection
{ _ssItems = mempty
, _ssMinSize = 10
, _ssOffset = 0
, _ssShownItems = []
, _ssIndent = 0
@@ -206,7 +206,6 @@ defaultFiltSection =
defaultSS
& ssIndent .~ 0
& ssDescriptor .~ "INV"
& ssMinSize .~ 0
defaultInvSection :: SelectionSection ()
defaultInvSection =
@@ -217,5 +216,4 @@ defaultYouSection :: SelectionSection ()
defaultYouSection =
defaultSS
& ssIndent .~ 2
& ssMinSize .~ 1
& ssDescriptor .~ "YOUR STATUS"