Cleanup
This commit is contained in:
@@ -8,7 +8,7 @@ import Control.Lens
|
||||
import Data.Maybe
|
||||
import Dodge.Base.You
|
||||
import Dodge.Data.World
|
||||
import Dodge.Inventory.ItemSpace
|
||||
import Dodge.Item.SlotsTaken
|
||||
import qualified IntMapHelp as IM
|
||||
|
||||
{- | checks whether or not an item will fit in your inventory
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
module Dodge.Inventory.Color where
|
||||
import Color
|
||||
|
||||
invDimColor :: Color
|
||||
invDimColor = greyN 0.7
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
module Dodge.Inventory.ItemSpace (
|
||||
itSlotsTaken,
|
||||
) where
|
||||
|
||||
import Control.Lens
|
||||
import Dodge.Data.Item
|
||||
import Dodge.Module
|
||||
|
||||
itSlotsTaken :: Item -> Int
|
||||
itSlotsTaken it = case it ^? itUse . useAmount of
|
||||
Nothing -> moduleSizes it + ceiling (_itInvSize it)
|
||||
Just i -> moduleSizes it + ceiling (_itInvSize it * fromIntegral i)
|
||||
@@ -1,26 +1,25 @@
|
||||
module Dodge.Inventory.SelectionList
|
||||
( invSelectionItem
|
||||
, closeObjectToSelectionItem
|
||||
)
|
||||
where
|
||||
module Dodge.Inventory.SelectionList (
|
||||
invSelectionItem,
|
||||
closeObjectToSelectionItem,
|
||||
) where
|
||||
|
||||
import Dodge.Item.Display
|
||||
import Dodge.Inventory.ItemSpace
|
||||
import Picture.Base
|
||||
import Dodge.Data.SelectionList
|
||||
import Dodge.Data.World
|
||||
import Dodge.Item.SlotsTaken
|
||||
import Dodge.Item.Display
|
||||
import LensHelp
|
||||
import Picture.Base
|
||||
|
||||
invSelectionItem :: Creature -> Int -> Item -> SelectionItem ()
|
||||
invSelectionItem cr i it = SelectionItem
|
||||
{ _siPictures = pics
|
||||
, _siHeight = length pics
|
||||
, _siIsSelectable = True
|
||||
--, _siWidth = 15
|
||||
, _siColor = col
|
||||
, _siOffX = 0
|
||||
, _siPayload = ()
|
||||
}
|
||||
invSelectionItem :: Creature -> Int -> Item -> SelectionItem ()
|
||||
invSelectionItem cr i it =
|
||||
SelectionItem
|
||||
{ _siPictures = pics
|
||||
, _siHeight = length pics
|
||||
, _siIsSelectable = True
|
||||
, _siColor = col
|
||||
, _siOffX = 0
|
||||
, _siPayload = ()
|
||||
}
|
||||
where
|
||||
col = _itInvColor it
|
||||
pics = take (itSlotsTaken it) . (++ replicate 10 "*") $ case _itCurseStatus it of
|
||||
@@ -29,19 +28,21 @@ invSelectionItem cr i it = SelectionItem
|
||||
_ -> itemDisplay it
|
||||
|
||||
closeObjectToSelectionItem :: Either FloorItem Button -> SelectionItem ()
|
||||
closeObjectToSelectionItem e = SelectionItem
|
||||
{ _siPictures = pics
|
||||
, _siHeight = length pics
|
||||
, _siIsSelectable = True
|
||||
--, _siWidth = 15
|
||||
, _siColor = col
|
||||
, _siOffX = 2
|
||||
, _siPayload = ()
|
||||
}
|
||||
closeObjectToSelectionItem e =
|
||||
SelectionItem
|
||||
{ _siPictures = pics
|
||||
, _siHeight = length pics
|
||||
, _siIsSelectable = True
|
||||
, --, _siWidth = 15
|
||||
_siColor = col
|
||||
, _siOffX = 2
|
||||
, _siPayload = ()
|
||||
}
|
||||
where
|
||||
(pics,col) = closeObjectToTextPictures e
|
||||
(pics, col) = closeObjectToTextPictures e
|
||||
|
||||
--
|
||||
closeObjectToTextPictures :: Either FloorItem Button -> ([String],Color)
|
||||
closeObjectToTextPictures :: Either FloorItem Button -> ([String], Color)
|
||||
closeObjectToTextPictures e = case e of
|
||||
Left flit -> let it = _flIt flit in ( itemDisplay it, _itInvColor it)
|
||||
Left flit -> let it = _flIt flit in (itemDisplay it, _itInvColor it)
|
||||
Right bt -> ([_btText bt], yellow)
|
||||
|
||||
Reference in New Issue
Block a user