Improve drag inventory selection
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user