Refactoring, linting

This commit is contained in:
2021-04-30 15:22:24 +02:00
parent c8e84c775f
commit 83c2220813
6 changed files with 205 additions and 263 deletions
+7 -5
View File
@@ -17,11 +17,13 @@ import Control.Monad
Displays the item name, ammo if loaded, and any selected '_itCharMode'.
-}
basicWeaponDisplay :: Item -> String
basicWeaponDisplay it = case it ^? itAttachment . _Just . itCharMode of
Just (c :<| _) -> midPadL 10 ' ' (_itName it) (' ' : aIfLoaded) ++ [' ',c]
basicWeaponDisplay it = case it ^? itAttachment . _Just 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)
where
availableAmmo = show $ _wpMaxAmmo it
aIfLoaded = case _wpReloadState it of
0 -> show $ _wpLoadedAmmo it
x -> "R" ++ show x
aIfLoaded = case it ^? wpReloadState of
Just 0 -> show $ _wpLoadedAmmo it
Just x -> "R" ++ show x
_ -> ""