Partially working change to selected items
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user