Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor how icon TP states are created/removed: #12

Merged
merged 1 commit into from
Aug 8, 2023

Conversation

mpaperno
Copy link
Collaborator

@mpaperno mpaperno commented Aug 8, 2023

  • Smarter updates when tiling properties are changed on existing icon -- does not remove any states which will still exist in the new tiling layout (should fix Alpha - Changing Tile format Messes up States  #11);
  • Create states explicitly when icons are initially created instead of needing to check before every delivery;
  • Drop the DynamicIcons.stateCreated property and instead use a default empty tile to indicate a new icon with no corresponding State yet.

There's a bit more code involved of course to be "smart" about the tile states, but overall this motivated an optimization because it's not checking createTpIconStateIfNeeded()/stateCreated all the time anymore.

* Smarter updates When tiling properties change, does not remove any states which will still exist in the new tiling layout (fixes #11);
* Create states explicitly when icons are initially created instead of needing to check before every delivery;
* Drop the `DynamicIcons.stateCreated` property and instead use a default empty `tile` to indicate state(s) need creation;
@mpaperno mpaperno force-pushed the mp/11_tile_states branch from 41bf3a4 to 9e2cc45 Compare August 8, 2023 04:23
@spdermn02 spdermn02 merged commit df9a142 into main Aug 8, 2023
@mpaperno mpaperno deleted the mp/11_tile_states branch August 9, 2023 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alpha - Changing Tile format Messes up States
2 participants