Start work simplifying terminals, aim towards respawn terminals

This commit is contained in:
2025-08-14 19:26:52 +01:00
parent 04c60151e1
commit 198b7acc78
6 changed files with 13 additions and 16 deletions
+4 -4
View File
@@ -397,7 +397,7 @@ updateMouseContextGame cfig u = case u ^. uvWorld . input . mouseContext of
tmid <- w ^? hud . hudElement . subInventory . termID
tm <- w ^? cWorld . lWorld . terminals . ix tmid
return $
if isOverTerminalScreen cfig tm mpos
if isOverTerminalScreen cfig mpos
then fromMaybe NoMouseContext $ do
let s = tm ^. tmInput . tiText
guard $ not (null s) && _tmStatus tm == TerminalReady
@@ -415,8 +415,8 @@ getMenuMouseContext screen u = case screen ^. scOptions of
Just True -> MouseMenuClick yi
_ -> NoMouseContext
isOverTerminalScreen :: Configuration -> Terminal -> Point2 -> Bool
isOverTerminalScreen cfig tm (V2 x y) =
isOverTerminalScreen :: Configuration -> Point2 -> Bool
isOverTerminalScreen cfig (V2 x y) =
x <= xmax
&& x >= xmin - 5
&& y <= ymax + 5
@@ -424,7 +424,7 @@ isOverTerminalScreen cfig tm (V2 x y) =
where
ldp = secondColumnParams
V2 xmin ymax = screenPosAbs cfig (ldp ^. ldpPos)
tsize = fromIntegral $ getMaxLinesTM (tm ^. tmType) + 1
tsize = fromIntegral $ getMaxLinesTM + 1
s = 5 + tsize * (20 * ldp ^. ldpScale + ldp ^. ldpVerticalGap)
ymin = ymax - s
xmax = xmin + 555 -- HACK drawSelectionListBackground