fungus
fungus copied to clipboard
New Feature: Lockable flowchart
Description
Added an update to the flowchart window and editors so flowcharts can be locked, preventing editing.
What is the current behavior?
Currently, when working with flowchart prefabs and defaults, you may want the flowchart to not be editable at least not without needing to. This can also be useful for tracking what flowcharts are done and not.
Issue Number: #992
What is the new behavior?
Clicking on the padlock icon in the flowchart window (or "lock flowchart" in the flowchart inspector) will lock the flowchart. It will not keep the flowchart in the editor window, unlike locking an inspector, but will prevent the blocks, commands, metadata, and variables from being changed. However, you can still scroll through commands to view them and move through the flowchart freely. It does work by greying out the properties, however. Will edit later if needed.
In the future, the flowchart window can be adjusted to also lock on one flowchart, not changing if another is selected. However this will only be useful when multiple flowchart windows can be opened at once; a feature that seems to be missing for now.
Important Notes
- My change require modifcations or additions to documentation
- My change modifies the workflow/editing of flowcharts/blocks/commands etc.
- Possibly. Flowcharts are unlocked by default so it shouldn't change much.
So far, no breaking changes have been found and it should also merge with #996 with how I edited the code. One main issue is that users may see the padlock and think it locks the flowchart in that window when it does not; only locks editing of it. This will be addressed when multiple flowchart windows can be open, at which point an additional behaviour will be added.
Other information
Important: because I did a silly, this PR includes changes from PR #934 which contains an optional boolean to Writer Audio. When merging this branch, 934 can be deleted as this already contains it. (as usual)
Resolved a merge conflict with CommandListAdaptor after my last changes were merged. I saw this coming so it was simple.
Hi @Arylos07 I lef this message on Discord as well, but I'm leaving it here for transparency:
I've been using your lock flowchart feature ever since you PR'ed in, and I only now ran into a bug with it, where it prevents editing the flowchart itself, I mean the actual Flowchart.cs on the gameobject, it seems like it redraws itself constantly if I try to edit it EVEN if the lock is off. I went back to a version right before I added the PR and the bug is not present there. Could you please take a look at this issue sometime? Thank you
Gif added to demonstrate (as soon as I click an editable field or open the inspector window selection thing, it gets redrawn)
Can confirm the fix submitted fixes my issue! Thank you again @Arylos07