Fix terminal distance bug
This commit is contained in:
@@ -150,8 +150,9 @@ updateTerminal = checkTermDist
|
||||
|
||||
checkTermDist :: World -> World
|
||||
checkTermDist w = case w ^? hud . hudElement . subInventory . termID of
|
||||
Just btid -> fromMaybe (w & hud . hudElement .~ DisplayInventory NoSubInventory) $ do
|
||||
btpos <- w ^? buttons . ix btid . btPos
|
||||
Just tmid -> fromMaybe (w & hud . hudElement .~ DisplayInventory NoSubInventory) $ do
|
||||
btid <- w ^? terminals . ix tmid . tmButtonID
|
||||
btpos <- w ^? buttons . ix btid . btPos
|
||||
if dist btpos (_crPos $ you w) < 40 then Just w else Nothing
|
||||
Nothing -> w
|
||||
|
||||
|
||||
@@ -228,7 +228,7 @@ basicTerminal = defaultTerminal
|
||||
,_tmInput = defaultTerminalInput
|
||||
,_tmScrollCommands = [quitCommand]
|
||||
,_tmWriteCommands = [helpCommand,commandsCommand]
|
||||
,_tmProgram = \_ _ -> connectionBlurb1
|
||||
,_tmProgram = \_ _ -> connectionBlurb
|
||||
, _tmDeathEffect = doDeathTriggers
|
||||
}
|
||||
|
||||
@@ -240,11 +240,10 @@ doDeathTriggers tm w = w
|
||||
doDeathToggle :: TerminalToggle -> IM.IntMap (World -> Bool) -> IM.IntMap (World -> Bool)
|
||||
doDeathToggle (TerminalToggle trid f) = ix trid %~ f
|
||||
|
||||
connectionBlurb1 :: [TerminalLine]
|
||||
connectionBlurb1 =
|
||||
connectionBlurb :: [TerminalLine]
|
||||
connectionBlurb =
|
||||
[termSoundLine computerBeepingS
|
||||
,TerminalLineDisplay 0 (const ("CONNECTING",termTextColor))
|
||||
,TerminalLineDisplay 10 (const ("...",termTextColor))
|
||||
,TerminalLineDisplay 10 (const ("CONNECTED",termTextColor))
|
||||
] ++ map (TerminalLineDisplay 10 . const . (,white) . show) [(1::Int)..50] ++
|
||||
[TerminalLineTerminalEffect 0 (tmStatus .~ TerminalReady)]
|
||||
,TerminalLineTerminalEffect 0 (tmStatus .~ TerminalReady)]
|
||||
|
||||
Reference in New Issue
Block a user