Make display colour for introscan white
This commit is contained in:
@@ -43,6 +43,7 @@ data ItemStructuralFunction
|
|||||||
| GadgetPlatformSF
|
| GadgetPlatformSF
|
||||||
| WeaponScopeSF
|
| WeaponScopeSF
|
||||||
| WeaponTargetingSF
|
| WeaponTargetingSF
|
||||||
|
| IntroScanSF
|
||||||
| TriggerSF
|
| TriggerSF
|
||||||
| AugmentedHUDSF
|
| AugmentedHUDSF
|
||||||
| AmmoMagSF AmmoType
|
| AmmoMagSF AmmoType
|
||||||
|
|||||||
@@ -131,6 +131,7 @@ getAmmoLinks itm =
|
|||||||
|
|
||||||
itemToFunction :: Item -> ItemStructuralFunction
|
itemToFunction :: Item -> ItemStructuralFunction
|
||||||
itemToFunction itm = case itm ^. itType of
|
itemToFunction itm = case itm ^. itType of
|
||||||
|
INTROSCAN {} -> IntroScanSF
|
||||||
HELD LASER -> WeaponTargetingSF
|
HELD LASER -> WeaponTargetingSF
|
||||||
HELD{} -> case itm ^? itUseCondition of
|
HELD{} -> case itm ^? itUseCondition of
|
||||||
Just UseableWhenAimed -> HeldPlatformSF
|
Just UseableWhenAimed -> HeldPlatformSF
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import Dodge.Data.ComposedItem
|
|||||||
|
|
||||||
itemInvColor :: ComposedItem -> Color
|
itemInvColor :: ComposedItem -> Color
|
||||||
itemInvColor ci = case ci ^. _2 of
|
itemInvColor ci = case ci ^. _2 of
|
||||||
|
IntroScanSF -> white
|
||||||
UnloadedWeaponSF -> mixColorsLinear 0.5 0.5 red white
|
UnloadedWeaponSF -> mixColorsLinear 0.5 0.5 red white
|
||||||
HeldPlatformSF -> white
|
HeldPlatformSF -> white
|
||||||
MakeAutoSF -> white
|
MakeAutoSF -> white
|
||||||
|
|||||||
+14
-14
@@ -1,9 +1,8 @@
|
|||||||
module ShortShow
|
module ShortShow (
|
||||||
( shortShow
|
shortShow,
|
||||||
) where
|
) where
|
||||||
import Geometry
|
|
||||||
|
|
||||||
--import Data.Typeable
|
import Geometry
|
||||||
import Numeric
|
import Numeric
|
||||||
|
|
||||||
class ShortShow a where
|
class ShortShow a where
|
||||||
@@ -11,13 +10,13 @@ class ShortShow a where
|
|||||||
|
|
||||||
instance ShortShow a => ShortShow (V2 a) where
|
instance ShortShow a => ShortShow (V2 a) where
|
||||||
shortShow (V2 x y) = shortShow x ++ "#" ++ shortShow y
|
shortShow (V2 x y) = shortShow x ++ "#" ++ shortShow y
|
||||||
|
|
||||||
instance ShortShow Float where
|
instance ShortShow Float where
|
||||||
shortShow x = showFFloat (Just 2) x ""
|
shortShow x = showFFloat (Just 2) x ""
|
||||||
|
|
||||||
instance ShortShow Int where
|
instance ShortShow Int where
|
||||||
shortShow x
|
shortShow x
|
||||||
| x < k = show x
|
| x < k' = show x
|
||||||
| x < m = fdiv x k "K"
|
| x < m = fdiv x k "K"
|
||||||
| x < g = fdiv x m "M"
|
| x < g = fdiv x m "M"
|
||||||
| x < t = fdiv x g "G"
|
| x < t = fdiv x g "G"
|
||||||
@@ -25,18 +24,19 @@ instance ShortShow Int where
|
|||||||
| otherwise = show x ++ "P"
|
| otherwise = show x ++ "P"
|
||||||
|
|
||||||
fdiv :: Int -> Int -> String -> String
|
fdiv :: Int -> Int -> String -> String
|
||||||
fdiv x y s = removeDot (take 3 (show ((fromIntegral x / fromIntegral y)::Float))) ++ s
|
fdiv x y s = removeDot (take 3 (show ((fromIntegral x / fromIntegral y) :: Float))) ++ s
|
||||||
|
|
||||||
removeDot :: String -> String
|
removeDot :: String -> String
|
||||||
removeDot [a,b,'.'] = [a,b]
|
removeDot [a, b, '.'] = [a, b]
|
||||||
removeDot xs = xs
|
removeDot xs = xs
|
||||||
|
|
||||||
k,m,g,t,p :: Int
|
k, k', m, g, t, p :: Int
|
||||||
k = 10 ^ (3 :: Int)
|
k = 10 ^ (3 :: Int)
|
||||||
|
k' = 10 ^ (4 :: Int) -- this allows showing up to 9999 directly
|
||||||
m = 10 ^ (6 :: Int)
|
m = 10 ^ (6 :: Int)
|
||||||
g = 10 ^ (9 :: Int)
|
g = 10 ^ (9 :: Int)
|
||||||
t = 10 ^ (12:: Int)
|
t = 10 ^ (12 :: Int)
|
||||||
p = 10 ^ (15:: Int)
|
p = 10 ^ (15 :: Int)
|
||||||
|
|
||||||
instance (ShortShow a,ShortShow b) => ShortShow (a,b) where
|
instance (ShortShow a, ShortShow b) => ShortShow (a, b) where
|
||||||
shortShow (a,b) = '(' : shortShow a ++ "," ++ shortShow b ++ ")"
|
shortShow (a, b) = '(' : shortShow a ++ "," ++ shortShow b ++ ")"
|
||||||
|
|||||||
Reference in New Issue
Block a user