hanabi-live
hanabi-live copied to clipboard
Refactor code dealing with draggability
Currently, we call turn.showClueUI
, turn.begin
, and turn.hideClueUIAndDisableDragging
from all kinds of views, which is bug-prone because it's not easy to reason about how all these calls interact and these calls access globals which may not be accounted for in how often the view is called.
Also we call checkSetDraggableAll
from many views as well.
Instead, there should be two views: one for shouldShowClueAreaChanged
and one for shouldBeDraggableChanged
(maybe per card on the second one?) and we should actually define the boolean logic for when the clue area should be shown or hidden and similarly for whether a card should be draggable.
yes, please do this
i imagine that doing this would fix the super annoying bug where sometimes when you exit from in-game replay and your hand isn't draggable
Is this still valid?
yes afaik
i will update the title accordingly