Fix button not updating bug
This commit is contained in:
@@ -158,7 +158,8 @@ checkTermDist w = case w ^? hud . hudElement . subInventory . termID of
|
||||
|
||||
-- this looks ugly...
|
||||
updateCloseObjects :: World -> World
|
||||
updateCloseObjects w = w & closeObjects .~ unionBy closeObjEq oldCloseFiltered currentClose
|
||||
updateCloseObjects w = w
|
||||
& closeObjects .~ unionBy closeObjEq oldCloseFiltered currentClose
|
||||
& creatures . ix (_yourID w) . crInvSel %~ updateinvsel
|
||||
where
|
||||
updateinvsel curinvsel
|
||||
@@ -171,8 +172,10 @@ updateCloseObjects w = w & closeObjects .~ unionBy closeObjEq oldCloseFiltered c
|
||||
. IM.elems
|
||||
$ _buttons w
|
||||
currentClose = filt $ map Left (IM.elems $ _floorItems w) ++ activeButtons
|
||||
oldClose = filt $ _closeObjects w
|
||||
oldClose = filt $ mapMaybe updatebyid $ _closeObjects w
|
||||
oldCloseFiltered = intersectBy closeObjEq oldClose currentClose
|
||||
updatebyid (Left flid) = fmap Left $ w ^? floorItems . ix (_flItID flid)
|
||||
updatebyid (Right btid) = fmap Right $ w ^? buttons . ix (_btID btid)
|
||||
|
||||
updateRBList :: World -> World
|
||||
updateRBList w
|
||||
|
||||
Reference in New Issue
Block a user