Closed afonsolage closed 11 months ago
Most of the work is done. I just need to fix a bug where the new system which watches for changes, is reacting to changes made by the bevy_ecss
itself.
I was able to fix the change detection, but after more tests, the Interaction
component change is not being detected. I'll do more research on that.
Ok, everything seems to be working fine now. Let's wrap things up and prepare to merge this. I'll write a new interactive example and write docs and changelog.
Fixes #39
Changed
Selector
s will now detect changes on entities and apply the stylesheet;Overall I have to track which
SelectorElement
matched whichEntity
, so we can convert the givenSelectorElement
into aQuery<T>
and usebevy_ecs
to keep track of changes. When someEntity
is changed, the wholeStyleSheet
will be applied, since fine grain control over will be very complex and I don't think it'll worth it at the end, since applying aStyleSheet
is cheap (even tho there are plenty of optimization left to do).StyleSheetState
now has another member, for eachAsset<StyleSheetAsset>
. The newTrackedEntities
member is populated whensystem::select_entities
in ran, that way, we don't have to traverse the entity tree twice.TODO:
Query<T>
from aSelectorElement
inside thewatch_tracked_entities
system;