Commit before working on displaying composed items in inventory

This commit is contained in:
2024-09-11 16:04:33 +01:00
parent 60c399935e
commit c72278f728
3 changed files with 18 additions and 7 deletions
+1 -1
View File
@@ -1 +1 @@
All good (614 modules, at 11:30:44) All good (614 modules, at 15:05:45)
+12
View File
@@ -5,6 +5,7 @@
module Dodge.Data.SelectionList where module Dodge.Data.SelectionList where
import Dodge.Data.DoubleTree
import Color import Color
import Control.Lens import Control.Lens
import Data.IntMap.Strict (IntMap) import Data.IntMap.Strict (IntMap)
@@ -61,6 +62,17 @@ data SelectionSection a = SelectionSection
, _ssIndent :: Int , _ssIndent :: Int
, _ssDescriptor :: String , _ssDescriptor :: String
} }
|
SelectionTreeSection
{ _stsItems :: DoubleTree (SelectionItem a)
, _ssCursor :: Maybe SectionCursor
, _ssMinSize :: Int
, _ssOffset :: Int
, _ssShownItems :: [Picture]
, _ssIndent :: Int
, _ssDescriptor :: String
}
data SelectionWidth data SelectionWidth
= FixedSelectionWidth Int = FixedSelectionWidth Int
+5 -6
View File
@@ -16,14 +16,13 @@ import Data.ByteString.Lazy.Char8 (unpack)
import qualified Data.Aeson.Encode.Pretty as AEP import qualified Data.Aeson.Encode.Pretty as AEP
import Control.Lens import Control.Lens
import Dodge.Data.Universe import Dodge.Data.Universe
--import Data.Maybe
--import ShortShow
--import qualified Data.Map.Strict as M
import qualified IntMapHelp as IM import qualified IntMapHelp as IM
testStringInit :: Universe -> [String] testStringInit :: Universe -> [String]
testStringInit u = fromMaybe mempty $ do testStringInit _ = mempty
inv <- fmap invLDT $ u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crInv --testStringInit u = fromMaybe mempty $ do
return $ concatMap (prettyLDT (\(x,_,_,_) -> take 5 (show $ x ^. itType . iyBase))) inv -- inv <- fmap invLDT $ u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crInv
-- return $ concatMap (prettyLDT (\(x,_,_,_) -> take 5 (show $ x ^. itType . iyBase))) inv
--testStringInit u = maybe [] invTree (u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crInv) --testStringInit u = maybe [] invTree (u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crInv)
-- [fromMaybe "" $ do -- [fromMaybe "" $ do