Fix more item bugs

This commit is contained in:
2025-08-24 23:50:16 +01:00
parent c2daa86463
commit d776c91cfd
9 changed files with 113 additions and 99 deletions
+11
View File
@@ -5,6 +5,7 @@
{-# LANGUAGE EmptyDataDeriving #-}
module Dodge.Data.Item.Location where
import ShortShow
import Dodge.Data.Equipment.Misc
import Control.Lens
import Data.Aeson
@@ -38,6 +39,16 @@ data ItemLocation
| InVoid
deriving (Eq, Show, Ord, Read) --Generic, Flat)
instance ShortShow ItemLocation where
shortShow (InInv cid invid rootb selb attb esite)
= "InInv:cid" <> shortShow cid <> "invid"<> shortShow invid
<>"root"<>shortShow rootb<>"sel"<>shortShow selb<>"att"<>shortShow attb<>
shortShow (fmap (SString . show) esite)
shortShow x = show x
-- | OnTurret {_ilTuID :: Int}
-- | OnFloor-- {_ilFlID :: NewInt FloorInt}
-- | InVoid
makeLenses ''ItemLocation
deriveJSON defaultOptions ''InvInt
deriveJSON defaultOptions ''FloorInt