Remove possiblity of displayed but non-focussed terminal
This commit is contained in:
@@ -288,7 +288,7 @@ terminalReturnEffect tm w = fromMaybe w $ do
|
||||
runTerminalString :: String -> Terminal -> World -> World
|
||||
runTerminalString s tm w =
|
||||
w & cWorld . lWorld . terminals . ix (_tmID tm)
|
||||
%~ ( (tmInput .~ TerminalInput{_tiText = mempty, _tiFocus = True, _tiSel = (0, 0)})
|
||||
%~ ( (tmInput .~ TerminalInput{_tiText = mempty, _tiSel = (0, 0)})
|
||||
. (tmFutureLines ++.~ commandFutureLines s tm w)
|
||||
. (tmCommandHistory %~ take 10 . (s :))
|
||||
)
|
||||
@@ -297,11 +297,6 @@ doTerminalEffectLB :: Terminal -> World -> World
|
||||
doTerminalEffectLB tm w = fromMaybe w $ do
|
||||
guard (_tmStatus tm == TerminalReady)
|
||||
s <- w ^? cWorld . lWorld . terminals . ix (_tmID tm) . tmInput . tiText
|
||||
if null (words s) && null (_tmPartialCommand tm)
|
||||
then Just $ defocusTerminalInput w
|
||||
else return $ terminalReturnEffect tm w
|
||||
|
||||
defocusTerminalInput :: World -> World
|
||||
defocusTerminalInput w = fromMaybe w $ do
|
||||
tmid <- w ^? hud . hudElement . subInventory . termID
|
||||
return $ w & cWorld . lWorld . terminals . ix tmid . tmInput . tiFocus %~ const False
|
||||
return $ if null (words s) && null (_tmPartialCommand tm)
|
||||
then w
|
||||
else terminalReturnEffect tm w
|
||||
|
||||
Reference in New Issue
Block a user