-
Notifications
You must be signed in to change notification settings - Fork 4k
fix costume animation in sprite library #5558
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
Merged
cwillisf
merged 5 commits into
scratchfoundation:scratch-desktop
from
cwillisf:fix-costume-animation
May 13, 2020
Merged
fix costume animation in sprite library #5558
cwillisf
merged 5 commits into
scratchfoundation:scratch-desktop
from
cwillisf:fix-costume-animation
May 13, 2020
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cwillisf
commented
Apr 2, 2020
Contributor
|
Looks like travis failed due to props validation: |
Contributor
a819197 to
230503c
Compare
0b629cf to
cf8a2e4
Compare
`getItemIcons` (formerly `getItemImageSource`) now handles the current library formats as well as upcoming library changes in which library items will no longer have a `json` property. Or, at least, it should work... As part of that effort, `getItemIcons` now handles library items with single or multiple icons internally, meaning that the caller no longer needs to do extra work to check. Likewise, the `LibraryItem` container now has just one `iconSource` property instead of an `icon` property for the one-icon case and an `icons` property for the multi-icon case. The LibraryItem component (not container) still only takes one icon, and the container is still responsible for managing icon rotation.
Contributor
Author
apple502j
reviewed
Apr 28, 2020
Co-Authored-By: apple502j <33279053+apple502j@users.noreply.github.com>
ericrosenbaum
approved these changes
Apr 29, 2020
Contributor
ericrosenbaum
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! tested in playground but not desktop
adroitwhiz
reviewed
May 3, 2020
Co-authored-by: adroitwhiz <adroitwhiz@protonmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves
Resolves a problem specific to the scratch-desktop branch in which the library icons for sprites would not correctly animate even in the presence of multiple costumes.
Proposed Changes
Two changes:
assetIdanddataFormatproperties, use those to determine the icon. Prefer that over options which require splitting on.md5extuse that (higher priority than existing code which usedmd5orbaseLayerMD5).Reason for Changes
An animated library item may now have
assetIdanddataFormatproperties. The new library generation code provides these properties and they align better to the wayscratch-storageworks.Also, a library item may now contain a property called
md5ext, which is just a renamed version of the oldmd5property. We are trying to encouragemd5extrather than justmd5to describe a property or variable which contains both the MD5 hash and the file extension, just so that the code is more self-documenting.Test Coverage
Tested by hand:
Expected: the "Bear-walking" library item shows the bear's walking animation.
Also tested: