LennardF1989 / BF2042-Portal-Extensions

Browser extensions to add additional functionality to the BF2042 Portal Rules Editor.
https://bf2042-portal-extensions.lennardf1989.com/
GNU General Public License v3.0
20 stars 11 forks source link

Using the 'Copy to Clipboard' and 'Paste from Clipboard' functions it is possible to have multiple Mod Blocks with no way of removing them #1

Closed xuvvy closed 2 years ago

xuvvy commented 2 years ago

As the title says, the extension allows the user to copy and paste the Mod block, which is the main block that determines what code is being run and there is no way of removing said mod block after pasting it, since it's not meant to ever be any other mod block other than the single default one.

Not sure what the implication is of having two or more mod blocks is, but we should at least have a way of removing it after pasting it.

LennardF1989 commented 2 years ago

Yep, I'll have to figure out something for that.

xuvvy commented 2 years ago

Running a command _Blockly.selected.dispose(false) in the browser Console will remove selected Block, including Mod Block. Perhaps you can implement this feature when right clicking a Mod Block?

Alternatively, you can make it so that it automatically removes the Mod Block on paste, since there should never, ever be two Mod Blocks and Mod Blocks cannot be removed normally anyway.

It is very useful to make copies with Mod Blocks as it can contain multiple Rule Blocks which can then be copied as a single XML Prefab, so that's why we need an optimal solution to deal with inevitable extra Mod Blocks.

LennardF1989 commented 2 years ago

Fixed, I added an option to delete a mod block if more than one is available.