Continue refactoring reloading

This commit is contained in:
2022-06-21 13:06:55 +01:00
parent 37eb69c661
commit 14a7189b44
12 changed files with 80 additions and 60 deletions
+4 -5
View File
@@ -31,14 +31,13 @@ itemDisplay it = Prelude.take (itSlotsTaken it) $
showConsumption :: ItemConsumption -> String
showConsumption ic = case ic of
am@LoadableAmmo{} -> showLoading (_laProgress ic) ++ show (_laLoaded am)
am@LoadableAmmo{} -> showLoading ic ++ show (_laLoaded am)
am@ChargeableAmmo{} -> show $ _wpCharge am
x@ItemItselfConsumable{} -> show (_icAmount x)
NoConsumption -> ""
showLoading :: LoadProgress -> String
showLoading lt = case lt ^? futureActions . ix 0 of
Just lap -> show (_actionTime (_actionType lap) - _actionProgress lap)
++ showLoadActionType (_actionType lap)
showLoading :: ItemConsumption -> String
showLoading ic = case ic ^? laProgress . _Just . ix 0 of
Just la -> showLoadActionType la
Nothing -> ""
showLoadActionType :: LoadAction -> String
showLoadActionType la = case la of