Continue refactor of reloading
This commit is contained in:
@@ -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)
|
||||
-- ]
|
||||
|
||||
Reference in New Issue
Block a user