Tweak terminal screen drawing
This commit is contained in:
@@ -48,7 +48,7 @@ secondColumnLDP = defaultLDP & ldpPos . spPixelOff .~ V2 subInvX (-20)
|
||||
terminalLDP :: LDParams
|
||||
terminalLDP = secondColumnLDP & ldpSize ?~ V2 50 16
|
||||
& ldpPos . spScreenOff .~ V2 0.5 0.5
|
||||
& ldpPos . spPixelOff .~ V2 (-250) (-40)
|
||||
& ldpPos . spPixelOff .~ V2 (-250) 200
|
||||
|
||||
subInvX :: Float
|
||||
subInvX = 10 * fromIntegral topInvW + 170
|
||||
|
||||
+11
-4
@@ -372,10 +372,16 @@ drawTerminalDisplay w cfig tid = fold $ do
|
||||
TerminalLineRead -> (++ [(spincurs, termTextColor)])
|
||||
TerminalTextInput s -> (++ [(getPromptTM ++ s ++ [cFilledRect], white)])
|
||||
TerminalPressTo s -> (++ [(s, white)])
|
||||
return $
|
||||
return . (each . vxPos . _z -~ 0.05) $
|
||||
drawTerminalCursorLink w cfig tm
|
||||
<> (
|
||||
drawSelectionList (w ^. tmLDP) cfig f
|
||||
<> drawTerminalCursorLink w cfig tm
|
||||
<> (hackInvertText black white ("TERMINAL-" ++ show tid)
|
||||
& each . vxPos *~ 0.1
|
||||
& each . vxPos . _xy +~ rp)
|
||||
& each . vxPos . _z -~ 0.05)
|
||||
where
|
||||
rp = screenPosAbs cfig (w ^. tmLDP . ldpPos)
|
||||
-- <> invHead cfig ("TERMINAL-" ++ show tid)
|
||||
-- <> color
|
||||
-- (withAlpha 0.5 green) -- consider integrating termScreenColor somehow
|
||||
@@ -391,7 +397,7 @@ drawTerminalCursorLink :: World -> Config -> Terminal -> Picture
|
||||
drawTerminalCursorLink w cfig tm = fold $ do
|
||||
j <- elemIndex (tm ^. tmButtonID) $ w ^. hud . closeButtons
|
||||
lp <- selNumPos cfig invDP (w ^. hud . diSections) 5 j
|
||||
let rp = screenPosAbs cfig (secondColumnLDP ^. ldpPos) - V2 5 10
|
||||
let rp = screenPosAbs cfig (w ^. tmLDP . ldpPos)
|
||||
lcol <- selSecSelCol 5 j (w ^. hud . diSections)
|
||||
return $
|
||||
translateScreenPos
|
||||
@@ -403,7 +409,8 @@ drawTerminalCursorLink w cfig tm = fold $ do
|
||||
(w ^. hud . diSections)
|
||||
(Sel 5 j mempty)
|
||||
)
|
||||
<> lConnectCol (lp + V2 155 0) rp lcol white white
|
||||
<>
|
||||
lConnectCol (lp + V2 155 0) rp lcol white white
|
||||
|
||||
lnkMidPosInvSelsCol :: Config -> World -> Int -> Color -> [Int] -> Picture
|
||||
lnkMidPosInvSelsCol cfig w i col = fromMaybe mempty . foldMap f
|
||||
|
||||
@@ -40,7 +40,7 @@ drawSelectionList ldps cfig sl =
|
||||
(drawListYgapScaleYoff ygap sf 0 (makeSelectionListPictures sl))
|
||||
<> foldMap (g . f) (ldpRect cfig ldps)
|
||||
where
|
||||
g xs = color white (polygonWire xs) <> setDepth 0.5 (polygon xs)
|
||||
g xs = color white (polygonWire xs) <> setDepth 0.05 (polygon xs)
|
||||
ygap = ldps ^. ldpVerticalGap
|
||||
sf = ldps ^. ldpScale
|
||||
f (V2 xmin ymax, V2 xmax ymin) = rectNSWE ymax ymin xmin xmax
|
||||
|
||||
@@ -136,7 +136,7 @@ setPixelOffsetBounded cfig (V2 x y) ldp = ldp & ldpPos . spPixelOff .~ V2 x' y'
|
||||
w = fromIntegral $ cfig ^. windowX
|
||||
x' = min (w - (w*a + 1+10*ldp ^?! ldpSize . _Just . _x . to fromIntegral))
|
||||
$ max (1 - w * a) x
|
||||
y' = min (h-(h*b + 40))
|
||||
y' = min (h-(h*b + 20))
|
||||
$ max (1+20*(ldp^.ldpVerticalGap + ldp^?!ldpSize._Just._y.to fromIntegral)-h*b) y
|
||||
V2 a b = ldp ^. ldpPos . spScreenOff
|
||||
|
||||
|
||||
Reference in New Issue
Block a user