Remove cursor type from ListDisplayParams

This commit is contained in:
2024-10-25 17:41:37 +01:00
parent bd505b072a
commit 6424899afd
7 changed files with 252 additions and 208 deletions
+12 -5
View File
@@ -58,7 +58,8 @@ drawHP cfig =
drawInventory :: SelectionSections () -> World -> Configuration -> Picture
drawInventory sss w cfig =
drawSelectionSections sss (w ^? hud . hudElement . diSelection . _Just) ldp cfig
drawSelectionSections sss ldp cfig
<> drawSSCursor sss (w ^? hud . hudElement . diSelection . _Just) ldp curs cfig
<> iextra
<> translateScreenPos
cfig
@@ -68,6 +69,7 @@ drawInventory sss w cfig =
<> drawDISelections' w cfig
where
ldp = invDisplayParams w
curs = invCursorParams w
iextra = fromMaybe mempty $ do
inv <- w ^? cWorld . lWorld . creatures . ix 0 . crInv
let x = case invAdj inv of
@@ -80,7 +82,9 @@ drawDIMouseOver w = fromMaybe mempty $ do
(_, i) <- w ^? hud . hudElement . subInventory . nsMouseOver . _Just
sss <- w ^? hud . hudElement . diSections
let idp = invDisplayParams w
return . color (withAlpha 0.5 white) $ selSecDrawCursorAt (0, i) 10 idp sss
return . color (withAlpha 0.5 white) $ selSecDrawCursorAt (0, i) 10 idp curs sss
where
curs = CursorDisplay [North,South]
getMouseInvSel :: World -> Maybe ((Int, Int), (Int, Int))
getMouseInvSel w = case w ^? hud . hudElement . subInventory . nsSelected of
@@ -122,9 +126,11 @@ drawSubInventory subinv cfig w = case subinv of
drawCombineInventory :: Configuration -> SelectionSections CombinableItem -> World -> Picture
drawCombineInventory cfig sss w =
invHead cfig "COMBINE"
<> drawSelectionSections sss msel secondColumnParams cfig
<> drawSelectionSections sss secondColumnParams cfig
<> drawSSCursor sss msel secondColumnParams curs cfig
<> combineInventoryExtra sss msel cfig w
where
curs = CursorDisplay [North,South,West]
msel = w ^? hud . hudElement . subInventory . ciSelection . _Just
drawExamineInventory :: Configuration -> World -> Picture
@@ -273,10 +279,11 @@ combineInventoryExtra sss msel cfig w = fromMaybe mempty $ do
where
invcursor i = do
sss' <- w ^? hud . hudElement . diSections
let idp = invDisplayParams w & ldpCursorSides .~ [North, South, East, West]
let idp = invDisplayParams w
return $
translateScreenPos cfig (idp ^. ldpPos) $
selSecDrawCursor 17 idp sss' (Just (0, i))
selSecDrawCursor 17 idp (CursorDisplay [North, South, East, West])
sss' (Just (0, i))
displayTerminal :: Int -> Configuration -> LWorld -> Picture
displayTerminal tid cfig w = fromMaybe mempty $ do