Fix direction stuttering bug
This commit is contained in:
+11
-29
@@ -103,27 +103,15 @@ displayMidList w strs s =
|
||||
invHead :: World -> String -> Picture
|
||||
invHead w s = winScale w . translate (-130) (halfHeight w - 40) . dShadCol white . scale 0.4 0.4 $ text s
|
||||
|
||||
renderItemMapAt :: Float -> Float -> IM.IntMap Item -> World -> Picture
|
||||
{-# INLINE renderItemMapAt #-}
|
||||
renderItemMapAt tx ty scols w =
|
||||
--concatMapPic (winScale w) $ IM.mapWithKey (listItemAt tx ty w) scols
|
||||
--concatMapPic (winScale w . uncurry (listItemAt tx ty w)) $ IM.toList scols
|
||||
concatMapPic (uncurry $ listItemAt' tx ty w) $ IM.toList scols
|
||||
|
||||
--renderPairListAt :: Float -> Float -> [(Int,(String,Color))] -> World -> Picture
|
||||
--renderPairListAt tx ty scols w =
|
||||
-- concatMapPic (winScale w) $ map (uncurry $ listPairAt tx ty w) scols
|
||||
|
||||
renderItemMapAt :: Float -> Float -> World -> IM.IntMap Item -> Picture
|
||||
--{-# INLINE renderItemMapAt #-}
|
||||
renderItemMapAt tx ty w = concatMapPic (uncurry $ listItemAt tx ty w) . IM.toList
|
||||
|
||||
displayInv :: Int -> World -> Picture
|
||||
displayInv n w = renderItemMapAt 0 0 items w
|
||||
displayInv n w = renderItemMapAt 0 0 w items
|
||||
where
|
||||
items = _crInv $ _creatures w IM.! n
|
||||
|
||||
--itemStringCol :: Item -> (String,Color)
|
||||
--itemStringCol NoItem = ("----", greyN 0.5)
|
||||
--itemStringCol itm = (_itInvDisplay itm itm, _itInvColor itm)
|
||||
|
||||
drawLocations :: World -> Picture
|
||||
drawLocations w = pictures $
|
||||
renderListAt 0 0 w locs
|
||||
@@ -192,33 +180,27 @@ closeObjectTexts w = pictures $
|
||||
mainListCursor :: Color -> Int -> World -> Picture
|
||||
mainListCursor c = openCursorAt 120 c 5 0
|
||||
|
||||
listItemAt'
|
||||
listItemAt
|
||||
:: Float -- ^ x offset
|
||||
-> Float -- ^ y offset
|
||||
-> World
|
||||
-> Int -- ^ y offset (discrete)
|
||||
-> Item -- ^ The item
|
||||
-> Picture
|
||||
{-# INLINE listItemAt' #-}
|
||||
listItemAt' xoff yoff w yint item = winScale w . translate (xoff + 15 - halfWidth w) (yoff + halfHeight w - (20 * (fromIntegral yint+1)))
|
||||
--{-# INLINE listItemAt #-}
|
||||
listItemAt xoff yoff w yint item
|
||||
= winScale w
|
||||
. translate (xoff + 15 - hw) (yoff + hh - (20 * (fromIntegral yint+1)))
|
||||
. scale 0.1 0.1
|
||||
. dShadCol col
|
||||
$ text s
|
||||
where
|
||||
hw = halfWidth w
|
||||
hh = halfHeight w
|
||||
(s,col) = case item of
|
||||
NoItem -> ("----", greyN 0.5)
|
||||
_ -> (_itInvDisplay item item , _itInvColor item)
|
||||
|
||||
--listItemAt
|
||||
-- :: Float -- ^ x offset
|
||||
-- -> Float -- ^ y offset
|
||||
-- -> World
|
||||
-- -> Int -- ^ y offset (discrete)
|
||||
-- -> Item -- ^ The item
|
||||
-- -> Picture
|
||||
--{-# INLINE listItemAt #-}
|
||||
--listItemAt xoff yoff w yint = listPairAt xoff yoff w yint . itemStringCol
|
||||
|
||||
openCursorAt
|
||||
:: Float -- ^ Width
|
||||
-> Color
|
||||
|
||||
Reference in New Issue
Block a user