Make examine inventory controlled by item, perhaps still buggy
This commit is contained in:
@@ -6,9 +6,9 @@ module Dodge.Item.Display (
|
||||
basicItemDisplay,
|
||||
) where
|
||||
|
||||
import Dodge.Data.World
|
||||
import Data.Maybe
|
||||
import Dodge.Data.ComposedItem
|
||||
import Dodge.Data.Creature
|
||||
import Dodge.Item.InvSize
|
||||
import LensHelp
|
||||
import Padding
|
||||
@@ -18,14 +18,14 @@ import ShortShow
|
||||
-- variety of factors but typically don't depend on functional quality,
|
||||
-- colour gives an indication of an item's function within a structure
|
||||
|
||||
itemDisplay :: Creature -> ComposedItem -> [String]
|
||||
itemDisplay cr ci =
|
||||
itemDisplay :: World -> Creature -> ComposedItem -> [String]
|
||||
itemDisplay w cr ci =
|
||||
zipWithDefaults
|
||||
id
|
||||
(leftPad 15 ' ')
|
||||
itemDisplayPad
|
||||
(basicItemDisplay itm)
|
||||
(itemNumberDisplay cr ci)
|
||||
(itemNumberDisplay w cr ci)
|
||||
where
|
||||
itm = ci ^. _1
|
||||
|
||||
@@ -92,8 +92,12 @@ showEquipItem eit = case eit of
|
||||
-- this can change, but probably won't when (say) dropped and then picked up
|
||||
-- again
|
||||
-- that is to say, it should not change based on functional positioning
|
||||
itemNumberDisplay :: Creature -> ComposedItem -> [String]
|
||||
itemNumberDisplay cr ci
|
||||
itemNumberDisplay :: World -> Creature -> ComposedItem -> [String]
|
||||
itemNumberDisplay w cr ci
|
||||
| Just x <- ci ^? _1 . itUse . useToggle = [show x]
|
||||
| ITEMSCANNER <- ci ^. _1 . itType
|
||||
, Just ExamineInventory <- w ^? hud . hudElement . subInventory
|
||||
= ["ACTIVE"]
|
||||
| EQUIP WRIST_ECG <- ci ^. _1 . itType =
|
||||
[displayPulse $ cr ^?! crType . avatarPulse . pulseProgress]
|
||||
| HELD ALTERIFLE <- ci ^. _1 . itType =
|
||||
|
||||
@@ -131,6 +131,7 @@ getAmmoLinks itm =
|
||||
|
||||
itemToFunction :: Item -> ItemStructuralFunction
|
||||
itemToFunction itm = case itm ^. itType of
|
||||
ITEMSCANNER -> ToggleSF
|
||||
INTROSCAN {} -> IntroScanSF
|
||||
HELD LASER -> WeaponTargetingSF
|
||||
HELD{} -> case itm ^? itUseCondition of
|
||||
|
||||
@@ -10,6 +10,7 @@ itemInvColor :: ComposedItem -> Color
|
||||
itemInvColor ci = case ci ^. _2 of
|
||||
GrenadeHitEffectSF -> yellow
|
||||
IntroScanSF -> white
|
||||
ToggleSF -> white
|
||||
UnloadedWeaponSF -> mixColorsLinear 0.5 0.5 red white
|
||||
HeldPlatformSF -> white
|
||||
MakeAutoSF -> white
|
||||
|
||||
@@ -19,6 +19,7 @@ module Dodge.Item.Scope (
|
||||
introScan,
|
||||
) where
|
||||
|
||||
--import Dodge.Data.BlBl
|
||||
import Dodge.Item.Attach
|
||||
import Control.Lens
|
||||
import Dodge.Data.Item
|
||||
@@ -59,7 +60,7 @@ itemScanner =
|
||||
defaultHeldItem
|
||||
& itType .~ ITEMSCANNER
|
||||
& itUse .~ UseNothing
|
||||
|
||||
& itEffect . ieOnDrop .~ ItemCancelExamineInventory
|
||||
|
||||
bulletModule :: BulletMod -> Item
|
||||
bulletModule bm =
|
||||
|
||||
Reference in New Issue
Block a user