Refactor reloading to use list of required steps
This commit is contained in:
@@ -31,16 +31,20 @@ itemDisplay it = Prelude.take (itSlotsTaken it) $
|
||||
|
||||
showConsumption :: ItemConsumption -> String
|
||||
showConsumption ic = case ic of
|
||||
am@LoadableAmmo{} -> showLoading (_laLoadType ic) ++ show (_laLoaded am)
|
||||
am@LoadableAmmo{} -> showLoading (_laProgress 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 -> ""
|
||||
showLoading :: LoadProgress -> String
|
||||
showLoading lt = case lt ^? futureActions . ix 0 of
|
||||
Just lap -> show (_actionTime (_actionType lap) - _actionProgress lap)
|
||||
++ showLoadActionType (_actionType lap)
|
||||
Nothing -> ""
|
||||
showLoadActionType :: LoadAction -> String
|
||||
showLoadActionType la = case la of
|
||||
Eject {} -> "E"
|
||||
Insert {} -> "L"
|
||||
Prime {} -> "P"
|
||||
|
||||
-- & itInvDisplay .~ \it -> head (basicItemDisplay it) :
|
||||
-- ["*FIRERATE:" ++ fromMaybe "" (maybeRateStatus it)
|
||||
|
||||
Reference in New Issue
Block a user