Only display combinations for first items in list

This commit is contained in:
2024-09-08 21:00:16 +01:00
parent 4de15d2c21
commit db4a6a10de
16 changed files with 192 additions and 76 deletions
+1 -1
View File
@@ -5,4 +5,4 @@ import Data.Maybe
import Dodge.Data.Item
itStackAmount :: Item -> ItAmount
itStackAmount it = fromMaybe 1 $ it ^? itUse . useAmount
itStackAmount it = 1 -- fromMaybe 1 $ it ^? itUse . useAmount
+4 -4
View File
@@ -4,16 +4,16 @@ import Dodge.Default.Item
import Control.Lens
import Dodge.Data.Item
makeTypeCraftNum :: Int -> CraftType -> Item
makeTypeCraftNum i ct =
makeTypeCraftNum :: Int -> CraftType -> [Item]
makeTypeCraftNum i ct = replicate i $
defaultCraftItem
& itInvSize .~ 0.5
& itCurseStatus .~ Uncursed
& itUse . useAmount .~ fromIntegral i
-- & itUse . useAmount .~ fromIntegral i
& itType . iyBase .~ CRAFT ct
makeTypeCraft :: CraftType -> Item
makeTypeCraft = makeTypeCraftNum 1
makeTypeCraft = head . makeTypeCraftNum 1
energyBallCraft :: EnergyBallType -> Item
energyBallCraft ebt = makeTypeCraft (ENERGYBALLCRAFT ebt) & itInvSize .~ 1
+4 -2
View File
@@ -121,8 +121,10 @@ itemNumberDisplay cr itm = case iu of
HeldUse{} -> []
LeftUse{} -> [showAutoRechargeProgress (_leftConsumption iu)]
EquipUse{} -> showEquipmentNumber cr itm
CraftUse x -> [show $ x ^. getItAmount]
ConsumeUse {_useAmount = x} -> [show $ x ^. getItAmount]
--CraftUse x -> [show $ x ^. getItAmount]
CraftUse -> []
--ConsumeUse {_useAmount = x} -> [show $ x ^. getItAmount]
ConsumeUse {} -> []
AttachUse {} -> [] --[showReloadProgress cr itm]
AmmoMagUse {} -> [showLoadedAmount itm]
-- this could be cleaner here...
+6 -3
View File
@@ -7,6 +7,9 @@ import Dodge.Data.Item
import Dodge.Module
itSlotsTaken :: Item -> Int
itSlotsTaken it = case it ^? itUse . useAmount of
Nothing -> moduleSizes it + ceiling (_itInvSize it)
Just i -> moduleSizes it + ceiling (_itInvSize it * fromIntegral i)
itSlotsTaken it = moduleSizes it + ceiling (_itInvSize it)
--itSlotsTaken :: Item -> Int
--itSlotsTaken it = case it ^? itUse . useAmount of
-- Nothing -> moduleSizes it + ceiling (_itInvSize it)
-- Just i -> moduleSizes it + ceiling (_itInvSize it * fromIntegral i)