This commit is contained in:
2024-11-26 22:55:55 +00:00
parent 2b969f6530
commit f64dc86a30
5 changed files with 29 additions and 52 deletions
+3 -6
View File
@@ -87,13 +87,11 @@ updateMouseHeldInGame :: Configuration -> World -> World
updateMouseHeldInGame cfig w = case w ^. input . mouseContext of
OverInvDragSelect sstart _ -> fromMaybe w $ do
sss <- w ^? hud . hudElement . diSections
let msel = inverseSelNumPos cfig ldp sss (w ^. input . mousePos)
let msel = inverseSelNumPos cfig invDP sss (w ^. input . mousePos)
guard $ Just (fst sstart) == fmap fst msel || isNothing msel
return $ w & input . mouseContext . mcoSelEnd .~ fmap snd msel
OverInvDrag k mmouseover ab bn -> doDrag 30 k mmouseover ab bn w
_ -> w
where
ldp = invDisplayParams w
doDrag :: Int
@@ -177,7 +175,7 @@ updateMouseClickInGame :: Configuration -> World -> World
updateMouseClickInGame cfig w = case w ^. input . mouseContext of
MouseInGame -> fromMaybe w $ do
sss <- w ^? hud . hudElement . diSections
ysel <- inverseSelSecYint (posSelSecYint cfig ldp (mpos ^. _y)) sss
ysel <- inverseSelSecYint (posSelSecYint cfig invDP (mpos ^. _y)) sss
guard (isGroupSelectableSection $ fst ysel)
return $
w & input . mouseContext
@@ -228,7 +226,6 @@ updateMouseClickInGame cfig w = case w ^. input . mouseContext of
_ -> w & hud . hudElement . subInventory . ciFilter ?~ ("<" ++ str)
_ -> w
where
ldp = invDisplayParams w
mpos = w ^. input . mousePos
f (x,y) = (x,y,mempty)
selsec = w ^? hud . hudElement . diSelection . _Just . _1
@@ -269,7 +266,7 @@ startDrag (a, b) cfig w = setcontext
bneath = do
sss <- w ^? hud . hudElement . diSections
inverseSelSecYint (yint + 1) sss
yint = posSelSecYint cfig (invDisplayParams w) (w ^. input . mousePos . _y)
yint = posSelSecYint cfig invDP (w ^. input . mousePos . _y)
concurrentIS :: IS.IntSet -> Bool
concurrentIS = go . IS.minView