Implement filter on nearby objects
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
module Dodge.InputFocus
|
||||
( inTermFocus
|
||||
, inInvRegex
|
||||
, inCloseRegex
|
||||
, inSubInvRegex
|
||||
, inputFocus
|
||||
) where
|
||||
@@ -23,6 +24,12 @@ inInvRegex w = fromMaybe False $ do
|
||||
i <- sss ^? sssSelPos . _Just
|
||||
return $ i == (-1)
|
||||
|
||||
inCloseRegex :: World -> Bool
|
||||
inCloseRegex w = fromMaybe False $ do
|
||||
sss <- w ^? hud . hudElement . diSections
|
||||
i <- sss ^? sssSelPos . _Just
|
||||
return $ i == 2
|
||||
|
||||
inSubInvRegex :: World -> Bool
|
||||
inSubInvRegex w = fromMaybe False $ do
|
||||
sm <- w ^? hud . hudElement . subInventory . subInvMap
|
||||
@@ -33,4 +40,4 @@ inSubInvRegex w = fromMaybe False $ do
|
||||
_ -> return False
|
||||
|
||||
inputFocus :: World -> Bool
|
||||
inputFocus w = inTermFocus w || inSubInvRegex w || inInvRegex w
|
||||
inputFocus w = inTermFocus w || inSubInvRegex w || inInvRegex w || inCloseRegex w
|
||||
|
||||
Reference in New Issue
Block a user