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

Spritelab set background as block #36579

Merged
merged 25 commits into from Nov 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
bda130b
everything necessary for new block
JillianK Sep 2, 2020
2ef2ed8
Merge branch 'jk-background-logic' into jk-new-background-block-sprit…
JillianK Sep 2, 2020
8168d6f
wrote tests for animation picker logic
JillianK Sep 2, 2020
a58ddcd
Merge branch 'jk-background-logic' of github.com:code-dot-org/code-do…
JillianK Sep 8, 2020
88d996c
Merge branch 'jk-background-logic' of github.com:code-dot-org/code-do…
JillianK Sep 8, 2020
58ad7e4
Merge branch 'jk-background-logic' of github.com:code-dot-org/code-do…
JillianK Sep 10, 2020
4966140
fixed tests
JillianK Sep 10, 2020
3e609af
Merge branch 'jk-background-logic' of github.com:code-dot-org/code-do…
JillianK Sep 14, 2020
c27a0f9
Merge branch 'jk-background-logic' of github.com:code-dot-org/code-do…
JillianK Sep 15, 2020
4d5ea43
Merge branch 'jk-background-logic' of github.com:code-dot-org/code-do…
JillianK Sep 16, 2020
c2493d8
updated the setBackgroundAs function
JillianK Sep 16, 2020
39ae5ad
Merge branch 'jk-background-logic' of github.com:code-dot-org/code-do…
JillianK Sep 16, 2020
9b554a8
add comment for deprecated setBackgroundImage
JillianK Sep 16, 2020
c2d901c
Merge branch 'jk-background-logic' of github.com:code-dot-org/code-do…
JillianK Sep 17, 2020
3f17a5b
fixed tests
JillianK Sep 17, 2020
6629a32
Merge branch 'jk-background-logic' of github.com:code-dot-org/code-do…
JillianK Sep 21, 2020
4557b55
Merge branch 'jk-background-logic' of github.com:code-dot-org/code-do…
JillianK Sep 21, 2020
d02a24d
Merge branch 'jk-background-logic' of github.com:code-dot-org/code-do…
JillianK Sep 23, 2020
22597b7
Merge branch 'jk-background-logic' of github.com:code-dot-org/code-do…
JillianK Sep 23, 2020
a2dd228
Merge branch 'jk-background-logic' of github.com:code-dot-org/code-do…
JillianK Sep 24, 2020
5c7eeea
resolve conflicts
JillianK Oct 28, 2020
767bc23
done except for the actual upload of the manifest (spriteCostumeLibra…
JillianK Nov 2, 2020
ef4618a
should be final cleanup
JillianK Nov 3, 2020
7ebfdff
made no results found translatable
JillianK Nov 3, 2020
a278258
Merge branch 'staging' of github.com:code-dot-org/code-dot-org into j…
JillianK Nov 4, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/i18n/common/en_us.json
Expand Up @@ -75,6 +75,7 @@
"animationPicker_drawYourOwn": "Draw your own",
"animationPicker_error": "Error: {message}",
"animationPicker_failedToParseImage": "The image could not be parsed",
"animationPicker_noResultsFound": "Sorry, no results found.",
"animationPicker_title": "Animation Library",
"animationPicker_unsupportedType": "Sorry, this file type is not supported.",
"animationPicker_unsupportedSize": "Please make sure the image you are trying to upload is smaller than 100 KB.",
Expand Down
2 changes: 1 addition & 1 deletion apps/src/p5lab/AnimationPicker/AnimationPickerBody.jsx
Expand Up @@ -238,7 +238,7 @@ export default class AnimationPickerBody extends React.Component {
{(searchQuery !== '' || categoryQuery !== '') &&
results.length === 0 && (
<div style={animationPickerStyles.emptyResults}>
Sorry, no results found.
{msg.animationPicker_noResultsFound()}
</div>
)}
{((searchQuery === '' && categoryQuery === '') ||
Expand Down
3 changes: 3 additions & 0 deletions apps/src/p5lab/spritelab/commands.js
Expand Up @@ -242,6 +242,9 @@ export const commands = {
setBackgroundImage(img) {
JillianK marked this conversation as resolved.
Show resolved Hide resolved
worldCommands.setBackgroundImage.apply(this, [img]);
},
setBackgroundImageAs(img) {
worldCommands.setBackgroundImageAs.apply(this, [img]);
},
showTitleScreen(title, subtitle) {
worldCommands.showTitleScreen(title, subtitle);
},
Expand Down
11 changes: 11 additions & 0 deletions apps/src/p5lab/spritelab/commands/worldCommands.js
Expand Up @@ -29,13 +29,24 @@ export const commands = {
coreLibrary.background = color;
},

// Deprecated. The new background block is setBackgroundImageAs
setBackgroundImage(img) {
if (this._preloadedBackgrounds && this._preloadedBackgrounds[img]) {
let backgroundImage = this._preloadedBackgrounds[img];
coreLibrary.background = backgroundImage;
}
},

setBackgroundImageAs(img) {
if (
this._predefinedSpriteAnimations &&
this._predefinedSpriteAnimations[img]
) {
let backgroundImage = this._predefinedSpriteAnimations[img];
coreLibrary.background = backgroundImage;
}
},

setQuestion(questionText, variableName, setterCallback) {
coreLibrary.registerQuestion(questionText, variableName, setterCallback);
getStore().dispatch(addQuestion(questionText, variableName));
Expand Down