Fix rb scrolling

This commit is contained in:
2022-12-31 22:29:12 +00:00
parent beac123dd2
commit 0dc9a09723
11 changed files with 44 additions and 37 deletions
+3 -5
View File
@@ -25,6 +25,7 @@ module Dodge.Inventory (
invDimColor,
) where
import Dodge.Reloading
import Color
import Dodge.Inventory.Color
import qualified Data.Map.Strict as M
@@ -52,11 +53,11 @@ rmInvItem ::
World ->
World
rmInvItem cid invid w = case w ^? getcid . crInv . ix invid . itUse . useAmount of
Just x | x > 1 -> w & pointcid . crInv . ix invid . itUse . useAmount %~ subtract 1
Just x | x > 1 -> w & pointcid . crInv . ix invid . itUse . useAmount -~ 1
_ ->
w
& pointcid . crInv %~ f
& pointcid . crInvSel %~ stopCrInvSelAction
& pointcid %~ crCancelReloading
& pointcid . crInvSel . iselPos %~ g
& pointcid . crLeftInvSel . lisMPos %~ g'
& removeAnySlotEquipment
@@ -70,9 +71,6 @@ rmInvItem cid invid w = case w ^? getcid . crInv . ix invid . itUse . useAmount
getcid = cWorld . lWorld . creatures . ix cid
pointcid = cWorld . lWorld . creatures . ix cid
stopCrInvSelAction (InvSel i a)
| i == invid = InvSel i NoInvSelAction
| otherwise = InvSel i a
cr = w ^?! cWorld . lWorld . creatures . ix cid
itm = _crInv cr IM.! invid
dounequipfunction = fromMaybe id $ do