Improve inventory management, item pickup to cursor pos
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user