This commit is contained in:
2024-11-25 20:43:27 +00:00
parent 00d8190ffc
commit 172429bc79
2 changed files with 1 additions and 28 deletions
+1 -1
View File
@@ -1 +1 @@
All good (594 modules, at 20:39:56)
All good (594 modules, at 20:42:55)
-27
View File
@@ -13,7 +13,6 @@ import qualified Data.IntSet as IS
import Data.List (sort)
import qualified Data.Map.Strict as M
import Data.Maybe
--import Dodge.Base.You
import Dodge.Button.Event
import Dodge.Camera
import Dodge.Creature.Action
@@ -110,7 +109,6 @@ tryDropSelected mpos w = do
guard $ maybe True (\(i,_) -> i == 3) mpos
cr <- w ^? cWorld . lWorld . creatures . ix 0
(0, _, xs) <- w ^? hud . hudElement . diSelection . _Just
-- xs <- w ^? hud . hudElement . diSelection . _Just . _3
return . foldl' (flip $ dropItem cr) w . IS.toDescList $ xs
tryPickupSelected :: Int -> Maybe (Int,Int) -> World -> Maybe World
@@ -215,13 +213,8 @@ startDrag :: (Int, Int) -> Configuration -> World -> World
startDrag (a, b) cfig w = setcontext . fromMaybe (augInvDirectSelect (a, b, IS.singleton b) w) $ do
(i, _, xs) <- w ^? hud . hudElement . diSelection . _Just
guard $ i == a && b `IS.member` xs
--return $ setmichosen xs w
return w
where
-- setmichosen :: IS.IntSet -> World -> World
-- setmichosen x =
-- (input . mouseContext .~ OverInvDrag a (Just (a, b)) above bneath)
-- . (hud . hudElement . diSelectionExtra .~ IS.insert b x)
setcontext = (input . mouseContext .~ OverInvDrag a (Just (a, b)) above bneath)
above :: Maybe (Int,Int)
above = do
@@ -232,25 +225,6 @@ startDrag (a, b) cfig w = setcontext . fromMaybe (augInvDirectSelect (a, b, IS.s
sss <- w ^? hud . hudElement . diSections
inverseSelSecYint (yint + 1) sss
yint = posSelSecYint cfig (invDisplayParams w) (w ^. input . mousePos . _y)
--startDrag (a, b) cfig w = fromMaybe (augInvDirectSelect (a, b) $ setmichosen mempty w) $ do
-- (i, _, xs) <- w ^? hud . hudElement . diSelection . _Just
---- xs <- w ^? hud . hudElement . diSelectionExtra
-- guard $ i == a && b `IS.member` xs
-- return $ setmichosen xs w
-- where
-- setmichosen :: IS.IntSet -> World -> World
-- setmichosen x =
-- (input . mouseContext .~ OverInvDrag a (Just (a, b)) above bneath)
-- . (hud . hudElement . diSelectionExtra .~ IS.insert b x)
-- above :: Maybe (Int,Int)
-- above = do
-- sss <- w ^? hud . hudElement . diSections
-- inverseSelSecYint (yint - 1) sss
-- bneath :: Maybe (Int,Int)
-- bneath = do
-- sss <- w ^? hud . hudElement . diSections
-- inverseSelSecYint (yint + 1) sss
-- yint = posSelSecYint cfig (invDisplayParams w) (w ^. input . mousePos . _y)
concurrentIS :: IS.IntSet -> Bool
concurrentIS = go . IS.minView
@@ -286,7 +260,6 @@ shiftInvItems k x ab bn xs ss w = setSelWhileDragging . fromMaybe w $ do
(mini,_) <- IS.minView xs
if x < (k,mini)
then do
--_ <- ss ^? ix (mini - 1)
guard $ not . null . fst $ IM.split mini ss
guard $ Just (k,mini-1) /= ab
return $ shiftInvItemsUp k xs w