Add 2 misc blocks a pointer custom type with blocks to go with and add 'index' reporter to for loop#537
Conversation
also the is buffer block uses instanceof now
AndrewScripter587
left a comment
There was a problem hiding this comment.
can someone merge this
|
bump |
|
it's been 3 days |
Allows casting something like a number to different datatypes without needing to create an array buffer
|
just added a new block for casting to datatypes without needing like 5 blocks |
Pointers exist now, and also div Iterators support
|
added pointers, and Iterators support as requested by div, hooray |
|
can someone merge this now |
|
please |
add null-terminated string support and a copy pointer block
stuff
how did I let conflicting names happen
|
Its been 8 days |
|
R.I.P. |
|
Just realized I had the serializer for the pointer type commented out so projects that used buffer pointers wouldn't save :/ |
PRs often take awhile to get merged, I find. One PR I've contributed code to has been sitting waiting for a review or merge since November. Just ping the developers in the Discord. It might sound like you'd be annoying them, but otherwise nothing is gonna get done. |
Who should I ping then? |
| // Notice: the reason I don't use instanceof for checking for my custom type is because it doesn't f**king work for some reason | ||
|
|
||
| (async function(Scratch) { | ||
|
|
| emptyInputPath: "m 31 0 h 10 h 10 a 4 4 0 0 1 4 4 h 7 l -7 7 v 10 l 7 7 h -7 a 4 4 0 0 1 -4 4 h -10 h -10 h -10 h -10 a 4 4 0 0 1 -4 -4 h -7 l 7 -7 v -10 l -7 -7 h 7 a 4 4 0 0 1 4 -4 z", | ||
| emptyInputWidth: 16 * ScratchBlocks.BlockSvg.GRID_UNIT, | ||
| leftPath: (block) => { | ||
| console.log(block) |
| TYPE = Cast.toString(TYPE) | ||
| return new ArrayBufferPointerType(PTR.buffer,PTR.index,TYPE,ENDIAN) | ||
| } | ||
|
|
| } | ||
|
|
||
| isPointer({VALUE}) { | ||
| return (!!VALUE && VALUE instanceof ArrayBufferPointerType) |
There was a problem hiding this comment.
!!VALUE does nothing here
| } | ||
|
|
||
| copyPointer({PTR}) { | ||
| if (!PTR || !(PTR instanceof ArrayBufferPointerType)) return; |
There was a problem hiding this comment.
this is a reporter, it should always return something
| arr.forEach((value, index) => { | ||
| BUFFER.dataView.setUint8(index + INDEX, value) | ||
| }) | ||
|
|
| if (BUFFER == undefined && !agBuffer.disableErrorHandling) return; | ||
| if (STRING == undefined && !agBuffer.disableErrorHandling) return; |
There was a problem hiding this comment.
these can be simplified
Apply requested changes from @SharkPool-SP
|
Requested changes applied |
|
thank goodness |
also the is buffer block uses instanceof now
yay