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