Refactor code for initial mouse click in game
This commit is contained in:
+10
-6
@@ -294,9 +294,13 @@ runTerminalString s tm w =
|
||||
)
|
||||
|
||||
doTerminalEffectLB :: Terminal -> World -> World
|
||||
doTerminalEffectLB tm w = fromMaybe w $ do
|
||||
guard (_tmStatus tm == TerminalReady)
|
||||
s <- w ^? cWorld . lWorld . terminals . ix (_tmID tm) . tmInput . tiText
|
||||
return $ if null (words s) && null (_tmPartialCommand tm)
|
||||
then w
|
||||
else terminalReturnEffect tm w
|
||||
doTerminalEffectLB tm w = case w ^. input . mouseContext of
|
||||
OverTerminalReturn -> fromMaybe w $ do
|
||||
guard (_tmStatus tm == TerminalReady)
|
||||
s <- w ^? cWorld . lWorld . terminals . ix (_tmID tm) . tmInput . tiText
|
||||
return $ if null (words s) && null (_tmPartialCommand tm)
|
||||
then w
|
||||
else terminalReturnEffect tm w
|
||||
OverTerminalEscape -> w
|
||||
& hud . hudElement . subInventory .~ NoSubInventory MouseInvNothing
|
||||
_ -> w
|
||||
|
||||
Reference in New Issue
Block a user