Work on terminal text display
This commit is contained in:
@@ -44,7 +44,6 @@ drawFlamelet size pt =
|
|||||||
time = _ebTimer pt
|
time = _ebTimer pt
|
||||||
piu =
|
piu =
|
||||||
translate3 sp
|
translate3 sp
|
||||||
-- setDepth (z + 5)
|
|
||||||
-- . uncurryV translate sp
|
-- . uncurryV translate sp
|
||||||
. color
|
. color
|
||||||
( mixColors
|
( mixColors
|
||||||
@@ -61,8 +60,6 @@ drawFlamelet size pt =
|
|||||||
$ reverse (rectNSWE siz2 (- siz2) (- siz2) siz2)
|
$ reverse (rectNSWE siz2 (- siz2) (- siz2) siz2)
|
||||||
pi2 =
|
pi2 =
|
||||||
translate3 sp
|
translate3 sp
|
||||||
--setDepth (z + 5)
|
|
||||||
-- . uncurryV translate sp
|
|
||||||
. color
|
. color
|
||||||
( mixColors
|
( mixColors
|
||||||
(fromIntegral (max 0 (time -2)))
|
(fromIntegral (max 0 (time -2)))
|
||||||
@@ -79,8 +76,6 @@ drawFlamelet size pt =
|
|||||||
$ rectNSWE siz2 (- siz2) (- siz2) siz2
|
$ rectNSWE siz2 (- siz2) (- siz2) siz2
|
||||||
pic =
|
pic =
|
||||||
translate3 sp
|
translate3 sp
|
||||||
--setDepth (z + 2)
|
|
||||||
-- . uncurryV translate sp
|
|
||||||
. color
|
. color
|
||||||
( mixColors
|
( mixColors
|
||||||
(fromIntegral (max 0 (time -2)))
|
(fromIntegral (max 0 (time -2)))
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ import Dodge.Data.World
|
|||||||
import Linear
|
import Linear
|
||||||
import SDL (MouseButton (..))
|
import SDL (MouseButton (..))
|
||||||
|
|
||||||
defaultListDisplayParams :: ListDisplayParams
|
defaultLDP :: ListDisplayParams
|
||||||
defaultListDisplayParams =
|
defaultLDP =
|
||||||
ListDisplayParams
|
ListDisplayParams
|
||||||
{ _ldpVerticalGap = 0
|
{ _ldpVerticalGap = 0
|
||||||
, _ldpScale = 1
|
, _ldpScale = 1
|
||||||
@@ -30,7 +30,8 @@ defaultListDisplayParams =
|
|||||||
}
|
}
|
||||||
|
|
||||||
invDP :: ListDisplayParams
|
invDP :: ListDisplayParams
|
||||||
invDP = defaultListDisplayParams & ldpPos . spPixelOff .~ V2 6 0
|
--invDP = defaultLDP & ldpPos . spPixelOff .~ V2 6 0
|
||||||
|
invDP = defaultLDP & ldpPos . spPixelOff .~ V2 16 (-20)
|
||||||
|
|
||||||
invCursorParams :: World -> CursorDisplay
|
invCursorParams :: World -> CursorDisplay
|
||||||
invCursorParams w = BoundaryCursor $ case w ^? hud . subInventory of
|
invCursorParams w = BoundaryCursor $ case w ^? hud . subInventory of
|
||||||
@@ -40,10 +41,7 @@ invCursorParams w = BoundaryCursor $ case w ^? hud . subInventory of
|
|||||||
_ -> [North, South, West]
|
_ -> [North, South, West]
|
||||||
|
|
||||||
secondColumnLDP :: ListDisplayParams
|
secondColumnLDP :: ListDisplayParams
|
||||||
--secondColumnLDP = defaultListDisplayParams & ldpPos . spPixelOff .~ V2 subInvX (-20)
|
secondColumnLDP = defaultLDP & ldpPos . spPixelOff .~ V2 subInvX (-20)
|
||||||
secondColumnLDP = defaultListDisplayParams
|
|
||||||
& ldpPos . spPixelOff .~ V2 subInvX (-16)
|
|
||||||
& ldpBorder ?~ (49, 16)
|
|
||||||
|
|
||||||
subInvX :: Float
|
subInvX :: Float
|
||||||
subInvX = 10 * fromIntegral topInvW + 170
|
subInvX = 10 * fromIntegral topInvW + 170
|
||||||
@@ -52,8 +50,4 @@ topInvW :: Int
|
|||||||
topInvW = 15
|
topInvW = 15
|
||||||
|
|
||||||
menuLDP :: ListDisplayParams
|
menuLDP :: ListDisplayParams
|
||||||
menuLDP =
|
menuLDP = defaultLDP & ldpPos . spPixelOff .~ V2 11 (-70) & ldpScale .~ 2
|
||||||
defaultListDisplayParams
|
|
||||||
& ldpPos . spPixelOff .~ V2 11 (-70)
|
|
||||||
& ldpScale .~ 2
|
|
||||||
& ldpVerticalGap .~ 0
|
|
||||||
|
|||||||
@@ -358,7 +358,8 @@ combineInventoryExtra sss msel cfig w = fold $ do
|
|||||||
(Just (0, i))
|
(Just (0, i))
|
||||||
|
|
||||||
drawTerminalDisplay :: LWorld -> Config -> Terminal -> Picture
|
drawTerminalDisplay :: LWorld -> Config -> Terminal -> Picture
|
||||||
drawTerminalDisplay lw cfig tm = drawSelectionList secondColumnLDP cfig f
|
drawTerminalDisplay lw cfig tm
|
||||||
|
= drawSelectionList (secondColumnLDP & ldpBorder ?~ (49, 16)) cfig f
|
||||||
where
|
where
|
||||||
-- <> invHead cfig ("TERMINAL-" ++ show tid)
|
-- <> invHead cfig ("TERMINAL-" ++ show tid)
|
||||||
-- <> color
|
-- <> color
|
||||||
|
|||||||
+15
-10
@@ -36,14 +36,18 @@ import Picture
|
|||||||
drawSelectionList :: ListDisplayParams -> Config -> [SelectionItem a] -> Picture
|
drawSelectionList :: ListDisplayParams -> Config -> [SelectionItem a] -> Picture
|
||||||
drawSelectionList ldps cfig sl =
|
drawSelectionList ldps cfig sl =
|
||||||
translateScreenPos cfig (ldps ^. ldpPos) $
|
translateScreenPos cfig (ldps ^. ldpPos) $
|
||||||
drawListYgapScaleYoff
|
drawListYgapScaleYoff ygap sf 0 (makeSelectionListPictures sl)
|
||||||
(ldps ^. ldpVerticalGap)
|
<> foldMap (g . f) (ldps ^. ldpBorder)
|
||||||
(ldps ^. ldpScale)
|
|
||||||
0
|
|
||||||
(makeSelectionListPictures sl)
|
|
||||||
<> foldMap (color white . polygonWire . f) (ldps ^. ldpBorder)
|
|
||||||
where
|
where
|
||||||
f (x,y) = rectNSWE 5 (negate $ 20 * fromIntegral y + 5) (-5) (10 * fromIntegral x)
|
g xs = color white (polygonWire xs) <> setDepth 0.5 (polygon xs)
|
||||||
|
ygap = ldps ^. ldpVerticalGap
|
||||||
|
sf = ldps ^. ldpScale
|
||||||
|
f (x, y) =
|
||||||
|
rectNSWE
|
||||||
|
5
|
||||||
|
(negate $ (20 * sf + ygap) * fromIntegral y + 5)
|
||||||
|
(-5)
|
||||||
|
(10 * sf * fromIntegral x)
|
||||||
|
|
||||||
drawTitleBackground :: Config -> Picture
|
drawTitleBackground :: Config -> Picture
|
||||||
drawTitleBackground cfig =
|
drawTitleBackground cfig =
|
||||||
@@ -193,7 +197,8 @@ drawListElement ygap s xint yint =
|
|||||||
. scale (s * 0.1) (s * 0.1)
|
. scale (s * 0.1) (s * 0.1)
|
||||||
|
|
||||||
renderListAt :: Float -> Float -> [(String, Color)] -> Picture
|
renderListAt :: Float -> Float -> [(String, Color)] -> Picture
|
||||||
renderListAt tx ty = translate tx (- ty)
|
renderListAt tx ty =
|
||||||
|
translate tx (-ty)
|
||||||
. drawList
|
. drawList
|
||||||
. map (\(str, col) -> color col $ text str)
|
. map (\(str, col) -> color col $ text str)
|
||||||
|
|
||||||
@@ -213,8 +218,8 @@ drawList :: [Picture] -> Picture
|
|||||||
drawList = drawListYgapScaleYoff 0 1 0
|
drawList = drawListYgapScaleYoff 0 1 0
|
||||||
|
|
||||||
drawLabelledList :: [(String, [String])] -> Picture
|
drawLabelledList :: [(String, [String])] -> Picture
|
||||||
drawLabelledList ((s,ss):xs)
|
drawLabelledList ((s, ss) : xs) =
|
||||||
= translate (-10) 0 (drawListYgapScaleYoff 0 1 0 [ textJustifyRight s])
|
translate (-10) 0 (drawListYgapScaleYoff 0 1 0 [textJustifyRight s])
|
||||||
<> drawListYgapScaleYoff 0 1 0 (text <$> ss)
|
<> drawListYgapScaleYoff 0 1 0 (text <$> ss)
|
||||||
<> translate 0 (negate $ fromIntegral (max 1 $ length ss) * 20) (drawLabelledList xs)
|
<> translate 0 (negate $ fromIntegral (max 1 $ length ss) * 20) (drawLabelledList xs)
|
||||||
drawLabelledList [] = mempty
|
drawLabelledList [] = mempty
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ drawMouseCursor :: Universe -> Picture
|
|||||||
drawMouseCursor u =
|
drawMouseCursor u =
|
||||||
uncurryV translate (u ^. uvWorld . input . mousePos)
|
uncurryV translate (u ^. uvWorld . input . mousePos)
|
||||||
. color white
|
. color white
|
||||||
. setDepth 1
|
. setDepth (-1)
|
||||||
$ mouseCursorType u
|
$ mouseCursorType u
|
||||||
|
|
||||||
mouseCursorType :: Universe -> Picture
|
mouseCursorType :: Universe -> Picture
|
||||||
|
|||||||
Reference in New Issue
Block a user