summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/core_bind.cpp4
-rw-r--r--core/core_bind.h2
-rw-r--r--core/input/input.cpp4
-rw-r--r--core/input/input.h3
-rw-r--r--core/object/object.cpp13
-rw-r--r--core/object/object.h3
6 files changed, 20 insertions, 9 deletions
diff --git a/core/core_bind.cpp b/core/core_bind.cpp
index f5c69b9b98..6dbb0996eb 100644
--- a/core/core_bind.cpp
+++ b/core/core_bind.cpp
@@ -1723,8 +1723,9 @@ bool Engine::is_printing_error_messages() const {
return ::Engine::get_singleton()->is_printing_error_messages();
}
+#ifdef TOOLS_ENABLED
void Engine::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {
- String pf = p_function;
+ const String pf = p_function;
if (p_idx == 0 && (pf == "has_singleton" || pf == "get_singleton" || pf == "unregister_singleton")) {
for (const String &E : get_singleton_list()) {
r_options->push_back(E.quote());
@@ -1732,6 +1733,7 @@ void Engine::get_argument_options(const StringName &p_function, int p_idx, List<
}
Object::get_argument_options(p_function, p_idx, r_options);
}
+#endif
void Engine::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_physics_ticks_per_second", "physics_ticks_per_second"), &Engine::set_physics_ticks_per_second);
diff --git a/core/core_bind.h b/core/core_bind.h
index f884426881..7b7eb46fd9 100644
--- a/core/core_bind.h
+++ b/core/core_bind.h
@@ -528,7 +528,9 @@ public:
void set_print_error_messages(bool p_enabled);
bool is_printing_error_messages() const;
+#ifdef TOOLS_ENABLED
virtual void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const override;
+#endif
Engine() { singleton = this; }
};
diff --git a/core/input/input.cpp b/core/input/input.cpp
index 4117cc8c9c..3de0ed39ec 100644
--- a/core/input/input.cpp
+++ b/core/input/input.cpp
@@ -181,8 +181,9 @@ void Input::_bind_methods() {
ADD_SIGNAL(MethodInfo("joy_connection_changed", PropertyInfo(Variant::INT, "device"), PropertyInfo(Variant::BOOL, "connected")));
}
+#ifdef TOOLS_ENABLED
void Input::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {
- String pf = p_function;
+ const String pf = p_function;
if ((p_idx == 0 && (pf == "is_action_pressed" || pf == "action_press" || pf == "action_release" || pf == "is_action_just_pressed" || pf == "is_action_just_released" || pf == "get_action_strength" || pf == "get_action_raw_strength")) ||
(p_idx < 2 && pf == "get_axis") ||
@@ -201,6 +202,7 @@ void Input::get_argument_options(const StringName &p_function, int p_idx, List<S
}
Object::get_argument_options(p_function, p_idx, r_options);
}
+#endif
void Input::VelocityTrack::update(const Vector2 &p_delta_p, const Vector2 &p_screen_delta_p) {
uint64_t tick = OS::get_singleton()->get_ticks_usec();
diff --git a/core/input/input.h b/core/input/input.h
index 367bb93188..d1f284e8f7 100644
--- a/core/input/input.h
+++ b/core/input/input.h
@@ -270,7 +270,10 @@ protected:
public:
void set_mouse_mode(MouseMode p_mode);
MouseMode get_mouse_mode() const;
+
+#ifdef TOOLS_ENABLED
void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const override;
+#endif
static Input *get_singleton();
diff --git a/core/object/object.cpp b/core/object/object.cpp
index 5db1d2534f..5d5a721811 100644
--- a/core/object/object.cpp
+++ b/core/object/object.cpp
@@ -2086,15 +2086,17 @@ void ObjectDB::debug_objects(DebugFunc p_func) {
spin_lock.unlock();
}
+#ifdef TOOLS_ENABLED
void Object::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {
+ const String pf = p_function;
if (p_idx == 0) {
- if (p_function == "connect" || p_function == "is_connected" || p_function == "disconnect" || p_function == "emit_signal" || p_function == "has_signal") {
+ if (pf == "connect" || pf == "is_connected" || pf == "disconnect" || pf == "emit_signal" || pf == "has_signal") {
List<MethodInfo> signals;
get_signal_list(&signals);
for (const MethodInfo &E : signals) {
r_options->push_back(E.name.quote());
}
- } else if (p_function == "call" || p_function == "call_deferred" || p_function == "callv" || p_function == "has_method") {
+ } else if (pf == "call" || pf == "call_deferred" || pf == "callv" || pf == "has_method") {
List<MethodInfo> methods;
get_method_list(&methods);
for (const MethodInfo &E : methods) {
@@ -2103,7 +2105,7 @@ void Object::get_argument_options(const StringName &p_function, int p_idx, List<
}
r_options->push_back(E.name.quote());
}
- } else if (p_function == "set" || p_function == "set_deferred" || p_function == "get") {
+ } else if (pf == "set" || pf == "set_deferred" || pf == "get") {
List<PropertyInfo> properties;
get_property_list(&properties);
for (const PropertyInfo &E : properties) {
@@ -2111,13 +2113,13 @@ void Object::get_argument_options(const StringName &p_function, int p_idx, List<
r_options->push_back(E.name.quote());
}
}
- } else if (p_function == "set_meta" || p_function == "get_meta" || p_function == "has_meta" || p_function == "remove_meta") {
+ } else if (pf == "set_meta" || pf == "get_meta" || pf == "has_meta" || pf == "remove_meta") {
for (const KeyValue<StringName, Variant> &K : metadata) {
r_options->push_back(String(K.key).quote());
}
}
} else if (p_idx == 2) {
- if (p_function == "connect") {
+ if (pf == "connect") {
// Ideally, the constants should be inferred by the parameter.
// But a parameter's PropertyInfo does not store the enum they come from, so this will do for now.
List<StringName> constants;
@@ -2128,6 +2130,7 @@ void Object::get_argument_options(const StringName &p_function, int p_idx, List<
}
}
}
+#endif
SpinLock ObjectDB::spin_lock;
uint32_t ObjectDB::slot_count = 0;
diff --git a/core/object/object.h b/core/object/object.h
index a062b8aa62..f97691841f 100644
--- a/core/object/object.h
+++ b/core/object/object.h
@@ -956,8 +956,6 @@ public:
Variant::Type get_static_property_type(const StringName &p_property, bool *r_valid = nullptr) const;
Variant::Type get_static_property_type_indexed(const Vector<StringName> &p_path, bool *r_valid = nullptr) const;
- virtual void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const;
-
// Translate message (internationalization).
String tr(const StringName &p_message, const StringName &p_context = "") const;
String tr_n(const StringName &p_message, const StringName &p_message_plural, int p_n, const StringName &p_context = "") const;
@@ -969,6 +967,7 @@ public:
_FORCE_INLINE_ bool can_translate_messages() const { return _can_translate; }
#ifdef TOOLS_ENABLED
+ virtual void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const;
void editor_set_section_unfold(const String &p_section, bool p_unfolded);
bool editor_is_section_unfolded(const String &p_section);
const HashSet<String> &editor_get_section_folding() const { return editor_section_folding; }