Fix rotation on floor item labels
This commit is contained in:
@@ -404,7 +404,7 @@ drawItemName w flIt | magV (_crPos (you w) -.- _flItPos flIt) < 100
|
|||||||
&& hasLOS (_flItPos flIt) (_crPos (you w)) w
|
&& hasLOS (_flItPos flIt) (_crPos (you w)) w
|
||||||
= pictures
|
= pictures
|
||||||
[ scale (2/_windowX w) (2/_windowY w)
|
[ scale (2/_windowX w) (2/_windowY w)
|
||||||
. tranItPos
|
. t
|
||||||
. translate (-15) (-10*sqrt zoom - 5) $ dShadCol white
|
. translate (-15) (-10*sqrt zoom - 5) $ dShadCol white
|
||||||
$ scale 0.1 0.1 $ text $ nameOfItem
|
$ scale 0.1 0.1 $ text $ nameOfItem
|
||||||
, tranItPos' $ scLine [(-8,10),(-15,10),(-15,-10),(-8,-10)]
|
, tranItPos' $ scLine [(-8,10),(-15,10),(-15,-10),(-8,-10)]
|
||||||
@@ -419,8 +419,10 @@ drawItemName w flIt | magV (_crPos (you w) -.- _flItPos flIt) < 100
|
|||||||
-- ]
|
-- ]
|
||||||
| otherwise = blank
|
| otherwise = blank
|
||||||
where tranItPos = uncurry translate $ zoom *.* (_flItPos flIt -.- _cameraPos w)
|
where tranItPos = uncurry translate $ zoom *.* (_flItPos flIt -.- _cameraPos w)
|
||||||
tranItPos' = uncurry translate $ (_flItPos flIt)
|
tranItPos' = uncurry translate (_flItPos flIt) . rotate (_cameraRot w)
|
||||||
t = rotate (0 - (_cameraRot w)) . uncurry translate (zoom *.* (_flItPos flIt -.- _cameraPos w))
|
t = rotate (0 - (_cameraRot w))
|
||||||
|
. uncurry translate (zoom *.* (_flItPos flIt -.- _cameraPos w))
|
||||||
|
. rotate (_cameraRot w)
|
||||||
nameOfItem = case flIt of FlIt {} -> _itName $ _flIt flIt
|
nameOfItem = case flIt of FlIt {} -> _itName $ _flIt flIt
|
||||||
FlAm {_flAm = PistolBullet} -> "Bullets"
|
FlAm {_flAm = PistolBullet} -> "Bullets"
|
||||||
FlAm {_flAm = LiquidFuel} -> "Liquid Fuel"
|
FlAm {_flAm = LiquidFuel} -> "Liquid Fuel"
|
||||||
|
|||||||
Reference in New Issue
Block a user