Continue hud/mouse refactor

This commit is contained in:
2024-11-16 15:06:05 +00:00
parent 0621709f7b
commit 5efc9220e0
6 changed files with 184 additions and 226 deletions
+8 -11
View File
@@ -301,9 +301,9 @@ checkTermDist w = fromMaybe w $ do
w & hud . hudElement . subInventory
.~ NoSubInventory MouseInvNothing
-- for other mouse effects, see yourControl
updateMouseInventoryEffects :: Configuration -> World -> World
updateMouseInventoryEffects cfig w = w
---- for other mouse effects, see yourControl
--updateMouseInventoryEffects :: Configuration -> World -> World
--updateMouseInventoryEffects cfig w = w
updateMouseInventorySelection :: Configuration -> World -> World
updateMouseInventorySelection cfig w = fromMaybe w $ do
@@ -407,14 +407,11 @@ updateMouseContext cfig w =
sss <- w ^? hud . hudElement . subInventory . ciSections
msel <- w ^? hud . hudElement . subInventory . ciSelection . _Just
let mpossel = inverseSelNumPos cfig secondColumnParams sss (w ^. input . mousePos)
case mpossel of
Nothing -> usecsel msel
Just (-1,_) -> return OverCombFilter
Just x | x == msel -> return $ OverCombCombine x
Just x -> return $ OverCombSelect x
-- fmap OverCombCombine $ inverseSelNumPos cfig secondColumnParams sss (w ^. input . mousePos)
usecsel (-1,_) = return OverCombFilter
usecsel x = return $ OverCombCombine x
return $ case mpossel of
Nothing -> OverCombEscape
Just (-1,_) -> OverCombFilter
Just x | x == msel -> OverCombCombine x
Just x -> OverCombSelect x
overterm = do
tmid <- w ^? hud . hudElement . subInventory . termID
guard True