diff options
author | George Marques <george@gmarqu.es> | 2020-11-26 11:56:32 -0300 |
---|---|---|
committer | George Marques <george@gmarqu.es> | 2020-11-26 12:05:42 -0300 |
commit | c7b6a7adcc3552fd6fd2e9061ab790798dd9830a (patch) | |
tree | f9a02dd4160842fc5344aed5141621a9e122d347 /modules/gdscript/gdscript.cpp | |
parent | 613b76cfd5b57d6fb13f856ad149f2b47ca5dcb3 (diff) | |
download | redot-engine-c7b6a7adcc3552fd6fd2e9061ab790798dd9830a.tar.gz |
GDScript: Refactor builtin functions
They are now called "utility functions" to avoid confusion with methods
of builtin types, and be consistent with the naming in Variant.
Core utility functions are now available in GDScript. The ones missing
in core are added specifically to GDScript as helpers for convenience.
Some functions were remove when there are better ways to do, reducing
redundancy and cleaning up the global scope.
Diffstat (limited to 'modules/gdscript/gdscript.cpp')
-rw-r--r-- | modules/gdscript/gdscript.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 53602f7a9b..796b0ffddd 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -1889,8 +1889,11 @@ void GDScriptLanguage::get_reserved_words(List<String> *p_words) const { w++; } - for (int i = 0; i < GDScriptFunctions::FUNC_MAX; i++) { - p_words->push_back(GDScriptFunctions::get_func_name(GDScriptFunctions::Function(i))); + List<StringName> functions; + GDScriptUtilityFunctions::get_function_list(&functions); + + for (const List<StringName>::Element *E = functions.front(); E; E = E->next()) { + p_words->push_back(String(E->get())); } } |