Implement reloading of single external magazines

This commit is contained in:
2024-06-21 14:50:08 +01:00
parent 872e60438e
commit ecefba21d6
19 changed files with 157 additions and 340 deletions
+6 -6
View File
@@ -8,11 +8,11 @@ module Dodge.Item.Display (
basicItemDisplay,
) where
import Control.Applicative
import Control.Monad
--import Control.Applicative
--import Control.Monad
import Data.Maybe
import Dodge.Data.Creature
import Dodge.Item.Info
--import Dodge.Item.Info
import Dodge.Item.SlotsTaken
import Dodge.Module
import LensHelp
@@ -84,7 +84,7 @@ itemBaseName it = case _iyBase $ _itType it of
ATTACH ait -> showAttachItem ait
showAttachItem :: AttachType -> String
showAttachItem at = case at of
showAttachItem t = case t of
SCROLLATTACH x -> show x
AMMOATTACH x -> show x
TARGETATTACH x -> show x
@@ -129,7 +129,7 @@ itemNumberDisplay cr itm = case iu of
iu = itm ^?! itUse
showEquipmentNumber :: Creature -> Item -> [String]
showEquipmentNumber cr itm = case _eeUse ee of
showEquipmentNumber _ itm = case _eeUse ee of
EFuelSource x _ -> [show x]
EAmmoSource{_euseAmmoAmount = x} -> [show x]--showAmmoSource cr itm
EBatterySource{_euseBatteryAmount = x} -> [show x]
@@ -152,7 +152,7 @@ showEquipmentNumber cr itm = case _eeUse ee of
-- <|> Just [x]
showReloadProgress :: Creature -> Item -> String
showReloadProgress cr itm = fromMaybe [] $ do
showReloadProgress _ itm = fromMaybe [] $ do
ia <- itm ^? itUse . attachParams . ammoAttachParams
return $ case ia ^? iaProgress . _Just . ix 0 of
Nothing -> maybe "" show $ ia ^? iaLoaded