Remove invTrees function

This commit is contained in:
2024-11-29 20:47:16 +00:00
parent de4a955206
commit 59c65b059a
3 changed files with 5 additions and 33 deletions
+4 -6
View File
@@ -4,17 +4,15 @@ import Control.Monad
import qualified SDL
import Control.Lens
import Data.Maybe
import Dodge.Data.ComposedItem
import Dodge.Data.DoubleTree
import Dodge.Data.World
import Dodge.Payload
selectUse :: LabelDoubleTree ComposeLinkType Item -> Creature -> World -> World
selectUse ittree _ w = fromMaybe w $ do
selectUse :: Item -> Creature -> World -> World
selectUse itm _ w = fromMaybe w $ do
lbtime <- w ^? input . mouseButtons . ix SDL.ButtonLeft
guard $ lbtime == 0
itid <- ittree ^? ldtValue . itID
pjid <- ittree ^? ldtValue . itUse . uaParams . apLinkedProjectile . _Just
itid <- itm ^? itID
pjid <- itm ^? itUse . uaParams . apLinkedProjectile . _Just
thepj <- w ^? cWorld . lWorld . projectiles . ix pjid
return $
w