poohcom1 / godot-private-exports

A Godot addon that lets you set access modifier for exported variables!
https://godotengine.org/asset-library/asset/2136
MIT License
22 stars 0 forks source link

Add default access modifier for all properties #9

Open Araraura opened 3 months ago

Araraura commented 3 months ago

Is it possible to add a feature that will change the default access modifier for all properties? I want to have everything private by default and simply change them to protected or public when I need them

poohcom1 commented 3 months ago

I haven't been actively using this addon in my projects, so it's unlikely that I'll have time to implement and fully test this as a feature.

But as a workaround, you can update line 43 in addons/private-exports/lib/core.gd to change the default value:

https://github.com/poohcom1/godot-private-exports/blob/48d1ed3e3803f3f3c2f310e8ce3ce5cb938450ae/addons/private-exports/lib/core.gd#L33-L43

If that doesn't work, you might also need to update this line in addons/private-exports/controls/access_modifier_button.gd: https://github.com/poohcom1/godot-private-exports/blob/48d1ed3e3803f3f3c2f310e8ce3ce5cb938450ae/addons/private-exports/controls/access_modifier_button.gd#L14

This one change should set the default modifier for all unset properties going forward, but for scenes that you've already opened, it might not work.