Tweak inventory management

This commit is contained in:
2021-12-01 01:55:20 +00:00
parent 0ed260c9b7
commit b9e4a80a46
12 changed files with 138 additions and 109 deletions
+4 -3
View File
@@ -3,6 +3,7 @@ Display of weapon strings in the inventory.
-}
module Dodge.Item.Weapon.InventoryDisplay
( basicWeaponDisplay
, maybeWarmupStatus
) where
import Dodge.Data
import Padding
@@ -26,7 +27,7 @@ basicWeaponDisplay it = [midPadL 10 ' ' thename (' ' : thenumber) ++ theparam]
. listToMaybe
$ mapMaybe ($ it)
[ maybeModeStatus
, maybeWarmupStatus
-- , maybeWarmupStatus
, maybeRateStatus
]
@@ -45,6 +46,6 @@ maybeWarmupStatus :: Item -> Maybe String
maybeWarmupStatus it = case it ^? itUse . useDelay . warmMax of
Nothing -> Nothing
Just m -> case m - (_warmTime . _useDelay $ _itUse it) of
x | x <= 1 -> Just " WARM"
x | x <= 1 -> Just "WARM"
| otherwise -> let n = show x
in Just $ ' ' : Prelude.take (4 - Prelude.length n) "WARM" ++ n
in Just $ Prelude.take (4 - Prelude.length n) "WARM" ++ n