Fix scroll selection of floor items and buttons

This commit is contained in:
2022-12-25 23:37:42 +00:00
parent 2ae7f2bbc1
commit d2141d90ae
13 changed files with 75 additions and 126 deletions
+2 -1
View File
@@ -13,7 +13,8 @@ import Geometry.Data
data HUDElement
= DisplayInventory
{ _subInventory :: SubInventory}
{ _subInventory :: SubInventory
}
| DisplayCarte
deriving (Eq, Ord, Show, Read) --Generic, Flat)
+8 -5
View File
@@ -1,5 +1,5 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
--{-# LANGUAGE DeriveGeneric #-}
--{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE StrictData #-}
module Dodge.Data.SelectionList where
@@ -8,8 +8,8 @@ import Picture.Data
import Control.Lens
import Data.Set (Set)
import Dodge.Data.CardinalPoint
import Data.Aeson
import Data.Aeson.TH
--import Data.Aeson
--import Data.Aeson.TH
data ListDisplayParams = ListDisplayParams
{ _ldpPosX :: Float
@@ -26,6 +26,7 @@ data SelectionList a = SelectionList
, _slSelPos :: Maybe Int
, _slLength :: Int
}
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
data SelectionWidth = FixedSelectionWidth Int
| VariableSelectionWidth (Int -> Int)
@@ -43,8 +44,10 @@ data SelectionItem a = SelectionItem
, _siOffX :: Int
, _siPayload :: a
}
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
makeLenses ''ListDisplayParams
makeLenses ''SelectionList
makeLenses ''SelectionItem
deriveJSON defaultOptions ''SelectionItem
--deriveJSON defaultOptions ''SelectionItem
--deriveJSON defaultOptions ''SelectionList