|
@@ -32,6 +32,10 @@
|
|
|
#include "core/core_string_names.h"
|
|
|
#include "scene/scene_string_names.h"
|
|
|
|
|
|
+#ifdef TOOLS_ENABLED
|
|
|
+#include "editor/editor_settings.h"
|
|
|
+#endif
|
|
|
+
|
|
|
Color SpriteBase3D::_get_color_accum() {
|
|
|
if (!color_dirty) {
|
|
|
return color_accum;
|
|
@@ -1176,6 +1180,23 @@ String AnimatedSprite3D::get_configuration_warning() const {
|
|
|
return warning;
|
|
|
}
|
|
|
|
|
|
+void AnimatedSprite3D::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {
|
|
|
+#ifdef TOOLS_ENABLED
|
|
|
+ const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\"";
|
|
|
+#else
|
|
|
+ const String quote_style = "\"";
|
|
|
+#endif
|
|
|
+
|
|
|
+ if (p_idx == 0 && p_function == "play" && frames.is_valid()) {
|
|
|
+ List<StringName> al;
|
|
|
+ frames->get_animation_list(&al);
|
|
|
+ for (List<StringName>::Element *E = al.front(); E; E = E->next()) {
|
|
|
+ r_options->push_back(quote_style + String(E->get()) + quote_style);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Node::get_argument_options(p_function, p_idx, r_options);
|
|
|
+}
|
|
|
+
|
|
|
void AnimatedSprite3D::_bind_methods() {
|
|
|
ClassDB::bind_method(D_METHOD("set_sprite_frames", "sprite_frames"), &AnimatedSprite3D::set_sprite_frames);
|
|
|
ClassDB::bind_method(D_METHOD("get_sprite_frames"), &AnimatedSprite3D::get_sprite_frames);
|