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-114 Any key is now recognized in keypressed blocks and scripts #78

Merged
merged 1 commit into from
Jul 1, 2018

Conversation

Hyderow
Copy link
Contributor

@Hyderow Hyderow commented May 19, 2018

  • If there are other keys, the script/block will get added to all present keys
  • Otherwise a new key will be added and the script/block added to it

@Hyderow Hyderow requested a review from AntiDog May 19, 2018 16:17
if key_sprite_added:
add_normal_script_workaround = key_tuple[1] == "listenedKeys"
add_normal_block_workaround = key_tuple[1] == "keyPressedBrick"
if add_normal_block_workaround or any_key_script_exists:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if add_normal_script_workaround or any_key_script_exists:

add_normal_block_workaround = key_tuple[1] == "keyPressedBrick"
if add_normal_block_workaround or any_key_script_exists:
add_any_script = not key_tuple[0] in any_scripts_added_list
key_sprite_added = Converter._key_pressed_script_workaround_script(key_tuple[0], x_pos, y_pos,catrobat_scene, add_normal_script_workaround,add_any_script)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key_sprite_added = Converter._key_pressed_script_workaround_script(key_tuple[0], x_pos, y_pos,catrobat_scene, add_normal_script_workaround, add_any_script)

elif(key_tuple[1] == "keyPressedBrick"):
key_sprite_added = Converter._key_pressed_block_workaround_script(key_tuple[0], x_pos, y_pos,catrobat_scene)
if key_sprite_added:
add_normal_script_workaround = key_tuple[1] == "listenedKeys"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make separate variables with "speaking" names for key_tuple[1]/key_tuple[0]

* If there are other keys, the script/block will get added to all present keys
* Otherwise a new key will be added and the script/block added to it
@AntiDog AntiDog merged commit 840e396 into Catrobat:develop Jul 1, 2018
@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