Gandi-IDE / custom-extension

GNU Lesser General Public License v2.1
43 stars 58 forks source link

MotionPro #228

Closed bilioicik closed 3 months ago

bilioicik commented 4 months ago

test

bilioicik commented 4 months ago

Finally, I know how to pr.

bilioicik commented 4 months ago

Here are MotionPro and OperatorsPro. They have been done, but I can still improve them in some ways. And I plan to make more Pro in the future.

Arkos123 commented 4 months ago

image image 我不李姐这些积木的意义是什么() 这个下拉菜单有点让人费解,另外true/false个人认为应该做成菱形积木 image image 这些积木让人有点费解(比如作为原型,本质这些表达)很怪() image

MoreBugOfDog commented 4 months ago

Oh, no! This is the same extension I already submitted for review! @bilioicik I already submitted this extension! Gotta close this PR or it will affect the reviewer's review.

bilioicik commented 4 months ago

@Arkos123 就是注入了私有变量“移动速度”“移动方向”“转动速度”,为了表述简洁,我就写了两个字,不过这些在文档里交代清楚了。这样移动转动,省去了传参过程,对运行总是好的。

bilioicik commented 4 months ago

@Arkos123 菱形框不能塞返回值积木,除了列表“[]第()项”和“[]第一个()的编号”。这样省去了塞布尔值转返回值积木的介入。

Arkos123 commented 4 months ago

@Arkos123 菱形框不能塞返回值积木,除了列表“[]第()项”和“[]第一个()的编号”。这样省去了塞布尔值转返回值积木的介入。

但是你的true/false积木是圆形积木,塞不进菱形框啊

bilioicik commented 4 months ago

@Arkos123 表达很怪这点确实,或许“作为原型”应该换用简洁的“原型”,或者直接用空字符串表示?“作为原型”就是不转换类型。这是因为HCN跟我说老是JSON.parse对运行速度不友好,所以我加入了直接传原类型的选项。

bilioicik commented 4 months ago

@Arkos123 哦,你的“菱形积木”原来是这个意思。我以为你是说其他积木的圆形框。不过在条件的参数里塞定值本身就没有意义。这个积木主要作用是把字符串的“true”“false”这类转为真的布尔值的true、false,好push到数组对象。

bilioicik commented 4 months ago

@Arkos123 (我知道对象不能用push函数,前一句说混在一起了)反正就是帮忙更改数组对象里的元素为true、false、undefined这种特殊类型值。扩展文档里有专门提及这个积木的用途。

bilioicik commented 4 months ago

@MoreBugOfDog I know this, but I think pushing to my pr is more convenient because I still want to improve something in my extensions.

bilioicik commented 4 months ago

@MoreBugOfDog So that I don't need to disturb you again and again.

bilioicik commented 4 months ago

@sylarhcn 我新开了一个请求,关于改良过的运动Pro和运算Pro,望过审。

MoreBugOfDog commented 4 months ago

这样我就不需要一次又一次地打扰你了。 But you spelled my name wrong. Correct: 多bug的啸天犬 @ CCW Incorrect: MoreBugOfDog @ CCW

bilioicik commented 4 months ago

But you spelled my name wrong. Correct: 多bug的啸天犬 @ CCW Incorrect: MoreBugOfDog @ CCW

All right. I think English username is cooler. Actually, 凌 used FurryR in his extension.

bilioicik commented 4 months ago

@MoreBugOfDog I will change it tomorrow.

bilioicik commented 4 months ago

@MoreBugOfDog So maybe you need to close your pr. Do you want to make more changes in OperatorsPro?

fath11 commented 4 months ago

Please create your own folder and put the extensions in that folder image

fath11 commented 4 months ago

Doing this is terrible; I prefer the old version of this extension image

This will force the user to set the movement speed, etc., with another block before being able to move. There is no need to over-complicate everything

bilioicik commented 4 months ago

@fath11 The old blocks of this extension are still here. To avoid clutter, they are hidden. Press the second button then you can see them. These new blocks can be used in many different ways. If the types of their arguments are NUMBER, they will directly use the values which you put. You can also put variables'names or id there, they will find the variables you want.

bilioicik commented 4 months ago

@fath11 OK, I created my own folder just now.

fath11 commented 4 months ago

movement speed, movement direction, and rotation angle are all just variables. There is no reason to make the block palate bigger. It is cool to have togglable blocks, but why try to hide the clutter when the clutter can be removed?

bilioicik commented 4 months ago

@fath11 The old blocks are more useful for their running speed because they do not recognize types of values. So I don’t want to remove them. But the number of them is plenty big. It’s bad for editing. Users won’t feel good. So l add them together to new blocks.

bilioicik commented 4 months ago

image @fath11 Would you like this? I made blocks shorter and easy to understand.

bilioicik commented 4 months ago

image

非常不幸的是,这个积木有个小问题,我不知道怎么修复。关于它的menu参数,你需要先点击别的选项,再点回你想要的选项,才能正常使用它。menu参数确认默认值无误,且它的command版本运行一切正常,只有conditional版本存在问题。我怀疑该问题出在编辑器本身对于带有menu的conditional积木的处理上。

bilioicik commented 4 months ago

@sylarhcn @fath11 请核审

bilioicik commented 4 months ago

我解决上述问题了,不过该问题理应不会发生的,0和空字符串的本质都是false。原先menu默认值为0,现在我把它删了,相当于默认值空字符串,积木就一切运行正常了,但是command版本那边默认值为0,却无任何问题。

fath11 commented 4 months ago

image @fath11 Would you like this? I made blocks shorter and easy to understand.

The use case for variables is really small. There are other kind of variables from other extensions. Implementing and maintaining support for every single kind of variables in every extensions is impossible. Sure you can just drop the reporter of that variable into any of the blocks and it works just fine, but then you might as well use normal blocks with normal input parameters.

You need to make a compromise between minor performance increase and usableness/not making the block palette uselessly large and the extension's code uselessly complicated to maintain.

bilioicik commented 4 months ago

It’s hard for me to choose one. Well, in my opinion, it’s ok to have both. I have made several tests to make sure there’s no bug in this extension. All of the blocks can work properly and are easy to use. On one hand, it is true that we can use Scratch blocks to achieve some similar aims. On the other hand,this will let very young and new Scratchers do it easily. Don’t we have a section called “Beginners”? It is reasonable to let beginners use it. Maybe some of them like using single menu blocks, others want to have better running speed. Perhaps it’s not necessary to create some blocks, but it’s more unnecessary to remove them. I think no one among ordinary users will refuse to have more choices.

By the way, I have expected for a long time. It will make me mad to go on to change it during Grade 9 such a busy term. Of course, it’s because of my poor experience.

fath11 commented 4 months ago

How about make a button to switch between both kind of blocks instead of how it is right now. So only one kind of the blocks will appear at any one time and the rest are hidden

bilioicik commented 4 months ago

About the variable menu, if users have the same advice as yours, I will take it at once. Only the type of the argument will be changed. No problem with the value. So you don’t need to worry about the changing after it is public will cause bad influence. And you don’t need to pay attention to this before it is public.

bilioicik commented 4 months ago

I tried to make a button like that before, but it seems that there’s a bug in Gandi. “! variable”in blocks will cause ERROR.

bilioicik commented 4 months ago

I mean, the method like “hidefrompallette: ! this.hideextrablocks”.

bilioicik commented 4 months ago

“hidefrompallette: ! this.hideextrablocks” in blocks doesn’t work . Strangely, “hidefrompallette: ! this.hideextrablocks” in buttons always works.

fath11 commented 4 months ago

split the blocks into two arrays, when the button is pressed, switch which array is being given to the blocks property and refresh the block palette

bilioicik commented 4 months ago

Ok, I have done it. But in other ways.

bilioicik commented 4 months ago

@sylarhcn Please review.

bilioicik commented 3 months ago

改了后缀,正在研究怎么分开交,我前面新开了个ControlPro,但之前的内容意外出现在那儿的commits里了。

sylarhcn commented 3 months ago

改了后缀,正在研究怎么分开交,我前面新开了个ControlPro,但之前的内容意外出现在那儿的commits里了。

那我先关闭这个 pr。 你可以开多个开发分支,然后单独 pr 就可以。 最后你在合并的开发分支就行了。

bilioicik commented 3 months ago

image 21e6c4067fece829d5827bdb7416de12

用多个branch不太明白,我想应该是新创建一个branch,但情况咋跟这教程不太一样呢…

bilioicik commented 3 months ago

我打算先把其他文件删了保留一个