Tweak mouse pointer display

This commit is contained in:
2024-11-04 09:32:36 +00:00
parent 1ed09fa8de
commit df08dc8ab5
7 changed files with 154 additions and 131 deletions
+12 -13
View File
@@ -99,25 +99,24 @@ updateCombineInvClick ::
updateCombineInvClick msel sss w = fromMaybe trydocombination $ do
(i,j) <- w ^? hud . hudElement . diMouseOver . _Just
guard $ i == 0
str <- fmap (take 5) $ w ^? hud . hudElement . diSections . ix i . ssItems . ix j . siPictures . ix 0
return . (worldEventFlags . at CombineInventoryChange ?~ ()) $ case w ^? hud . hudElement . subInventory . ciFilter . _Just of
Just (_:xs) | str == xs -> w
& hud . hudElement . subInventory . ciFilter .~ Nothing
_ -> w & hud . hudElement . subInventory . ciFilter ?~ ("<" ++ str)
str <- fmap (take 5) $ w
^? hud . hudElement . diSections . ix i . ssItems . ix j . siPictures . ix 0
return . (worldEventFlags . at CombineInventoryChange ?~ ())
$ case w ^? hud . hudElement . subInventory . ciFilter . _Just of
Just (_:xs) | str == xs -> w
& hud . hudElement . subInventory . ciFilter .~ Nothing
_ -> w & hud . hudElement . subInventory . ciFilter ?~ ("<" ++ str)
where
trydocombination = case w ^? hud . hudElement . subInventory . ciMouseOver . _Just of
x@Just{} | x /= msel -> w & hud . hudElement . subInventory . ciSelection .~ x
x@(Just (i,_))
| x /= msel -> w & hud . hudElement . subInventory . ciSelection .~ x
& worldEventFlags . at CombineInventoryChange ?~ ()
_ ->
(worldEventFlags . at InventoryChange ?~ ()) . maybeExitCombine $
| i == -1 -> w & hud . hudElement . subInventory . ciFilter .~ Nothing
& worldEventFlags . at CombineInventoryChange ?~ ()
_ -> (worldEventFlags . at InventoryChange ?~ ()) . maybeExitCombine $
tryCombine sss msel w
& worldEventFlags . at CombineInventoryChange ?~ ()
--checkCombineSelectionExists :: SubInventory -> SubInventory
--checkCombineSelectionExists x@CombineInventory{_ciSections=sss,_ciSelection=msel}
-- = x & ciSelection %~ ssSetCursor (ssTryLookup msel) sss
--checkCombineSelectionExists x = x
updatePressedButtonsCarte :: World -> World
updatePressedButtonsCarte w = updatePressedButtonsCarte' (_mouseButtons (_input w)) w