Fold in more ammo parameters, distinguish loadable and charging weapons
This commit is contained in:
@@ -11,12 +11,16 @@ import Data.Sequence
|
||||
import Control.Lens
|
||||
{- | Displays the item name, ammo if loaded, and any selected '_itCharMode'. -}
|
||||
basicWeaponDisplay :: Item -> String
|
||||
basicWeaponDisplay it = case it ^? itAttachment of
|
||||
Just ItCharMode {_itCharMode = (c :<| _)} -> midPadL 10 ' ' (_itName it) (' ' : aIfLoaded) ++ [' ',c]
|
||||
Just ItMode {_itMode = i} -> midPadL 10 ' ' (_itName it) (' ' : aIfLoaded) ++ show i
|
||||
_ -> midPadL 10 ' ' (_itName it) (' ' : aIfLoaded)
|
||||
basicWeaponDisplay it = midPadL 10 ' ' thename (' ' : thenumber) ++ theparam
|
||||
where
|
||||
aIfLoaded = case it ^? wpReloadState of
|
||||
Just 0 -> show $ _wpLoadedAmmo (_wpAmmo it)
|
||||
Just x -> "R" ++ show x
|
||||
_ -> ""
|
||||
thename = _itName it
|
||||
thenumber = case it ^? wpAmmo of
|
||||
Just am@LoadableAmmo{} -> case _wpReloadState am of
|
||||
0 -> show $ _wpLoadedAmmo am
|
||||
x -> "R" ++ show x
|
||||
Just am@ChargeableAmmo{} -> show $ _wpCharge am
|
||||
Nothing -> ""
|
||||
theparam = case it ^? itAttachment of
|
||||
Just ItCharMode {_itCharMode = (c :<| _)} -> [' ',c]
|
||||
Just ItMode {_itMode = i} -> show i
|
||||
_ -> []
|
||||
|
||||
Reference in New Issue
Block a user