Prevent selection of unselectable items when scrolling

This commit is contained in:
2023-02-20 11:19:25 +00:00
parent ab69de73c7
commit 2e46123a92
6 changed files with 58 additions and 81 deletions
+2 -2
View File
@@ -57,7 +57,7 @@ updateUseInputInGame h u = case h of
u & uvWorld . cWorld . lWorld . terminals . ix tmid . tmInput . tiFocus %~ const True
CombineInventory _ _ sss
| inSubInvRegex (u ^. uvWorld) -> doSubInvRegexInput u
| lbinitialpress -> maybeExitCombine $ over uvWorld (tryCombine sss) u -- maybeexitcombine (maybe id doCombine mi w)
| lbinitialpress -> maybeExitCombine $ over uvWorld (tryCombine sss) u
_ | inInvRegex (u ^. uvWorld) -> doRegexInput (-1) invRegex invRegex u
_ | inCloseRegex (u ^. uvWorld) -> doRegexInput 2 closeRegex closeRegex u
_ -> M.foldlWithKey' updateKeyInGame u pkeys
@@ -76,7 +76,7 @@ tryCombine sss w = fromMaybe w $ do
maybeExitCombine :: Universe -> Universe
maybeExitCombine u
| ButtonRight `M.member` (u ^. uvWorld . input . mouseButtons)
= u
= u & uvWorld %~ enterCombineInv (u ^. uvConfig)
| otherwise = u & uvWorld . hud . hudElement . subInventory .~ NoSubInventory
doTextInputOver :: ASetter' Universe String -> Universe -> Universe