Continue inventory tweak

This commit is contained in:
2023-02-16 17:07:59 +00:00
parent 934dd64704
commit 4afc216b25
28 changed files with 106 additions and 94 deletions
+2 -1
View File
@@ -38,7 +38,8 @@ tryPutItemInInv cid flit w = case maybeInvSlot of
createAndSelectItem :: Item -> World -> World
createAndSelectItem itm w = case createPutItem itm w of
(Just i, w') -> w'
& cWorld . lWorld . creatures . ix 0 . crManipulation .~ Manipulator (SelItem i NoInvSelAction)
& cWorld . lWorld . creatures . ix 0 . crManipulation . manObject
.~ InInventory (SelItem i NoInvSelAction)
(Nothing, w') -> w'
createPutItem :: Item -> World -> (Maybe Int, World)
+2 -2
View File
@@ -34,7 +34,7 @@ invSelectionItem' cr i it = SelectionItem
col = _itInvColor it
pics = take (itSlotsTaken it) . (++ replicate 10 "*") $ case _itCurseStatus it of
UndroppableIdentified -> itemDisplay it
_ | cr ^? crManipulation . isel . ispItem == Just i -> selectedItemDisplay cr it
_ | cr ^? crManipulation . manObject . inInventory . ispItem == Just i -> selectedItemDisplay cr it
_ -> itemDisplay it
invSelectionItem :: Creature -> (Int,Item) -> SelectionItem ()
invSelectionItem cr (i,it) = SelectionItem
@@ -50,7 +50,7 @@ invSelectionItem cr (i,it) = SelectionItem
col = _itInvColor it
pics = take (itSlotsTaken it) . (++ replicate 10 "*") $ case _itCurseStatus it of
UndroppableIdentified -> itemDisplay it
_ | cr ^? crManipulation . isel . ispItem == Just i -> selectedItemDisplay cr it
_ | cr ^? crManipulation . manObject . inInventory . ispItem == Just i -> selectedItemDisplay cr it
_ -> itemDisplay it
--
closeObjectToSelectionItem :: Int -> Either FloorItem Button -> SelectionItem ()