This commit is contained in:
2025-01-06 01:05:56 +00:00
parent e5cbac480e
commit c20486fc34
6 changed files with 19 additions and 94 deletions
+4 -14
View File
@@ -1,28 +1,25 @@
{-# LANGUAGE LambdaCase #-}
module Dodge.Item.Display (
itemBaseName,
itemString,
basicItemDisplay,
) where
import Dodge.Data.World
import Data.Maybe
import Dodge.Data.ComposedItem
import Dodge.Data.World
import Dodge.Item.InvSize
import LensHelp
import Padding
import ShortShow
-- Principles: base names should identify an item, numbers can change based on a
-- variety of factors but typically don't depend on functional quality,
-- colour gives an indication of an item's function within a structure
-- itemDisplay has been moved out of this module 06/01/25
basicItemDisplay :: Item -> [String]
basicItemDisplay itm =
Prelude.take (itInvHeight itm) $
itemBaseName (itm ^. itType) :
--catMaybes [maybeWarmupStatus itm, maybeRateStatus itm]
catMaybes [maybeWarmupStatus itm]
++ repeat "*"
@@ -36,7 +33,6 @@ maybeWarmupStatus it = case it ^? itUse . heldDelay . warmMax of
let n = show x
in Just $ Prelude.take (5 - Prelude.length n) "*WARM" ++ n
itemString :: Item -> String
itemString = head . basicItemDisplay
@@ -53,7 +49,7 @@ itemBaseName = \case
TARGETING tt -> show tt
BULLETMOD (BulletModPayload btt) -> show btt
BULLETMOD (BulletModEffect btt) -> show btt
STICKYMOD -> "STICKYMOD"
STICKYMOD -> "STICKYMOD"
ITEMSCAN -> "ITEMSCAN"
INTROSCAN t -> show t
MAPPER -> "MAPPER"
@@ -89,9 +85,3 @@ showEquipItem :: EquipItemType -> String
showEquipItem eit = case eit of
INVISIBILITYEQUIPMENT esite -> "INVISIBILITY " ++ show esite
_ -> show eit
--maybeRateStatus :: Item -> Maybe String
--maybeRateStatus it = case it ^? itUse . heldDelay . rateMaxMax of
-- Nothing -> Nothing
-- _ -> Just $ leftPad 3 ' ' (show (_rateMax . _heldDelay $ _itUse it))