Cleanup
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
|||||||
All good (594 modules, at 20:39:56)
|
All good (594 modules, at 20:42:55)
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import qualified Data.IntSet as IS
|
|||||||
import Data.List (sort)
|
import Data.List (sort)
|
||||||
import qualified Data.Map.Strict as M
|
import qualified Data.Map.Strict as M
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
--import Dodge.Base.You
|
|
||||||
import Dodge.Button.Event
|
import Dodge.Button.Event
|
||||||
import Dodge.Camera
|
import Dodge.Camera
|
||||||
import Dodge.Creature.Action
|
import Dodge.Creature.Action
|
||||||
@@ -110,7 +109,6 @@ tryDropSelected mpos w = do
|
|||||||
guard $ maybe True (\(i,_) -> i == 3) mpos
|
guard $ maybe True (\(i,_) -> i == 3) mpos
|
||||||
cr <- w ^? cWorld . lWorld . creatures . ix 0
|
cr <- w ^? cWorld . lWorld . creatures . ix 0
|
||||||
(0, _, xs) <- w ^? hud . hudElement . diSelection . _Just
|
(0, _, xs) <- w ^? hud . hudElement . diSelection . _Just
|
||||||
-- xs <- w ^? hud . hudElement . diSelection . _Just . _3
|
|
||||||
return . foldl' (flip $ dropItem cr) w . IS.toDescList $ xs
|
return . foldl' (flip $ dropItem cr) w . IS.toDescList $ xs
|
||||||
|
|
||||||
tryPickupSelected :: Int -> Maybe (Int,Int) -> World -> Maybe World
|
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
|
startDrag (a, b) cfig w = setcontext . fromMaybe (augInvDirectSelect (a, b, IS.singleton b) w) $ do
|
||||||
(i, _, xs) <- w ^? hud . hudElement . diSelection . _Just
|
(i, _, xs) <- w ^? hud . hudElement . diSelection . _Just
|
||||||
guard $ i == a && b `IS.member` xs
|
guard $ i == a && b `IS.member` xs
|
||||||
--return $ setmichosen xs w
|
|
||||||
return w
|
return w
|
||||||
where
|
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)
|
setcontext = (input . mouseContext .~ OverInvDrag a (Just (a, b)) above bneath)
|
||||||
above :: Maybe (Int,Int)
|
above :: Maybe (Int,Int)
|
||||||
above = do
|
above = do
|
||||||
@@ -232,25 +225,6 @@ startDrag (a, b) cfig w = setcontext . fromMaybe (augInvDirectSelect (a, b, IS.s
|
|||||||
sss <- w ^? hud . hudElement . diSections
|
sss <- w ^? hud . hudElement . diSections
|
||||||
inverseSelSecYint (yint + 1) sss
|
inverseSelSecYint (yint + 1) sss
|
||||||
yint = posSelSecYint cfig (invDisplayParams w) (w ^. input . mousePos . _y)
|
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 :: IS.IntSet -> Bool
|
||||||
concurrentIS = go . IS.minView
|
concurrentIS = go . IS.minView
|
||||||
@@ -286,7 +260,6 @@ shiftInvItems k x ab bn xs ss w = setSelWhileDragging . fromMaybe w $ do
|
|||||||
(mini,_) <- IS.minView xs
|
(mini,_) <- IS.minView xs
|
||||||
if x < (k,mini)
|
if x < (k,mini)
|
||||||
then do
|
then do
|
||||||
--_ <- ss ^? ix (mini - 1)
|
|
||||||
guard $ not . null . fst $ IM.split mini ss
|
guard $ not . null . fst $ IM.split mini ss
|
||||||
guard $ Just (k,mini-1) /= ab
|
guard $ Just (k,mini-1) /= ab
|
||||||
return $ shiftInvItemsUp k xs w
|
return $ shiftInvItemsUp k xs w
|
||||||
|
|||||||
Reference in New Issue
Block a user