Skip to content

Added variable prefix option in inspector_gadget.gd#2

Open
Ev01 wants to merge 2 commits intoLander-Godot:masterfrom
Ev01:master
Open

Added variable prefix option in inspector_gadget.gd#2
Ev01 wants to merge 2 commits intoLander-Godot:masterfrom
Ev01:master

Conversation

@Ev01
Copy link

@Ev01 Ev01 commented Jan 17, 2022

This option will only show variables with the specified prefix at the start of the variable name.
For example, say you have a file that looks like this and only want the variables that start with "exposed_" to be seen in the inspector:

# Example File
export (Array) exposed_array_var = []
export (Int) exposed_int_var = 5
export (int) var_that_should_not_be_seen = 0

Setting the prefix option to "exposed_" will make only the exposed variables shown in the inspector, and will remove the prefix from the display name. In the inspector, they will be seen as Array Var and Int Var.
This is useful for differentiating variables that should be private and variables that should be exposed in code. It's different from using blacklist because it removes the prefix from the display name and is also easier to set up with scripts that have a lot of variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant