Continue removing LDTs

This commit is contained in:
2025-07-12 14:01:44 +01:00
parent 8ff607675b
commit f47f99eac4
15 changed files with 359 additions and 257 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ crSetRoots cid w = fromMaybe w $ do
dropMissing
preserveMissing
(zipWithMatched f)
(invRootTrees inv)
(invIMDT inv)
where
f _ _ = itLocation . ilIsRoot .~ True
+3 -2
View File
@@ -29,7 +29,7 @@ import NewInt
import Padding
import Picture.Base
invSelectionItem :: World -> Int -> LocationLDT ItemLink CItem -> SelectionItem ()
invSelectionItem :: World -> Int -> LocationDT OItem -> SelectionItem ()
invSelectionItem w indent loc =
SelectionItem
{ _siPictures = itemDisplay w cr ci
@@ -41,7 +41,8 @@ invSelectionItem w indent loc =
, _siPayload = ()
}
where
ci = loc ^. locLDT . ldtValue
ci = (a,b)
(a,b,_) = loc ^. locDT . dtValue
cr = w ^?! cWorld . lWorld . creatures . ix 0
-- note the convoluted display of the hotkey/equipment, this was done to avoid a
+6 -6
View File
@@ -65,15 +65,15 @@ checkConnection :: SoundOrigin -> SoundID -> Int -> Int -> World -> World
checkConnection so s i j w = fromMaybe w $ do
inv <- w ^? cWorld . lWorld . creatures . ix 0 . crInv
cpos <- w ^? cWorld . lWorld . creatures . ix 0 . crPos
let locs = allInvLocs inv
let locs = invIndents inv -- why indents?
iit <- locs ^? ix i . _2
jit <- locs ^? ix j . _2
guard $ isConnected iit || isConnected jit
return $ soundStart so cpos s Nothing w
isConnected :: LocationLDT b a -> Bool
isConnected x = case x ^. locLdtContext of
TopLDT ->
not (null $ x ^. locLDT . ldtRight)
|| not (null $ x ^. locLDT . ldtLeft)
isConnected :: LocationDT a -> Bool
isConnected x = case x ^. locDtContext of
TopDT ->
not (null $ x ^. locDT . dtRight)
|| not (null $ x ^. locDT . dtLeft)
_ -> True