Fix bugs in item locations
This commit is contained in:
+21
-2
@@ -20,8 +20,27 @@ import Dodge.Data.Universe
|
||||
import qualified IntMapHelp as IM
|
||||
|
||||
testStringInit :: Universe -> [String]
|
||||
testStringInit u = map show $
|
||||
(IM.toList . IM.filter (\itloc -> itloc ^? ilCrID == Just 0) $ (u ^. uvWorld . cWorld . lWorld . itemLocations)) <> IM.toList ( fmap _itLocation (u ^?! uvWorld . cWorld . lWorld . creatures . ix 0 . crInv))
|
||||
testStringInit u = (topTestPart u
|
||||
<>) $ map showh $
|
||||
(IM.toList . IM.filter (\itloc -> itloc ^? ilCrID == Just 0) $ (u ^. uvWorld . cWorld . lWorld . itemLocations)) <> ( IM.elems $ fmap h (u ^?! uvWorld . cWorld . lWorld . creatures . ix 0 . crInv))
|
||||
where
|
||||
h itm = (_itID itm, _itLocation itm)
|
||||
showh (x,(InInv a b c d)) = show x ++ "," ++ show a ++ "," ++ show b ++"," ++ show c ++"," ++ show d
|
||||
showh _ = ""
|
||||
|
||||
topTestPart :: Universe -> [String]
|
||||
topTestPart u = [show $ u ^? uvWorld . hud . hudElement . diSections . sssExtra . sssSelPos
|
||||
, maybe "" showManObj $ u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crManipulation . manObject
|
||||
]
|
||||
|
||||
showManObj :: ManipulatedObject -> String
|
||||
showManObj (InInventory SortInventory) = "SortInventory"
|
||||
showManObj (InInventory (SelectedItem x y)) = "SelItem: "++ show x++ " Root: "++show y
|
||||
showManObj (SelNothing) = "SelNothing"
|
||||
showManObj ((InNearby SortNearby)) = "SortNearby"
|
||||
showManObj (InNearby (SelCloseObject x)) = "Close " ++ show x
|
||||
|
||||
|
||||
--testStringInit u = fromMaybe mempty $ do
|
||||
-- inv <- fmap invLDT $ u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crInv
|
||||
-- invitm <- inv ^? ix 1
|
||||
|
||||
Reference in New Issue
Block a user