This commit is contained in:
2022-06-08 13:43:37 +01:00
parent 4a5a643d46
commit 51c32e06ad
8 changed files with 60 additions and 82 deletions
+4 -3
View File
@@ -44,7 +44,8 @@ defaultItem = Item
basicItemDisplay :: Item -> [String]
basicItemDisplay it = Prelude.take (itSlotsTaken it) $
(midPadL 15 ' ' thename (' ' : thenumber) ++ theparam)
: moduleStrings it ++ repeat "*"
: catMaybes [maybeWarmupStatus it]
++ moduleStrings it ++ repeat "*"
where
thename = show . _iyBase $ _itType it
thenumber = case it ^? itConsumption of
@@ -79,9 +80,9 @@ 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 (5 - Prelude.length n) "*WARM" ++ n
defaultItemType :: ItemType
defaultItemType = ItemType NOTDEFINED mempty