Improve inventory management, item pickup to cursor pos

This commit is contained in:
jgk
2021-03-08 19:26:12 +01:00
parent c8705a88c2
commit 13cc9501a7
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -322,7 +322,7 @@ pickUpItem' flit w = case maybeInvSlot of
& creatures . ix 0 . crInv . ix i %~ addItem it
where
it = _flIt flit
maybeInvSlot = checkInvSlots it (_crInv (_creatures w IM.! 0))
maybeInvSlot = checkInvSlotsYou it w
updateItLocation invid w'
= case _itID it of Nothing -> w'
Just j -> w' & itemPositions . ix j .~ InInv 0 invid
+1 -1
View File
@@ -82,7 +82,7 @@ activeObjectText w = case closestActiveObject w of
theIt = _flIt flit
itScreenPos = sc $ rotateV (0 - _cameraRot w) $ _cameraZoom w *.* (_flItPos flit -.- _cameraPos w)
freeSlot = checkInvSlots theIt $ _crInv $ you w
freeSlot = checkInvSlotsYou theIt w
t = case freeSlot of
Just i -> translate (pushout - halfWidth w) (halfHeight w - 20* (fromIntegral i +1))
Nothing -> translate (0.25*_windowX w) (0.25*_windowY w)