Cleanup inventory management, tweak dragging start
This commit is contained in:
@@ -103,8 +103,6 @@ moveZoomCamera cfig theinput cr w campos =
|
||||
where
|
||||
mremotepos = do
|
||||
Sel 0 i <- w^?hud .diSelection._Just
|
||||
--revise1 i <- cr ^? crManipulation . manObject . imSelectedItem
|
||||
--revise2 i <- w^?hud . manObject . imSelectedItem
|
||||
itid <- cr ^? crInv . ix (NInt i)
|
||||
j <- w ^? cWorld . lWorld . items . ix itid . itUse . uaParams . apProjectiles . ix 0
|
||||
guard $ Just REMOTESCREEN == w ^? cWorld . lWorld . items . ix itid . itType . ibtAttach
|
||||
@@ -113,7 +111,6 @@ moveZoomCamera cfig theinput cr w campos =
|
||||
offset = fromMaybe noscopeoffset $ do
|
||||
guard (SDL.ButtonRight `M.member` _mouseButtons theinput)
|
||||
Sel 0 i <- w^?hud.diSelection._Just
|
||||
--revise2 i <- w^?hud . manObject . imSelectedItem
|
||||
itid <- cr ^? crInv . ix (NInt i)
|
||||
fmap docamrot (w ^? cWorld . lWorld . items . ix itid . itUse . uScope . opticPos)
|
||||
noscopeoffset =
|
||||
@@ -121,19 +118,16 @@ moveZoomCamera cfig theinput cr w campos =
|
||||
((newzoom - newDefaultZoom) / (newDefaultZoom * newzoom)) *.* _mousePos theinput
|
||||
newzoom = fromMaybe (newDefaultZoom * newItemZoom) $ do
|
||||
Sel 0 i <- w^?hud .diSelection._Just
|
||||
--revise2 i <- w^?hud . manObject . imSelectedItem
|
||||
itid <- cr ^? crInv . ix (NInt i)
|
||||
w ^? cWorld . lWorld . items . ix itid . itUse . uScope . opticZoom
|
||||
idealDefaultZoom = clipZoom wallZoom
|
||||
newDefaultZoom = fromMaybe (changeZoom (campos ^. camDefaultZoom) idealDefaultZoom) $ do
|
||||
Sel 0 i <- w^?hud .diSelection._Just
|
||||
--revise2 i <- w^?hud . manObject . imSelectedItem
|
||||
itid <- cr ^? crInv . ix (NInt i)
|
||||
w ^? cWorld . lWorld . items . ix itid . itUse . uScope . opticZoom
|
||||
idealItemZoom = fromMaybe 1 $ do
|
||||
guard $ crIsAiming cr
|
||||
Sel 0 i <- w^?hud .diSelection._Just
|
||||
--revise2 i <- w^?hud . manObject . imSelectedItem
|
||||
itid <- cr ^? crInv . ix (NInt i)
|
||||
getAimZoom <$> (w ^? cWorld . lWorld . items . ix itid)
|
||||
newItemZoom = changeZoom (campos ^. camItemZoom) idealItemZoom
|
||||
|
||||
Reference in New Issue
Block a user