Cleanup
This commit is contained in:
+7
-15
@@ -6,27 +6,19 @@ import Dodge.Data.World
|
||||
import LensHelp
|
||||
|
||||
inTextInputFocus :: World -> Bool
|
||||
inTextInputFocus = isJust . inputFocusI
|
||||
inTextInputFocus = isJust . textInputFocus
|
||||
|
||||
inputFocusI :: World -> Maybe ((String -> Identity String) -> World -> Identity World)
|
||||
inputFocusI = textInputFocus
|
||||
|
||||
textInputFocus ::
|
||||
Applicative f =>
|
||||
World ->
|
||||
Maybe ((String -> f String) -> World -> f World)
|
||||
textInputFocus w = case w ^? hud . subInventory of
|
||||
Just NoSubInventory{} -> case he ^? diSelection . _Just . slSec of
|
||||
textInputFocus :: World -> Maybe ((String -> Identity String) -> World -> Identity World)
|
||||
textInputFocus w = case w ^. hud . subInventory of
|
||||
NoSubInventory{} -> case he ^? diSelection . _Just . slSec of
|
||||
Just (-1) -> Just $ hud . diInvFilter . _Just
|
||||
Just 2 -> Just $ hud . diCloseFilter . _Just
|
||||
_ -> Nothing
|
||||
Just CombineInventory{} -> case he ^? subInventory . ciSelection . _Just . slSec of
|
||||
CombineInventory{} -> case he ^? subInventory . ciSelection . _Just . slSec of
|
||||
Just (-1) -> Just $ hud . subInventory . ciFilter . _Just
|
||||
_ -> Nothing
|
||||
Just DisplayTerminal{_termID = tmid} -> do
|
||||
-- connectionstatus <- w ^? cWorld . lWorld . terminals . ix tmid . tmStatus
|
||||
-- guard $ connectionstatus == TerminalTextInput
|
||||
return $ cWorld . lWorld . terminals . ix tmid . tmStatus . tiText
|
||||
DisplayTerminal{_termID = tmid} -> return
|
||||
$ cWorld . lWorld . terminals . ix tmid . tmStatus . tiText
|
||||
_ -> Nothing
|
||||
where
|
||||
he = w ^. hud
|
||||
|
||||
Reference in New Issue
Block a user