Hack partially working gui line to dropped items
This commit is contained in:
+1
-1
@@ -34,7 +34,7 @@ import qualified Control.Foldl as F
|
||||
--import Data.List
|
||||
--import Data.Bifunctor
|
||||
--import Data.Function
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
--import qualified Data.IntMap.Strict as IM
|
||||
--import qualified Data.Map as M
|
||||
--import qualified Data.Set as S
|
||||
import Graphics.Rendering.OpenGL hiding (color,scale,translate,rotate)
|
||||
|
||||
@@ -214,7 +214,7 @@ closeObjectTexts w = pictures $ zipWith renderList [(0::Int)..] (map colAndText
|
||||
let p' = ( pushout - halfWidth w + 130
|
||||
, halfHeight w - 20* (fromIntegral invPos +1) + 2.5
|
||||
)
|
||||
return $ lineCol
|
||||
return $ flip thickLineCol (1 / halfWidth w)
|
||||
[(itScreenPos, withAlpha 0 col)
|
||||
,(sc p' , col)
|
||||
,(sc p , col)
|
||||
@@ -222,8 +222,8 @@ closeObjectTexts w = pictures $ zipWith renderList [(0::Int)..] (map colAndText
|
||||
{- | Colour picture and add black drop shadow. -}
|
||||
dShadCol :: Color -> Picture -> Picture
|
||||
dShadCol c p = pictures
|
||||
[ color c p
|
||||
, color black $ uncurry translate (1.2,-1.2) p
|
||||
[ color black $ uncurry translate (1.2,-1.2) p
|
||||
, color c p
|
||||
]
|
||||
|
||||
drawListCursor :: Color -> Int -> World -> Picture
|
||||
@@ -264,9 +264,7 @@ cursorAt wth col xoff yoff yint w = winScale w
|
||||
,( wth,12.5)
|
||||
]
|
||||
|
||||
|
||||
displayHP :: Int -> World -> Picture
|
||||
displayHP n w = translate (halfWidth w-80) (halfHeight w-20) $
|
||||
scale 0.2 0.2 $ text $ reverse $ take 5 $ (++ repeat ' ') $ reverse $ show
|
||||
$ _crHP $ _creatures w IM.! n
|
||||
|
||||
|
||||
+2
-1
@@ -12,6 +12,7 @@ module Picture
|
||||
, thickArc
|
||||
, thickCircle
|
||||
, thickLine
|
||||
, thickLineCol
|
||||
, circleSolid
|
||||
, circleSolidCol
|
||||
, circle
|
||||
@@ -260,7 +261,7 @@ thickLineCol ps t = pictures $ f ps
|
||||
,(y +.+ n x y,c')
|
||||
] : f ((y,c'):ys)
|
||||
f _ = []
|
||||
n a b = (t*0.5) *.* errorNormalizeV 42 (vNormal (a -.- b))
|
||||
n a b = (t*0.5) *.* safeNormalizeV (vNormal (a -.- b))
|
||||
|
||||
thickCircle :: Float -> Float -> Picture
|
||||
{-# INLINE thickCircle #-}
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ import Control.Monad
|
||||
import Graphics.Rendering.OpenGL hiding (Point,translate,scale,imageHeight)
|
||||
import Graphics.GL.Core43
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
import Data.Bifunctor
|
||||
--import Data.Bifunctor
|
||||
--import Text.RawString.QQ
|
||||
--import Linear.Matrix
|
||||
--import Linear.V4
|
||||
|
||||
+15
-14
@@ -10,8 +10,8 @@ import Shader.Data
|
||||
import Shader.Parameters
|
||||
import Picture.Data
|
||||
|
||||
import Data.Maybe
|
||||
import Data.List
|
||||
--import Data.Maybe
|
||||
--import Data.List
|
||||
import Foreign
|
||||
import Control.Monad
|
||||
import qualified Control.Foldl as F
|
||||
@@ -35,15 +35,16 @@ pokeVertices
|
||||
-> IO Int
|
||||
pokeVertices toFs ptr stride n rt = foldM (pokeVertex ptr stride) n (toFs rt)
|
||||
|
||||
getterPicShad :: VertexType -> Getting a (PicShads a) a
|
||||
getterPicShad PolyV = psPoly
|
||||
getterPicShad PolyzV{} = psPolyz
|
||||
getterPicShad BezV{} = psBez
|
||||
getterPicShad TextV{} = psText
|
||||
getterPicShad ArcV{} = psArc
|
||||
getterPicShad EllV = psEll
|
||||
getterPicShad :: VertexType -> PicShads a -> a
|
||||
--{-# INLINE getterPicShad #-}
|
||||
getterPicShad PolyV = _psPoly
|
||||
getterPicShad PolyzV{} = _psPolyz
|
||||
getterPicShad BezV{} = _psBez
|
||||
getterPicShad TextV{} = _psText
|
||||
getterPicShad ArcV{} = _psArc
|
||||
getterPicShad EllV = _psEll
|
||||
|
||||
--setterPicShad :: VertexType -> ASetter
|
||||
setterPicShad :: VertexType -> ASetter (PicShads a) (PicShads a) a a
|
||||
setterPicShad PolyV = psPoly
|
||||
setterPicShad PolyzV{} = psPolyz
|
||||
setterPicShad BezV{} = psBez
|
||||
@@ -55,8 +56,8 @@ pokeVX' :: PicShads VShader -> PicShads Int -> Verx -> IO (PicShads Int)
|
||||
pokeVX' shads count vx = do
|
||||
let f = setterPicShad (_vxType vx)
|
||||
g = getterPicShad (_vxType vx)
|
||||
vshad = shads ^. g
|
||||
n = count ^. g
|
||||
vshad = g shads
|
||||
n = g count
|
||||
theVBO = _vaoVBO $ _vshaderVAO vshad
|
||||
ptr = _vboPointer theVBO
|
||||
stride = _vboStride theVBO
|
||||
@@ -69,8 +70,8 @@ pokeVX shads laycounts vx = do
|
||||
offset = _vxLayer vx
|
||||
counts = laycounts IM.! offset
|
||||
getF = getterPicShad theType
|
||||
vshad = shads ^. getF
|
||||
n = counts ^. getF
|
||||
vshad = getF shads
|
||||
n = getF counts
|
||||
theVBO = _vaoVBO $ _vshaderVAO vshad
|
||||
ptr = _vboPointer theVBO
|
||||
stride = _vboStride theVBO
|
||||
|
||||
Reference in New Issue
Block a user