Improve drag inventory selection

This commit is contained in:
2026-04-06 19:01:57 +01:00
parent 608de9f2ed
commit 35d169b585
4 changed files with 32 additions and 11 deletions
+8 -2
View File
@@ -106,10 +106,16 @@ updateMouseHeldInGame cfig w = case w ^. input . mouseContext of
let sss = w ^. hud . diSections
in case inverseSelNumPos cfig invDP (w ^. input . mousePos) sss of
Nothing -> w & input . mouseContext . mcoSelEnd .~ Nothing
Just (i, j)
Just (NonInf (i, j))
| i == fst sstart -> w & input . mouseContext . mcoSelEnd ?~ j
| i < fst sstart -> w & input . mouseContext . mcoSelEnd ?~ 0
| otherwise ->
| otherwise -> w
& input . mouseContext . mcoSelEnd
.~ fmap
fst
(IM.lookupMax =<< sss ^? ix (fst sstart) . ssItems)
Just NegInf -> w & input . mouseContext . mcoSelEnd ?~ 0
Just PosInf ->
w & input . mouseContext . mcoSelEnd
.~ fmap
fst