"Create own block" dropdown list

id: 18928

category: Suggestions

posts: 333

alexphan alexphan loading

fredfish10 wrote:

support
Reason?

For suggestion: Support, would be useful in many projects.
6th page yas
Me_Tis Me_Tis loading

Unkown333 wrote:

I KNOW HOW TO DO IT CHECK MY PROJECT
https://scratch.mit.edu/projects/83067366/\
Sorry For The Spam

banana439monkey wrote:

+1, but is work-aroundable.
The whole point of the dropdown list thing is to make it easy so there isn't much point in doing the workarounds. It should just be implemented… (please)
Ninkancho Ninkancho loading
Support. Using a string input should work fine, but it might not be as easy to figure out in a custom block made for public use.
the2000 the2000 loading
There should also be checkmark boxes for
Have all broadcast messages
Have all lists
Have all variables
(You get my point)
savaka savaka loading

PullJosh wrote:

Great idea! This was a feature that I always found BYOB (now SNAP) was lacking and needed badly. And now scratch needs it too. Support!
Me too
Me_Tis Me_Tis loading

the2000 wrote:

There should also be checkmark boxes for
Have all broadcast messages
Have all lists
Have all variables
(You get my point)
Good idea!
Rex208 Rex208 loading
Support, this could definitely be useful for blocks with multiple uses.
IgDegOo IgDegOo loading
forever
support [Me_Tis v]'s idea ::sensing
end
Me_Tis Me_Tis loading

IgDegOo wrote:

forever
support [Me_Tis v]'s idea ::sensing
end
lol

derpmeup wrote:

Support! There is a way to get hacked custom blocks, but it isn't easy.
Yes it is… It's called Notepad++, google, and basic programming knowledge xD
Me_Tis Me_Tis loading

braxbroscratcher wrote:

derpmeup wrote:

Support! There is a way to get hacked custom blocks, but it isn't easy.
Yes it is… It's called Notepad++, google, and basic programming knowledge xD
The whole point of this idea is to make it easier, (the whole point of scratch), so you should be able to do it without downloading the json file and editing it.

Me_Tis wrote:

My suggestion is simple: that when you create your own block, along with boolean, string and number input, you were allowed to do a dropdown list like this:
define move [direcion]▾
if <(direction)=[up]>
point in direction (0 v)
move (10) steps
end
if <(direction)=[down]>
point in direction (180 v)
move (10) steps
end
when green flag clicked
move [down v]:: custom

You would create it like this:
https://dl.dropboxusercontent.com/u/17754076/Scratch/Dropdown%20list.png

I would find this very useful (though admittedly my example wasn't very useful)
Any suggestions, improvements or just support?
That would be awesome! I'd do a lot of things with that!
define set color to [color] ▾
if <(color:: imput) = [white]> then
set [color v] effect to [white]:: looks
end
...
Sheep_maker Sheep_maker loading
Support, and the switch block would be handy in this case.
Support, this would make APIs easier to understand!
define (U+25BE)
alexphan alexphan loading

notgoodatprograming wrote:

TOTAL support.
Reason?

Also, I still support, because although I made a workaround here, it requires hacking the JSON of the project
I think this is too complicated. Also there is a workaround.

Why no support:
It's too complicated. How would you select what's in the dropdown? That pretty much covers the cons.

Workaround:
The workaround is quite simple.

1. Create a new project. Add some lists, and add a block with an input.

2. Add the list's name as the first item of the list. Repeat process for each list.

3. Download the project to your computer!

4. Save it as a .zip. Save as all files.

5. Extract files from the .zip. Do not delete it.

6. Open the folder. You will see a text file called project.json. It has pretty much everything. And text pops up.

7. Keep scrolling until you see the ProcDef command. It should say the custom block's name.

8. See those % things? That is the type. change it to a %m.list. It changes input type to list.

9. Don't forget to save it!

10. Transfer it to the .zip file! Delete the text file in the .zip folder, and drag text file from Extracted folder to .zip file.

11. Import the .zip file into the Scratch editor.

12. The .zip file is in Custom Files. Change file to All Files. Double click it.

13. Congratulations! You did it!

_____________

Conclusion: It works! Congratulations! Adding new list will add new to dropdown menu and deleting a list will remove it from the list.

TheLibrary-BranchC wrote:

I think this is too complicated. Also there is a workaround.

Why no support:
It's too complicated. How would you select what's in the dropdown? That pretty much covers the cons.

Workaround:
The workaround is quite simple.

1. Create a new project. Add some lists, and add a block with an input.

2. Add the list's name as the first item of the list. Repeat process for each list.

3. Download the project to your computer!

4. Save it as a .zip. Save as all files.

5. Extract files from the .zip. Do not delete it.

6. Open the folder. You will see a text file called project.json. It has pretty much everything. And text pops up.

7. Keep scrolling until you see the ProcDef command. It should say the custom block's name.

8. See those % things? That is the type. change it to a %m.list. It changes input type to list.

9. Don't forget to save it!

10. Transfer it to the .zip file! Delete the text file in the .zip folder, and drag text file from Extracted folder to .zip file.

11. Import the .zip file into the Scratch editor.

12. The .zip file is in Custom Files. Change file to All Files. Double click it.

13. Congratulations! You did it!

_____________

Conclusion: It works! Congratulations! Adding new list will add new to dropdown menu and deleting a list will remove it from the list.
Thats against the TOU, though.
alexphan alexphan loading

TheLibrary-BranchC wrote:

I think this is too complicated. Also there is a workaround.

Why no support:
It's too complicated. How would you select what's in the dropdown? That pretty much covers the cons.

How is it complicated? It's just selecting from a list of inputs. When you go into the custom block menu, you can add and delete dropdown items.
That is true, but it requires hacking the project.
You click on the dropdown on the custom block :P
Sheep_maker Sheep_maker loading
There should be a way to access the built-in dropdowns (such as the costumes or variables dropdown)
JavierR100 JavierR100 loading
Support, i need it so badly.
define add [object ▾] to inventory
if <(object ▾) = [( ͡° ͜ʖ ͡°)]> then
say [( ͡° ͜ʖ ͡°)]
else
add (object ▾) to [inventory v]
end
when gf clicked
add [lenny v] to inventory

BigBlueBlock wrote:

Me_Tis wrote:

My suggestion is simple: that when you create your own block, along with boolean, string and number input, you were allowed to do a dropdown list like this:
define move [direcion]
if <(direction)=[up]>
point in direction (0 v)
move (10) steps
end
if <(direction)=[down]>
point in direction (180 v)
move (10) steps
end
when green flag clicked
move [down v]
I would find this very useful (though admittedly my example wasn't very useful)
Any suggestions, improvements or just support?
%d They will be added in future!

TimothyLawyer wrote:

Me_Tis wrote:

TimothyLawyer wrote:

The Unicode white down-pointing small triangle (U-25BF) could be used to indicate the dropdown variable.

define move [direction ▿]
if <(direction ▿)=[up]>
point in direction (0 v)
end
if <(direction ▿)=[down]>
point in direction (180 v)
end
move (10) steps

when green flag clicked
move [up v]
move [down v]
Makes sense… the only thing is that although the input method for a dropdown input would be different it would behave pretty much like a string, so maybe it doesn't need an arrow symbol.. Although if this makes it easier to understand for beginners then I guess so…

True.

When I saw your example it helped me to think about how this could be done.

define move [direction]

gave me an expectation of

move [ ] ::custom

//or

move () ::custom

but not

move [down v] ::custom

as the block it would define.

So a new solution occurs to me.

define move [direction] ▾ 






move [down v] ::custom
ScratchBlocks doesn't support v for a drop-down menu for the define block.

So the v is Unicode black down-pointing small triangle (U+25BE).

Clicking on the in the define block (where it's white) would show a menu of lists.

Select a list and the items of the list become the options in the drop-down menu in the custom block.

A blank list item would produce a non-selectable separator line (the black bar).

A list item of the form (number) string would produce menu options like in the direction block.

Thus, each drop-down menu in a custom block would be defined by a Scratch list.

Easy-peasy

what if you want a list of list names?
Me_Tis Me_Tis loading

space_elephant wrote:

what if you want a list of list names?
You would have to declare the list of names manually as in here:
https://dl.dropboxusercontent.com/u/17754076/Scratch/Dropdown%20list.png

It can't be tied to a scratch list as then if the list changes, some items that you have suggested may become invalid if the item in the list is removed.
shd02 shd02 loading
How would having the drop-down be different from this?
define move [direction]
if <(direction)=[up]> :: control
point in direction (0 v)
move (10) steps
end
if <(direction)=[down]> :: control
point in direction (180 v)
move (10) steps
end
when green flag clicked
move [down]

The only benefit of having the drop-down would be that project creator doesn't need to remember all of the options for the string. Usually, there aren't many options and all of the options are related. I don't support because it takes some work to add this feature and it is not useful enough.
Lamby777 Lamby777 loading
You know %m.stop makes a list of stop dropdowns? Tinker with it. I don't really know about it.
No support, too specific as this:
define(custom reporter::custom)
...
I am trying to find out what a custom dropdown interface would look like.

Scratch_Mapping wrote:

No support, too specific as this:
define(custom reporter::custom)
...
Please prove it.
Support. Having to hack the Scratch Editor just to get a tasty dropdown list is a major inconvenience.
Support. People that works a lot with custom blocks (like me) think that it's a feature that Scratch needs. You need this if you're making a block like this
set lang to [French v]::custom
custom block,for example

shd02 wrote:

How would having the drop-down be different from this?
define move [direction]
if <(direction)=[up]> :: control
point in direction (0 v)
move (10) steps
end
if <(direction)=[down]> :: control
point in direction (180 v)
move (10) steps
end
when green flag clicked
move [down]

The only benefit of having the drop-down would be that project creator doesn't need to remember all of the options for the string. Usually, there aren't many options and all of the options are related. I don't support because it takes some work to add this feature and it is not useful enough.
It's just so you don't have to type the words in the block but rather just a few clicks.

It saves time.

move [up v] :: custom

move [down v] :: custom
FancyFoxy FancyFoxy loading
Support! Drop-downs would simplify things and make sure you don't accidentally misspell a word.
There is a way to use dropdowns in custom blocks. Go to this website, and go to the custom block creator.
Support! It's already possible to do this by using hacked blocks though, I think.

Failord wrote:

You can actually hack to do this, (don't ask me how) but the hack doesn't let you do anything with it. There's also the problem of filling up the dropdown, assuming they non-hack implement it. For now, reporters and strings work fien.

If we can get a good, simple way for this to be added, then you have my support.
You can do it if you want thru %m.list or whatever it is.
Garamol56 Garamol56 loading

TimothyLawyer wrote:

define move [direction ▿]
if <(direction ▿)=[up]> then
point in direction (0 v)
end
if <(direction ▿)=[down]> then
point in direction (180 v)
end
move (10) steps

when green flag clicked
move [up v]
move [down v]
Support!
LuckyLucky7 LuckyLucky7 loading
Support for the reasons above, there would also have to be a “create an option…” button if this would be added to Scratch.
Happysoul05 Happysoul05 loading
Support.
Having 1,2,3 for dropdowns seems hard for me and
If i use up,down then a spell mistake can make bugs.
Support. I think a drop down menu for when you want to make a drop-down should be a thing and you should be able to define all of the drop-downs.