From c72278f72886543850759f08525d01cd5c23b30e Mon Sep 17 00:00:00 2001 From: justin Date: Wed, 11 Sep 2024 16:04:33 +0100 Subject: [PATCH] Commit before working on displaying composed items in inventory --- ghcidOutput | 2 +- src/Dodge/Data/SelectionList.hs | 12 ++++++++++++ src/Dodge/TestString.hs | 11 +++++------ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ghcidOutput b/ghcidOutput index 69a8cf80b..fb19e99c2 100644 --- a/ghcidOutput +++ b/ghcidOutput @@ -1 +1 @@ -All good (614 modules, at 11:30:44) +All good (614 modules, at 15:05:45) diff --git a/src/Dodge/Data/SelectionList.hs b/src/Dodge/Data/SelectionList.hs index cc458a0cd..97de94930 100644 --- a/src/Dodge/Data/SelectionList.hs +++ b/src/Dodge/Data/SelectionList.hs @@ -5,6 +5,7 @@ module Dodge.Data.SelectionList where +import Dodge.Data.DoubleTree import Color import Control.Lens import Data.IntMap.Strict (IntMap) @@ -61,6 +62,17 @@ data SelectionSection a = SelectionSection , _ssIndent :: Int , _ssDescriptor :: String } + | + SelectionTreeSection + { _stsItems :: DoubleTree (SelectionItem a) + , _ssCursor :: Maybe SectionCursor + , _ssMinSize :: Int + , _ssOffset :: Int + , _ssShownItems :: [Picture] + , _ssIndent :: Int + , _ssDescriptor :: String + } + data SelectionWidth = FixedSelectionWidth Int diff --git a/src/Dodge/TestString.hs b/src/Dodge/TestString.hs index 265195515..a7533b624 100644 --- a/src/Dodge/TestString.hs +++ b/src/Dodge/TestString.hs @@ -16,14 +16,13 @@ import Data.ByteString.Lazy.Char8 (unpack) import qualified Data.Aeson.Encode.Pretty as AEP import Control.Lens import Dodge.Data.Universe ---import Data.Maybe ---import ShortShow ---import qualified Data.Map.Strict as M import qualified IntMapHelp as IM + testStringInit :: Universe -> [String] -testStringInit u = fromMaybe mempty $ do - inv <- fmap invLDT $ u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crInv - return $ concatMap (prettyLDT (\(x,_,_,_) -> take 5 (show $ x ^. itType . iyBase))) inv +testStringInit _ = mempty +--testStringInit u = fromMaybe mempty $ do +-- 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) -- [fromMaybe "" $ do