Allow scrolling within a larger selection to not remove larger selection

This commit is contained in:
2024-11-25 17:20:09 +00:00
parent 83bcf3c0f7
commit 669f9667f1
16 changed files with 233 additions and 200 deletions
+8 -6
View File
@@ -54,11 +54,12 @@ drawHUD cfig w = case w ^. hud . hudElement of
drawInventory :: IM.IntMap (SelectionSection ()) -> World -> Configuration -> Picture
drawInventory sss w cfig =
drawSelectionSections sss ldp cfig
<> drawSSCursor sss (w ^? hud . hudElement . diSelection . _Just) ldp curs cfig
<> drawRootCursor w sss (w ^? hud . hudElement . diSelection . _Just) ldp cfig
<> drawSSCursor sss (f $ w ^? hud . hudElement . diSelection . _Just) ldp curs cfig
<> drawRootCursor w sss (f $ w ^? hud . hudElement . diSelection . _Just) ldp cfig
<> iextra
<> drawMouseOver cfig w
where
f = fmap (\(x,y,_) -> (x,y))
ldp = invDisplayParams w
curs = invCursorParams w
iextra = fromMaybe mempty $ do
@@ -129,9 +130,9 @@ drawMouseOver cfig w =
drawDragSelected :: Configuration -> World -> Maybe Picture
drawDragSelected cfig w = do
ys <- w ^? hud . hudElement . diSelectionExtra
ys <- w ^? hud . hudElement . diSelection . _Just . _3
guard $ not (IS.null ys)
(i, _) <- w ^? hud . hudElement . diSelection . _Just
(i, _, _) <- w ^? hud . hudElement . diSelection . _Just
sss <- w ^? hud . hudElement . diSections
let idp = invDisplayParams w
let f x = (selSecDrawCursorAt 15 idp BackdropCursor sss (i, x) <>)
@@ -173,7 +174,8 @@ drawCombineInventory cfig sss w =
<> combineInventoryExtra sss msel cfig w
where
curs = BoundaryCursor [North, South, West]
msel = w ^? hud . hudElement . subInventory . ciSelection . _Just
msel = fmap (\(x,y,_) -> (x,y))
$ w ^? hud . hudElement . subInventory . ciSelection . _Just
drawExamineInventory :: Configuration -> World -> Picture
drawExamineInventory cfig w =
@@ -238,7 +240,7 @@ drawRBOptions cfig w = fromMaybe mempty $ do
i <- w ^? rbOptions . opSel
let ae = getEquipmentAllocation w
sss <- w ^? hud . hudElement . diSections
(i', j) <- w ^? hud . hudElement . diSelection . _Just
(i', j,_) <- w ^? hud . hudElement . diSelection . _Just
curpos <- selSecYint i' j sss
let ytext = drawListElement 0 1 0 curpos . text
midstr = equipAllocString ae