Continue refactor of reloading

This commit is contained in:
2022-06-20 11:12:24 +01:00
parent 2f4b381484
commit a85cf4d1fb
27 changed files with 243 additions and 299 deletions
+14 -8
View File
@@ -20,14 +20,7 @@ itemDisplay it = Prelude.take (itSlotsTaken it) $
++ moduleStrings it ++ repeat "*"
where
thename = show . _iyBase $ _itType it
thenumber = case it ^? itConsumption of
Just am@LoadableAmmo{} -> case _laTransfer am of
NoTransfer -> show (_laLoaded am)
Transfer _ time -> show time ++ "R" ++ show (_laLoaded am)
Just am@ChargeableAmmo{} -> show $ _wpCharge am
Just x@ItemItselfConsumable{} -> show (_icAmount x)
Just NoConsumption -> ""
Nothing -> ""
thenumber = showConsumption (_itConsumption it)
theparam = fromMaybe []
. listToMaybe
$ mapMaybe ($ it)
@@ -36,6 +29,19 @@ itemDisplay it = Prelude.take (itSlotsTaken it) $
-- , maybeRateStatus
]
showConsumption :: ItemConsumption -> String
showConsumption ic = case ic of
am@LoadableAmmo{} -> showLoading (_laLoadType ic) ++ show (_laLoaded am)
am@ChargeableAmmo{} -> show $ _wpCharge am
x@ItemItselfConsumable{} -> show (_icAmount x)
NoConsumption -> ""
showLoading :: LoadType -> String
showLoading lt = case lt ^? loadProgress of
Just (Eject t) -> show t ++ "E"
Just (Insert t _) -> show t ++ "R"
Just NoTransfer -> ""
Nothing -> ""
-- & itInvDisplay .~ \it -> head (basicItemDisplay it) :
-- ["*FIRERATE:" ++ fromMaybe "" (maybeRateStatus it)
-- ]