Allow dropping items by dragging off inventory
This commit is contained in:
+5
-2
@@ -354,14 +354,13 @@ checkTermDist w = fromMaybe w $ do
|
||||
|
||||
updateMouseContext :: Configuration -> Universe -> Universe
|
||||
updateMouseContext cfig u = case u ^. uvWorld . input . mouseContext of
|
||||
OverInvDrag | lbheld -> u
|
||||
OverInvDrag {} -> u & uvWorld . input . mouseContext .~ invdrag
|
||||
OverInvDragSelect{} -> u
|
||||
_ -> u & uvWorld . input . mouseContext
|
||||
.~ fromMaybe
|
||||
aimcontext
|
||||
(overmenu <|> overinv <|> overcomb <|> overterm)
|
||||
where
|
||||
lbheld = ButtonLeft `M.member` (u ^. uvWorld . input . mouseButtons)
|
||||
overmenu = do
|
||||
screen <- u ^? uvScreenLayers . ix 0
|
||||
return $ case screen ^. scOptions of
|
||||
@@ -384,6 +383,10 @@ updateMouseContext cfig u = case u ^. uvWorld . input . mouseContext of
|
||||
| ButtonRight `M.member` (w ^. input . mouseButtons) = MouseAiming
|
||||
| otherwise = MouseInGame
|
||||
mpos = w ^. input . mousePos
|
||||
invdrag = fromMaybe (OverInvDrag Nothing) $ do
|
||||
sss <- w ^? hud . hudElement . diSections
|
||||
(0,j) <- inverseSelNumPos cfig (invDisplayParams w) sss mpos
|
||||
return $ OverInvDrag $ Just j
|
||||
overinv = do
|
||||
sss <- w ^? hud . hudElement . diSections
|
||||
selpos <- inverseSelNumPos cfig (invDisplayParams w) sss mpos
|
||||
|
||||
Reference in New Issue
Block a user