summaryrefslogtreecommitdiffstats
path: root/modules/mono/editor/bindings_generator.h
diff options
context:
space:
mode:
authorIgnacio Etcheverry <ignalfonsore@gmail.com>2019-03-27 20:01:16 +0100
committerIgnacio Etcheverry <ignalfonsore@gmail.com>2019-03-29 23:40:31 +0100
commitc8aa85189a8736bb9723770b9409e6f9c00fc249 (patch)
treeaec78e008cd5e1e3e08968434ede66b2993ee517 /modules/mono/editor/bindings_generator.h
parente45393482463ddb606bab4f2a78f4a5024cdce7a (diff)
downloadredot-engine-c8aa85189a8736bb9723770b9409e6f9c00fc249.tar.gz
EditorHelp, makerst: Improve enum ref resolving and constant ref support
Enum reference resolving will now search in the @GlobalScope if no class is specified and the enum cannot be resolved in the current class. Added support for constant references in EditorHelp, e.g.: [constant KEY_ENTER] or [constant Control.FOCUS_CLICK]. It supports enum constants (the enum name must not be included).
Diffstat (limited to 'modules/mono/editor/bindings_generator.h')
-rw-r--r--modules/mono/editor/bindings_generator.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/mono/editor/bindings_generator.h b/modules/mono/editor/bindings_generator.h
index 7eaebeabbd..42071f9c0d 100644
--- a/modules/mono/editor/bindings_generator.h
+++ b/modules/mono/editor/bindings_generator.h
@@ -497,6 +497,7 @@ class BindingsGenerator {
StringName type_Object;
StringName type_Reference;
StringName type_String;
+ StringName type_at_GlobalScope;
StringName enum_Error;
NameCache() {
@@ -509,6 +510,7 @@ class BindingsGenerator {
type_Object = StaticCString::create("Object");
type_Reference = StaticCString::create("Reference");
type_String = StaticCString::create("String");
+ type_at_GlobalScope = StaticCString::create("@GlobalScope");
enum_Error = StaticCString::create("Error");
}
@@ -527,6 +529,15 @@ class BindingsGenerator {
return NULL;
}
+ const ConstantInterface *find_constant_by_name(const String &p_name, const List<ConstantInterface> &p_constants) const {
+ for (const List<ConstantInterface>::Element *E = p_constants.front(); E; E = E->next()) {
+ if (E->get().name == p_name)
+ return &E->get();
+ }
+
+ return NULL;
+ }
+
inline String get_unique_sig(const TypeInterface &p_type) {
if (p_type.is_reference)
return "Ref";