Major item refactor, still broken
This commit is contained in:
@@ -131,7 +131,7 @@ tryPickupSelected k mpos w = do
|
||||
guard $ k == 3
|
||||
guard $ maybe True (\(i, _) -> i == 0 || i == 1) mpos
|
||||
cr <- w ^? cWorld . lWorld . creatures . ix 0
|
||||
let nfreeslots = crNumFreeSlots cr
|
||||
let nfreeslots = crNumFreeSlots (w ^. cWorld . lWorld . items) cr
|
||||
xs <- w ^? hud . hudElement . diSelection . _Just . _3
|
||||
let itmstopickup = mapMaybe g $ IS.toList xs
|
||||
let slotsneeded = alaf Sum foldMap itInvHeight itmstopickup
|
||||
@@ -238,6 +238,7 @@ updateMouseClickInGame cfig w = case w ^. input . mouseContext of
|
||||
str <-
|
||||
fmap (take 5) $
|
||||
w ^? cWorld . lWorld . creatures . ix 0 . crInv . ix j
|
||||
>>= \k -> w ^? cWorld . lWorld . items . ix k
|
||||
>>= (listToMaybe . basicItemDisplay)
|
||||
return . (worldEventFlags . at CombineInventoryChange ?~ ()) $
|
||||
case w ^? hud . hudElement . subInventory . ciFilter . _Just of
|
||||
@@ -541,7 +542,7 @@ tryCombine (i, j) w = fromMaybe w $ do
|
||||
CombinableItem is it <- sss ^? ix i . ssItems . ix j . siPayload . _Just
|
||||
p <- w ^? cWorld . lWorld . creatures . ix 0 . crPos
|
||||
return $
|
||||
snd (createItemYou it (foldr (destroyInvItem 0) w (sort is)))
|
||||
(createItemYou it (foldr (destroyInvItem 0) w (sort is)))
|
||||
& soundStart InventorySound p wrench1S Nothing
|
||||
& hud . hudElement . diSelection . _Just . _3 .~ mempty
|
||||
|
||||
|
||||
Reference in New Issue
Block a user