Allow for door destruction
This commit is contained in:
+9
-4
@@ -101,21 +101,26 @@ handlePressedMouseButton but w = case (_hudElement (_hud w), but) of
|
||||
| inTermFocus w -> doTerminalEffectLB (w ^?! terminals . ix tmid) w
|
||||
| otherwise -> w & terminals . ix tmid . tmInput . tiFocus %~ const True
|
||||
( DisplayInventory (CombineInventory mi) , ButtonLeft)
|
||||
-> maybe (hud . hudElement .~ DisplayInventory NoSubInventory) doCombine mi w
|
||||
-> maybeexitcombine $ maybe id doCombine mi w
|
||||
_ -> w
|
||||
where
|
||||
maybeexitcombine
|
||||
| ButtonRight `S.member` _mouseButtons w = id
|
||||
| otherwise = hud . hudElement .~ DisplayInventory NoSubInventory
|
||||
|
||||
-- note "sort" on the inventory indices; otherwise
|
||||
-- lower items may be shifted up and items below these removed instead
|
||||
doCombine :: Int -> World -> World
|
||||
doCombine i w = case combineItemListYou w !? i of
|
||||
Nothing -> w
|
||||
Just (is,it) -> enterCombineInv
|
||||
Just (is,it) -> -- set (hud . hudElement) (DisplayInventory NoSubInventory)
|
||||
selectinv --enterCombineInv
|
||||
. createPutItem it
|
||||
-- . uncurry (putItemInInvID yid)
|
||||
-- . copyItemToFloorID (_crPos $ you w) (applyModules it)
|
||||
$ foldr (rmInvItem yid) w (sort is)
|
||||
where
|
||||
yid = _yourID w
|
||||
selectinv (Just i', w') = w' & creatures . ix yid . crInvSel .~ i'
|
||||
selectinv (Nothing, w') = w'
|
||||
|
||||
|
||||
handleMouseWheelEvent :: MouseWheelEventData -> Universe -> Maybe Universe
|
||||
|
||||
Reference in New Issue
Block a user