mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
Enable autoload in editor
- Tool scripts will be executed and can be accessed by plugins. - Other script languages can implement add/remove_named_global_constant to make use of this functionality.
This commit is contained in:
parent
613a8bee41
commit
decf178033
10 changed files with 330 additions and 101 deletions
|
@ -1333,6 +1333,15 @@ void GDScriptLanguage::add_global_constant(const StringName &p_variable, const V
|
|||
_add_global(p_variable, p_value);
|
||||
}
|
||||
|
||||
void GDScriptLanguage::add_named_global_constant(const StringName &p_name, const Variant &p_value) {
|
||||
named_globals[p_name] = p_value;
|
||||
}
|
||||
|
||||
void GDScriptLanguage::remove_named_global_constant(const StringName &p_name) {
|
||||
ERR_FAIL_COND(!named_globals.has(p_name));
|
||||
named_globals.erase(p_name);
|
||||
}
|
||||
|
||||
void GDScriptLanguage::init() {
|
||||
|
||||
//populate global constants
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue