This commit is contained in:
2025-08-19 20:43:35 +01:00
parent 084210ea7d
commit 68cd362aa4
2 changed files with 15 additions and 16 deletions
-2
View File
@@ -23,7 +23,6 @@ data HUDElement
, _diInvFilter :: Maybe String
, _diCloseFilter :: Maybe String
}
-- | DisplayCarte
data SubInventory
= NoSubInventory
@@ -38,7 +37,6 @@ data SubInventory
, _ciSelection :: Maybe (Int, Int, IS.IntSet)
, _ciFilter :: Maybe String
}
-- | LockedInventory
| DisplayTerminal {_termID :: Int}
data HUD = HUD
+15 -14
View File
@@ -17,8 +17,6 @@ module Dodge.Inventory (
destroyAllInvItems,
) where
--import Dodge.Wall.Delete
--import Dodge.Item.Location
import Data.Function
import qualified Data.IntSet as IS
import Data.Maybe
@@ -26,7 +24,6 @@ import Dodge.Base
import Dodge.Data.SelectionList
import Dodge.Data.World
import Dodge.Equipment
--import Dodge.Euse
import Dodge.Inventory.CheckSlots
import Dodge.Inventory.Location
import Dodge.Inventory.RBList
@@ -120,7 +117,6 @@ rmInvItem cid invid w =
| x > invid || Just x == maxk = max 0 $ x - 1
| otherwise = x
-- this looks ugly...
updateCloseObjects :: World -> World
updateCloseObjects w =
w & hud . closeItems %~ f
@@ -175,18 +171,23 @@ swapItemWith ::
(Int, Int) ->
World ->
World
swapItemWith f (j, i) w = case j of
0 -> w & swapInvItems f i
3 -> w & changeSwapOther ispCloseItem 3 f i
5 -> w & changeSwapOther ispCloseButton 5 f i
_ -> w
swapItemWith f (j, i) = case j of
0 -> swapInvItems f i
3 -> changeSwapOther ispCloseItem 3 f i
5 -> changeSwapOther ispCloseButton 5 f i
_ -> id
changeSwapWith :: (Int -> IM.IntMap (SelectionItem ()) -> Maybe Int) -> World -> World
changeSwapWith f w = case w ^? hud . hudElement . diSelection . _Just of
Just (0, i, _) -> w & swapInvItems f i
Just (3, i, _) -> w & changeSwapOther ispCloseItem 3 f i
Just (5, i, _) -> w & changeSwapOther ispCloseButton 5 f i
_ -> w
changeSwapWith f w
| Just (j,i,_) <- w ^. hud . hudElement . diSelection = swapItemWith f (j,i) w
| otherwise = w
--changeSwapWith :: (Int -> IM.IntMap (SelectionItem ()) -> Maybe Int) -> World -> World
--changeSwapWith f w = case w ^? hud . hudElement . diSelection . _Just of
-- Just (0, i, _) -> w & swapInvItems f i
-- Just (3, i, _) -> w & changeSwapOther ispCloseItem 3 f i
-- Just (5, i, _) -> w & changeSwapOther ispCloseButton 5 f i
-- _ -> w
invSetSelection :: (Int, Int, IS.IntSet) -> World -> World
invSetSelection sel w =