Sorry, we don't support your browser.  Install a modern browser
This post is closed.

Add feature/script to prevent accidental deleting of certain objects#520

Would be a QoL improvement on some boards to be able to delete some objects by multiple selecting & pressing del, but having certain objects protected against it via tag or script… so I mean something along the lines of:
self.interactable = false
this makes the object unclickable and ‘un-ALT-able’, but this version I suggest would be an alternative to prevent deleting - WHILE keeping the object interactable and unlocked.
I know there’s a workaround with onDestroy ... clone or getJSON ...
but that can cause other issues if the object is placed on a bag, for example (infinite clone loop, etc). Also undo (ctrl+z) on a board with 200+ objects might be a big issue, slow or even crash the game…

So this simple script/feature would allow more agency and a little bit of ‘poka yoke’ to the mod authors out there, protecting important objects that shouldnt be deleted.

TL;DR: please add self.deletable = false (or some other word that fits the concept)
Thanks.

5 years ago

Some visual bugs may be fixed only by clone & delete.
For example, white cards.

5 years ago

I’ve had those white cards happen on my modded board’s script, not sure how to prevent them script-wise, i just delete them, it works..
I’m not sure what you’re saying, that because there are visual bugs only fixed by clone & delete, therefore a script to selectively protect against deletion is not viable? Sorry if I misunderstood what you meant.

5 years ago
Changed the status to
In Progress
5 years ago
2

I’ve marked this as in progress, however there’s a few ways this could be addressed. To clarify, the plan is to resolve this via an event.

An event will fire when someone tries to delete an object (or multiple objects at once), and you’ll be able to prevent that by returning false from your event handler.

5 years ago

Thanks for this reply! I haven’t tried using events like that for specific objects, but will be glad to learn how to :) Cheers!

5 years ago
Changed the status to
Completed
5 years ago