Commit before using item structural function more prominently

This commit is contained in:
2024-10-05 16:38:14 +01:00
parent 164beeea6d
commit 7c324a03f6
5 changed files with 38 additions and 63 deletions
-17
View File
@@ -3,10 +3,6 @@ module Dodge.Render.ShapePicture (
) where
import Data.Strict.Tuple
import Control.Applicative
import Dodge.Data.DoubleTree
import Dodge.Data.ComposedItem
import Dodge.Item.Grammar
import NewInt
import Dodge.Render.List
import Control.Lens
@@ -39,7 +35,6 @@ worldSPic cfig u =
<> foldup btSPic (filtOn _btPos _buttons)
<> foldup mcSPic (filtOn _mcPos _machines)
<> aimDelaySweep w
-- <> anyTargeting w
where
w = _uvWorld u
foldup = foldMap'
@@ -72,18 +67,6 @@ drawSweep cr w = fromMaybe mempty $ do
theinput = w ^. input
mwp = mouseWorldPos theinput campos
-- assume for now that targeting is above the root,
-- and the augmented hud is above that
anyTargeting :: World -> SPic
anyTargeting w = fromMaybe mempty $ do
cr <- w ^? cWorld . lWorld . creatures . ix 0
itinvid <- cr ^? crManipulation . manObject . imRootItem
itmtree <- invTrees (_crInv cr) ^? ix itinvid
ttree <- lookup WeaponTargetingLink (itmtree ^. ldtRight)
_ <- lookup AugmentedHUDLink (ttree ^. ldtLeft)
<|> lookup AugmentedHUDLink (ttree ^. ldtRight)
return . noShape $ drawTargeting (ttree ^. ldtValue) w
drawCreature :: Creature -> SPic
drawCreature cr = case _crType cr of
Humanoid{} -> basicCrPict cr