Start unifying drawn cursors

This commit is contained in:
2022-11-03 10:00:41 +00:00
parent 0872a2dd40
commit e6e5427f44
9 changed files with 129 additions and 44 deletions
+5 -3
View File
@@ -3,6 +3,7 @@ module Dodge.Render.HUD (
hudDrawings,
) where
import Dodge.Data.CardinalPoint
import Dodge.Data.SelectionList
import Control.Lens
import qualified Data.Map.Strict as M
@@ -26,6 +27,7 @@ import ListHelp
import Padding
import Picture
import SDL (MouseButton (..))
import qualified Data.Set as Set
hudDrawings :: Universe -> Picture
hudDrawings uv = case w ^. cWorld . lWorld . hud . hudElement of
@@ -96,13 +98,13 @@ inventoryDisplay :: SubInventory -> Configuration -> World -> Picture
inventoryDisplay subinv cfig w = drawSelectionList cfig $
defaultSelectionList & slItems .~ inventorySelectionList w
& slWidth .~ FixedSelectionWidth topInvW
& slCursorType .~ selcursortype
& slCursorType .~ BorderCursor (Set.fromList selcursortype)
& slSelPos .~ inventoryCursorPos subinv w
& slWidth .~ FixedSelectionWidth (determineInvSelCursorWidth w)
where
selcursortype
| ButtonRight `M.member` _mouseButtons (_input w) = NSEWCursor
| otherwise = NSWCursor
| ButtonRight `M.member` _mouseButtons (_input w) = [North,South,East,West]
| otherwise = [North,South,West]
subInventoryDisplay :: SubInventory -> Configuration -> World -> Picture
subInventoryDisplay subinv cfig w = case subinv of