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

[STCC-123] - Add key sprites correctly #59

Merged
merged 1 commit into from
Feb 17, 2018

Conversation

Hyderow
Copy link
Contributor

@Hyderow Hyderow commented Feb 16, 2018

No description provided.

@Hyderow Hyderow changed the base branch from master to develop February 16, 2018 12:49
@cfkh cfkh self-requested a review February 16, 2018 14:17
@cfkh
Copy link
Contributor

cfkh commented Feb 16, 2018

If you have a Scratch program like:
In Sprite 1:
[[62, 77, [["whenKeyPressed", "space"], ["say:", "Hello!"]]],
[67, 175, [["whenKeyPressed", "a"], ["say:", "Hello!"]]],
[66, 282, [["whenGreenFlag"], ["doIf", ["keyPressed:", "space"], [["think:", "Hmm..."]]]]]]

Only on of the two workarounds for the space key will be added, namely the script workaround for whenKeyPressed.
This is because you delete entries with key "space" from the dictionary.
Then space_exists is set and in Line: 743 to 746 only one case would hold.
This was wrong before, but please fix this.

Another error with this program is that the workaround for 'a' still doesn't get added beacuse the method gets an incomplete dictionary as a parameter.
Replace line 631 in scratch.py by: self.listened_keys.update(listened_keys)
This will probably do the trick.

* Only add sprites to the scene once.
* Correctly add all keys to listened_keys
* Fix workaround for space key
@Hyderow Hyderow changed the title [STCC-123] - Fix keys not being added when spacebar present [STCC-123] - Add key sprites correctly Feb 17, 2018
@Hyderow
Copy link
Contributor Author

Hyderow commented Feb 17, 2018

Ok, the mentioned issues should also be fixed now. I now also check if a keysprite already exists and insert the workaround script into this sprite.

@cfkh
Copy link
Contributor

cfkh commented Feb 17, 2018

Looks good to me.

@cfkh cfkh merged commit 5d4db5c into Catrobat:develop Feb 17, 2018
cfkh added a commit that referenced this pull request Mar 10, 2018
* [STCC-123] - Fix key sprites not being added correctly (#59)

* Only add sprites to the scene once.
* Correctly add all keys to listened_keys
* Fix workaround for space key

* STCC-128 Deleted Uservariables are now created by the converter (#62)

* STCC-129 Conversion now allows floats as hight&width errormessage fixed (#64)

* STCC-122 blocks setting missing looks are now replaced by notebricks (#65)

* [STCC-121] - Fix conversion of PointToBrick (#60)

* Add register handler for PointToBrick
* Add workaround for mouse cursor
* Fix GoTo Brick spinner values (Fixes STCC-132)

* STCC-120: Update Class Hierarchy Excerpt (#67)

*  TESTFIX: Change spinnerSelection values in tests  (#68)

* STCC-120: Update Class Hierarchy Excerpt

* TESTFIX: Change spinnerSelection values in tests
cfkh pushed a commit that referenced this pull request Mar 10, 2018
* Only add sprites to the scene once.
* Correctly add all keys to listened_keys
* Fix workaround for space key
AntiDog pushed a commit to AntiDog/ScratchToCatrobat that referenced this pull request Mar 19, 2018
* Only add sprites to the scene once.
* Correctly add all keys to listened_keys
* Fix workaround for space key
@AntiDog AntiDog mentioned this pull request Feb 25, 2019
AntiDog added a commit that referenced this pull request Feb 25, 2019
Scratch 3.0 Integration

Since Scratch 2.0 the converter is no longer working. With these changes the converter should be working again.

Changes:

Scratch 3.0 Integration, Bug fixes, Media converter fixes:

[STCC-123] - Fix key sprites not being added correctly (#59)
STCC-128 Deleted Uservariables are now created by the converter (#62)
STCC-129 Conversion now allows floats as hight&width errormessage fixes (#64)
STCC-122 blocks setting missing looks are now replaced by notebricks (#65)
[STCC-121] - Fix conversion of PointToBrick (#60)
STCC-120: Update Class Hierarchy Excerpt (#67)
TESTFIX: Change spinnerSelection values in tests (#68)
STCC-141 Broadcast message can be a number which causes an exception
Merge pull request #73 from AntiDog/STCC-141
STCC-144 Fixed only keys of one sprite being added. (#75)
STCC-136 PNG files now get scaled (#74)
STCC-143 Unknown fonts get replaced, fonts now get scaled (#76)
STCC-145 Support mouse cursor for distanceTo block (#77)
PNGs get now moved by rotation center, some remove of dead code, SVG Texts now onscreen (#80)
new class hierachy excerpt and empty images no longer crash catroid (1px gets set) (#81)
STCC-151 Implement parser for Scratch3 files (#82)
STCC-148 Rework pseudo mouse (#79)
STCC-114 Any key is now recognized in keypressed blocks and scripts (#78)
STCC-146 Execute keyPressed scripts repeatedly if key is held down (#83)
STCC-164 Basic unittests for Scratch3 look blocks (#84)
STCC-174 Insert correct default values for user blocks (#87)
STCC-170 Refactor methods in Scratch3 parser to be more readable (#85)
Use alternative scratch3 sprite attribute to read look filenames (#89)
STCC-173 Add more logging to Scratch3 parser (#86)
STCC-172 tspans in svg cause errors (#88)
dbg (#91) - (Debug.py for debugging purposes)
[STCC-169] basic sound block testcases (#90)
[STCC-168] Add unit tests for sensor blocks (#92)
[STCC-162] Basic testcases for data blocks (#93)
[STCC-163] Add tests for control blocks (#94)
[STCC-165] Add motion block testcases (#95)
[STCC-166] Add unit tests for operator blocks (#96)
[STCC-178] - Integrate Scratch3 into converter (#97)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants