Move toward adding multiple equipable items that are not directly usable

This commit is contained in:
2021-12-08 17:09:24 +00:00
parent 9f6e5af991
commit a9139db0a8
22 changed files with 260 additions and 137 deletions
+5
View File
@@ -21,6 +21,7 @@ import ListHelp
import Data.Maybe
import qualified Data.IntMap.Strict as IM
import qualified Data.Set as S
import qualified Data.IntSet as IS
import Control.Lens
import SDL (MouseButton (..))
--import Data.List
@@ -42,6 +43,7 @@ drawInGameHUD cfig w = pictures
inventoryDisplay :: Configuration -> World -> Picture
inventoryDisplay cfig w = listTextPicturesAt 0 0 cfig invlist
<> equipcursor
<> equipcursors
where
cr = you w
inv = _crInv cr
@@ -60,6 +62,9 @@ inventoryDisplay cfig w = listTextPicturesAt 0 0 cfig invlist
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)
subInventoryDisplay :: Configuration -> World -> Picture