module Dodge.InputFocus where
import Dodge.Data
import LensHelp

import Data.Maybe

inTermFocus :: World -> Bool
inTermFocus w = fromMaybe False $ do
    tmid <- w ^? hud . hudElement . subInventory . termID
    hasfocus <- w ^? terminals . ix tmid . tmInput . tiFocus
    connectionstatus <- w ^? terminals . ix tmid . tmStatus
    return $ hasfocus && connectionstatus == TerminalReady
