Implement telescoping inventory selection
This commit is contained in:
@@ -9,11 +9,8 @@ import Dodge.Inventory.Color
|
||||
import Dodge.Item.Display
|
||||
import Dodge.Inventory.ItemSpace
|
||||
import Picture.Base
|
||||
import Dodge.Inventory.CheckSlots
|
||||
import Dodge.Base.You
|
||||
import Dodge.Data.SelectionList
|
||||
import Dodge.Data.World
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
import LensHelp
|
||||
|
||||
--makeInventorySelectionList :: World -> SelectionList ()
|
||||
@@ -21,18 +18,6 @@ import LensHelp
|
||||
-- & slItems .~ inventorySelectionList w
|
||||
-- & slSelPos .~ inventoryCursorPos w
|
||||
--
|
||||
inventorySelectionList :: World -> [SelectionItem ()]
|
||||
inventorySelectionList w = map (invSelectionItem cr) (IM.toList inv)
|
||||
++ [SelectionItem [thetext] 1 True (length thetext) invDimColor 2 ()]
|
||||
++ map (closeObjectToSelectionItem nfreeslots) (w ^. hud . closeObjects)
|
||||
where
|
||||
cr = you w
|
||||
inv = _crInv cr
|
||||
nfreeslots = crNumFreeSlots cr
|
||||
thetext = case nfreeslots of
|
||||
0 -> " INVENTORY FULL"
|
||||
1 -> " +1 FREE SLOT"
|
||||
x -> " +" ++ show x ++ " FREE SLOTS"
|
||||
--
|
||||
--inventoryCursorPos :: World -> Maybe Int
|
||||
--inventoryCursorPos w = case w ^? hud . hudElement . subInventory of
|
||||
|
||||
Reference in New Issue
Block a user