Remove duplicated selection/manipulation positions
Needs more testing to make sure it all works properly
This commit is contained in:
@@ -252,13 +252,14 @@ multiSelScroll' f w = fromMaybe w $ do
|
||||
& hud . diSelection . _Just . slInt .~ k
|
||||
|
||||
changeSwapOther ::
|
||||
((Int -> Identity Int) -> ManipulatedObject -> Identity ManipulatedObject) ->
|
||||
--revise3 ((Int -> Identity Int) -> ManipulatedObject -> Identity ManipulatedObject) ->
|
||||
Int ->
|
||||
(Int -> IM.IntMap (SelectionItem ()) -> Maybe Int) ->
|
||||
Int ->
|
||||
World ->
|
||||
World
|
||||
changeSwapOther manlens n f i w = fromMaybe w $ do
|
||||
--revise3 changeSwapOther manlens n f i w = fromMaybe w $ do
|
||||
changeSwapOther n f i w = fromMaybe w $ do
|
||||
ss <- w ^? hud . diSections . ix n . ssItems
|
||||
k <- f i ss
|
||||
let doswap j
|
||||
@@ -268,7 +269,7 @@ changeSwapOther manlens n f i w = fromMaybe w $ do
|
||||
return $
|
||||
w
|
||||
& swapAnyExtraSelection 3 i k
|
||||
&hud. manObject . manlens %~ doswap
|
||||
-- &hud. manObject . manlens %~ doswap
|
||||
--revise1 & cWorld . lWorld . creatures . ix 0 . crManipulation . manObject . manlens %~ doswap
|
||||
& hud . closeItems %~ swapIndices i k
|
||||
& hud . diSelection . _Just . slInt %~ doswap
|
||||
@@ -281,8 +282,10 @@ swapItemWith ::
|
||||
World
|
||||
swapItemWith f (j, i) = case j of
|
||||
0 -> swapInvItems f i
|
||||
3 -> changeSwapOther ispCloseItem 3 f i
|
||||
5 -> changeSwapOther ispCloseButton 5 f i
|
||||
3 -> changeSwapOther 3 f i
|
||||
5 -> changeSwapOther 5 f i
|
||||
--revise3 3 -> changeSwapOther ispCloseItem 3 f i
|
||||
--revise3 5 -> changeSwapOther ispCloseButton 5 f i
|
||||
_ -> id
|
||||
|
||||
changeSwapWith :: (Int -> IM.IntMap (SelectionItem ()) -> Maybe Int) -> World -> World
|
||||
|
||||
Reference in New Issue
Block a user