Partially working change to selected items

This commit is contained in:
2023-02-07 12:07:13 +00:00
parent 5f7d662454
commit c354949ca9
27 changed files with 386 additions and 288 deletions
+4 -1
View File
@@ -8,6 +8,7 @@ import Data.Sequence
import Dodge.Data.Creature
import Dodge.Data.World
import Dodge.Item.Weapon.ZoomScope
import Data.Maybe
--import LensHelp hiding ((|>), (<|))
-- should be able to just import data.item
@@ -17,7 +18,9 @@ doHeldScroll hs = case hs of
HeldScrollZoom -> overYourItem (const . setZoomScopeChange)
HeldScrollCharMode{} -> overYourItem $ \x _ -> itUse . heldScroll . hsCharMode %~ cycleSignum x
where
overYourItem f x cr w = w & cWorld . lWorld . creatures . ix 0 . crInv . ix (crSel $ you w) %~ f x cr
overYourItem f x cr w = fromMaybe w $ do
i <- cr ^? crInvSel . isel . ispItem
return $ w & cWorld . lWorld . creatures . ix 0 . crInv . ix i %~ f x cr
cycleSignum :: Float -> Seq a -> Seq a
cycleSignum x