Can You Provide a Code Block Refactoring Tool?

Wifido

  • Posts: 133
I have just spent hours moving a LOT of logic into Code Blocks inside a Actor Behavior. 

Most of that time was spent having to refactor the blocks that I had already created...which requires adding the new block, replacing the old block in the logic with the new block, then deleting the old block.

I would REALLY like to see a right click menu on the Custom Block which brings up the "Create a New Custom Block" wizard.

Except I would rename it "Custom Block Modification Editor"..

Under the hood I guess it would create a new block and attempt to replace it everywhere the old block was used.  If it could not replace it then at least highlight the area where it failed...etc...

The problem I kept running into...was that I kept forgetting to either add one of the parameters, assigning the wrong parameter type by accident, forgetting to set the return type, setting the return type incorrectly, or just simply wanting to rename the custom block.

I know this probably isn't a trivial task...would have saved me 2-3 hours easily tonight.  And in the future I am sure it would save more time as well.

Happy I can create Custom Blocks.  That's cool.
Just wanting a way to modify their name, description, block fields, block spec, and return type...WITHOUT having to create a new block...etc...

Thanks for considering...



Wifido

  • Posts: 133
Looks like your server time is off as well.  It's 1:41am CST time and the posted time on that was 11:39:45pm...FYI...

captaincomic

  • *
  • Posts: 6108
You can modify the name and description of custom blocks, right click on the block in the palette.
The parameters and return type cannot be modified though.

Wifido

  • Posts: 133
Thanks Capt.

That will certainly help.

I was adding a lot of code blocks with a lot of parameters and I kept making stupid mistakes like picking the wrong return type or having a typo in the parameter name.

Messing up the return type or parameter type was the more painful issue because i didn't find out until I was trying to code or compile.

So I just have to slow down and be more patient.  I am so used to writing C# code in Visual Studio that I've gotten a bit lazy I think.  They make it so easy to refactor little mistakes like that.

Thanks for the heads up on changing the name and description.

captaincomic

  • *
  • Posts: 6108
Yup, I know exactly what you mean, I also messed up many custom blocks in the beginning :)