Start work simplifying terminals, aim towards respawn terminals
This commit is contained in:
+4
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user