Allow for swapping inventory items

This commit is contained in:
2023-02-23 14:12:08 +00:00
parent 6fff71cdcc
commit 683acf8a05
9 changed files with 161 additions and 104 deletions
+3 -3
View File
@@ -16,9 +16,9 @@ crCancelReloading cr =
& updateProgress
& crManipulation . manObject . inInventory . iselAction .~ NoInvSelAction
where
updateProgress = case crSel cr of
InInventory (SelItem i _) -> crInv . ix i . itUse . heldConsumption . laProgress %~ const Nothing
_ -> id
updateProgress = fromMaybe id $ do
InInventory (SelItem i _) <- cr ^? crManipulation . manObject
return $ crInv . ix i . itUse . heldConsumption . laProgress %~ const Nothing
stepReloading :: Creature -> Creature
stepReloading cr = case cr ^? crManipulation . manObject . inInventory of