Centralise mouse context data

This commit is contained in:
2024-11-10 18:26:30 +00:00
parent f35dfc66bd
commit 713d3e3265
10 changed files with 123 additions and 125 deletions
+4 -4
View File
@@ -82,10 +82,10 @@ mouseCursorType u
| isselect = drawPlus 5
| Just tmid <- u ^? uvWorld . hud . hudElement . subInventory . termID = determineTermCursor tmid u
| Just csel <- u ^? uvWorld . hud . hudElement . subInventory . ciSelection =
if ( csel == u ^? uvWorld . hud . hudElement . subInventory . ciMouseOver . _Just
|| null (u ^? uvWorld . hud . hudElement . subInventory . ciMouseOver . _Just)
if ( csel == u ^? uvWorld . input . mouseContext . mcoCombInv
|| null (u ^? uvWorld . input . mouseContext . mcoCombInv)
)
&& null (u ^? uvWorld . hud . hudElement . diMouseOver . _Just)
&& null (u ^? uvWorld . input . mouseContext . mcoInv)
&& fmap fst csel /= Just (-1)
&& fromMaybe True (u ^? uvWorld . hud . hudElement . subInventory . ciSections . ix 0 . ssItems . ix 0 . siIsSelectable) --HACK to check there is something creatable
then drawGapPlus 5
@@ -94,7 +94,7 @@ mouseCursorType u
where
isselect =
not (null $ u ^. uvScreenLayers)
|| not (null $ u ^? uvWorld . hud . hudElement . diMouseOver . _Just)
|| not (null $ u ^? uvWorld . input . mouseContext . mcoInv)
w = u ^. uvWorld
a = fromMaybe 0 $ do
cpos <- w ^? cWorld . lWorld . creatures . ix 0 . crPos