Refactor inventory management, add tweak, combine and inspect modes

This commit is contained in:
jgk
2021-05-26 17:25:46 +02:00
parent f05381be47
commit 0187ae6001
13 changed files with 323 additions and 233 deletions
+14 -1
View File
@@ -96,7 +96,14 @@ data World = World
, _sideEffects :: [PreloadData SoundOrigin -> IO (PreloadData SoundOrigin)]
, _doneSideEffects :: [PreloadData SoundOrigin -> IO (PreloadData SoundOrigin)]
, _debugFlags :: DebugFlags
, _inventoryMode :: InventoryMode
}
data InventoryMode
= TopInventory
| TweakInventory
| CombineInventory
| InspectInventory
deriving (Eq, Ord, Show)
data CrGroupParams = CrGroupParams
{ _crGroupParamID :: Int
, _crGroupIDs :: IS.IntSet
@@ -390,13 +397,19 @@ data Ammo
= ShellAmmo
{ _amPayload :: Point2 -> World -> World
, _amString :: String
, _amPjMove :: Item -> Creature -> [Projectile -> World -> World]
, _amPjMove :: [PjParam]
, _amPjDraw :: Projectile -> Picture
, _amParamSel :: Int
}
| BulletAmmo
{ _amString :: String
}
| GenericAmmo
data PjParam = PjParam
{ _pjMoveParam :: Int -> Item -> Creature -> Projectile -> World -> World
, _pjIntParam :: Int
, _pjDisplayParam :: Int -> String
}
data Projectile
= Projectile
{ _pjPos :: Point2