hanabi-live icon indicating copy to clipboard operation
hanabi-live copied to clipboard

Refactor code dealing with draggability

Open timotree3 opened this issue 4 years ago • 4 comments

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.

timotree3 avatar Dec 04 '20 20:12 timotree3

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

Zamiell avatar Dec 04 '20 20:12 Zamiell

Is this still valid?

DrAnax avatar Jan 05 '22 16:01 DrAnax

yes afaik

Zamiell avatar Jan 05 '22 18:01 Zamiell

i will update the title accordingly

Zamiell avatar Jan 05 '22 18:01 Zamiell