Allow pausable reloads with discrete progess steps
This commit is contained in:
@@ -55,14 +55,14 @@ showSelectedConsumption cr ic = case ic of
|
||||
|
||||
showReloadProgress :: Creature -> ItemConsumption -> String
|
||||
showReloadProgress cr ic = case cr ^?! crInvSel . iselAction of
|
||||
ReloadAction i la _ -> show i ++ showLoadActionType la
|
||||
ReloadAction i la _ -> show i ++ showLoadActionType la (_laLoaded ic)
|
||||
_ -> case ic ^? laProgress . _Just . ix 0 of
|
||||
Nothing -> show $ _laLoaded ic
|
||||
Just la -> show (_actionTime la) ++ showLoadActionType la
|
||||
Just la -> show (_actionTime la) ++ showLoadActionType la (_laLoaded ic)
|
||||
|
||||
showLoadProgress :: Int -> Maybe [LoadAction] -> String
|
||||
showLoadProgress x mlas = case mlas ^? _Just . ix 0 of
|
||||
Just la -> show (_actionTime la) ++ showLoadActionType la
|
||||
Just la -> show (_actionTime la) ++ showLoadActionType la x
|
||||
Nothing -> show x
|
||||
|
||||
showConsumption :: ItemConsumption -> String
|
||||
@@ -71,11 +71,12 @@ showConsumption ic = case ic of
|
||||
am@ChargeableAmmo{} -> show $ _wpCharge am
|
||||
x@ItemItselfConsumable{} -> show (_icAmount x)
|
||||
NoConsumption -> ""
|
||||
showLoadActionType :: LoadAction -> String
|
||||
showLoadActionType la = case la of
|
||||
Eject {} -> "E"
|
||||
Insert {} -> "L"
|
||||
Prime {} -> "P"
|
||||
showLoadActionType :: LoadAction -> Int -> String
|
||||
showLoadActionType la x = case la of
|
||||
LoadEject {} -> "E"
|
||||
LoadInsert {} -> "L"
|
||||
LoadAdd {} -> "A" ++ show x
|
||||
LoadPrime {} -> "P"
|
||||
|
||||
-- & itInvDisplay .~ \it -> head (basicItemDisplay it) :
|
||||
-- ["*FIRERATE:" ++ fromMaybe "" (maybeRateStatus it)
|
||||
|
||||
@@ -149,7 +149,7 @@ repeater :: Item
|
||||
repeater = rifle
|
||||
& itType . iyModules . at ModRifleMag ?~ EMPTYMODULE
|
||||
& itType . iyBase .~ REPEATER
|
||||
& itConsumption . laCycle .~ [loadEject 5, loadInsert 15 ,loadPrime 15]
|
||||
& itConsumption . laCycle .~ [loadEject 20, loadInsert 20 ,loadPrime 20]
|
||||
& itConsumption . laMax .~ 15
|
||||
& itDimension . dimSPic .~ (\it -> noPic $ baseRifleShape
|
||||
<> makeTinClipAt 0 (V3 10 (-2) 0) it
|
||||
|
||||
Reference in New Issue
Block a user