Highlight moused-over inventory items

This commit is contained in:
2024-10-16 22:14:11 +01:00
parent cf0873d73b
commit d256bc0443
9 changed files with 214 additions and 148 deletions
-22
View File
@@ -2,8 +2,6 @@ module Dodge.Render.ShapePicture (
worldSPic,
) where
import Dodge.Render.HUD
import Dodge.ListDisplayParams
import qualified Data.Map.Strict as M
import Control.Lens
import Control.Monad (guard)
@@ -40,8 +38,6 @@ worldSPic cfig u =
<> foldup mcSPic (filtOn _mcPos _machines)
<> aimDelaySweep w
<> drawMouseSelection w
<> drawDISelections w cfig
<> drawDIMouseOver w cfig
where
w = _uvWorld u
foldup = foldMap'
@@ -57,22 +53,6 @@ drawMouseSelection w = fromMaybe mempty $ do
return $ noShape $ color (withAlpha 0.5 white)
$ setLayer FixedCoordLayer $ polygon $ reverse $ rectVV p (w ^. input . mousePos)
drawDIMouseOver :: World -> Configuration -> SPic
drawDIMouseOver w cfig = fromMaybe mempty $ do
i <- w ^? hud . hudElement . subInventory . nsMouseOver . _Just
sss <- w ^? hud . hudElement . diSections
let idp = invDisplayParams w
return . noShape . setLayer FixedCoordLayer . color white $ selSecDrawCursorAt (0,i) 10 idp sss
drawDISelections :: World -> Configuration -> SPic
drawDISelections w cfig = fromMaybe mempty $ do
(i,j) <- w ^? hud . hudElement . subInventory . nsSelected . _Just
sss <- w ^? hud . hudElement . diSections
let idp = invDisplayParams w
tp <- selNumPos cfig idp sss 0 i
bp <- selNumPos cfig idp sss 0 j
return . noShape . setLayer FixedCoordLayer . color red $ line [tp,bp]
aimDelaySweep :: World -> SPic
aimDelaySweep w = fromMaybe mempty $ do
cr <- w ^? cWorld . lWorld . creatures . ix 0
@@ -157,8 +137,6 @@ extraPics cfig u =
<> foldMap drawBul (_bullets lw)
<> foldMap drawBlip (_radarBlips lw)
<> _flares lw
-- <> foldMap (dbArg (drawBeam . _bmDraw)) (_positronBeams $ _beams lw)
-- <> foldMap (dbArg (drawBeam . _bmDraw)) (_electronBeams $ _beams lw)
<> foldMap (dbArg (drawLightSource . _lsPict)) (_lightSources lw)
<> testPic cfig w
<> foldMap ppDraw (_pressPlates lw)