Add "equipped" text
This commit is contained in:
@@ -5,6 +5,7 @@ module Dodge.Inventory
|
||||
, invSelPos
|
||||
, invSelSize
|
||||
, selNumPos
|
||||
, selNumTextPos
|
||||
, selNumCol
|
||||
, selNumSlots
|
||||
, selNumMidHeight
|
||||
@@ -93,6 +94,13 @@ selNumPos i w = splitgap + (foldl' (+) 0 . fst $ IM.split i (augmentedInvSizes w
|
||||
| i < length (yourInv w) = 0
|
||||
| otherwise = 1
|
||||
|
||||
selNumTextPos :: Configuration -> World -> Int -> Point2
|
||||
selNumTextPos cfig w i = V2 (150 - hw) ( hh + 20 * fromIntegral ipos + 7.5)
|
||||
where
|
||||
hh = halfHeight cfig
|
||||
hw = halfWidth cfig
|
||||
ipos = selNumPos i w
|
||||
|
||||
selNumMidHeight :: Configuration -> World -> Int -> Point2
|
||||
selNumMidHeight cfig w i = V2 (150 - hw) ( hh + bump - (20 * fromIntegral ipos + 7.5))
|
||||
where
|
||||
|
||||
@@ -48,7 +48,7 @@ inventoryDisplay cfig w = listTextPicturesAt 0 0 cfig invlist
|
||||
cr = you w
|
||||
inv = _crInv cr
|
||||
invlist = concatMap itemText (IM.elems inv)
|
||||
++ displayFreeSlots
|
||||
++ displayFreeSlots
|
||||
++ map floorItemsColor (concatMap (closeObjectToTextPictures nfreeslots) (_closeObjects w))
|
||||
floorItemsColor
|
||||
| _inventoryMode w == TopInventory = id
|
||||
@@ -60,11 +60,9 @@ inventoryDisplay cfig w = listTextPicturesAt 0 0 cfig invlist
|
||||
x -> [color invDimColor . text $ " +" ++ show x ++ " FREE SLOTS"]
|
||||
equipcursor = case _crLeftInvSel cr of
|
||||
Nothing -> mempty
|
||||
Just invid -> listCursorNES 0 0 cfig (selNumPos invid w) yellow topInvW
|
||||
(selNumSlots invid w)
|
||||
equipcursors = foldMap f (IS.toList $ _crInvEquipped cr)
|
||||
where
|
||||
f ei = listCursorNES 5 5 cfig (selNumPos ei w) blue topInvW (selNumSlots ei w)
|
||||
Just invid -> f cyan invid
|
||||
equipcursors = foldMap (f yellow) (IS.toList $ _crInvEquipped cr)
|
||||
f col invid = listTextPictureAt 144 0 cfig (selNumPos invid w) . color col $ text "EQUIPPED"
|
||||
|
||||
|
||||
subInventoryDisplay :: Configuration -> World -> Picture
|
||||
|
||||
Reference in New Issue
Block a user