Skip to content
This repository was archived by the owner on Mar 16, 2021. It is now read-only.

Add HEX #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add HEX #11

wants to merge 1 commit into from

Conversation

Sheshank-s
Copy link

Adds: #8

Note: This does not touch any of the code for the find. The find on master in @griffpatch 's repo is broken, and it is broken in this repo as well. After you merge this you can fix that.

@griffpatch
Copy link
Owner

Hey there, I love the concept of what you are trying to add, but I feel we really need it to automate the Colour sliders... I haven't looked at your changes yet, so give me a bit of time and I'll review the change, thanks.

@Sheshank-s
Copy link
Author

Okay. The change is basically a hex to scratch converter. It'll still be useful, but so far from what i've seen its impossible to automate it.

@griffpatch
Copy link
Owner

griffpatch commented Sep 24, 2019 via email

@Sheshank-s
Copy link
Author

Hmm.. how did you find this out? Also if you don't mind can you join this: https://join.slack.com/t/scratchhub/shared_invite/enQtNzU5ODI2OTY0NjQzLWMyZmEzM2I4YWM1N2U1MzEwZmMwNTQ0M2M3MGUxYWUzZWNlZDg4ODc3MDVhODFiOTk3MDNiZTNmODZmZWRjNzI It's a slack i use for communicating with scratchers about development. It would be helpful since you would get notifications

@@ -26,7 +26,7 @@ function initGUI() {
let myBlocksByProcCode = {};

// todo - get blockyly from an svg???

Copy link

Choose a reason for hiding this comment

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

Why did you change this?

Copy link
Author

Choose a reason for hiding this comment

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

it’s from my code editor

Copy link
Author

Choose a reason for hiding this comment

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

it’s from my code editor

@Sheshank-s
Copy link
Author

@griffpatch any updates?

@d-siganos
Copy link

@greenbayrules I think it would be a better idea to open this pull request on the official scratch-gui repository. By doing this, these features would be available on Offline Scratch as well. It is a must, really!

@Joeclinton1
Copy link

On my branch, I've managed to edit the project.bundle.js file, meaning I can expose any module to the window. So even if scratch removes all the js entrypoint's i can add them back.

@griffpatch
Copy link
Owner

griffpatch commented Aug 24, 2020 via email

@Joeclinton1
Copy link

Joeclinton1 commented Aug 24, 2020

@griffpatch Right now, i've exposed Runtime to the window as I need it for the what i'm working on. I also previously exposed VirtualMachine which in itself contains runtime, but also alot of other useful modules.

I should be able to expose any module by just adding "window.module_name = <reference to module>" to project.bundle.js.

@griffpatch
Copy link
Owner

griffpatch commented Aug 24, 2020 via email

@Joeclinton1
Copy link

Joeclinton1 commented Aug 24, 2020

So will that work on the Scratch website or only your own build of scratch?

It works on the regular scratch website. It's taken me some time to get it to work, but here's the solution I settled on:

  1. It uses the webrequest module to block the request for the projects.bundle.js file before the request is sent. (redirecting to my own edited file, was considered but I wanted it to be more flexible and not break if the scratch code is updated)
  2. In injectSimple.js, it requests the file separately and inserts "window.runtime = this.runtime" just after runtime is defined.
  3. It injects the modified script into the document.

I added a new background.js file for blocking the request, added more to the manifest.json file to allow the webrequest module, and added the script modifier and injector to injectSimple.js.

I'm currently working on a set of profiling tools, to make testing the performance of scratch projects easier and was going to submit a pull request once I had finished that. But I can break the pull request into parts and submit just the runtime exposing code as a separate pull request, if that works better.

@griffpatch
Copy link
Owner

griffpatch commented Aug 24, 2020 via email

@griffpatch
Copy link
Owner

griffpatch commented Aug 24, 2020 via email

@Joeclinton1
Copy link

Joeclinton1 commented Aug 24, 2020

If you don't mind splitting out the exposing part then I would be very excited to look at it.

Ok, I've moved the exposer part to a new branch and will submit a pull request very soon. This will only contain the runtime addition but adding VirtualMachine aswell is as simple as inserting
window.VM = this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants