mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 19:42:43 +00:00
Merge pull request #99277 from HolonProduction/why-remove-this-in-the-first-place
Add back `AnimationPlayer.get_argument_options`
This commit is contained in:
commit
46d83fd149
@ -1,3 +1,16 @@
|
||||
[gd_scene load_steps=1 format=3 uid="uid://dl28pdkxcjvym"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_d1pub"]
|
||||
resource_name = "bounce"
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_gs7mj"]
|
||||
_data = {
|
||||
"bounce": SubResource("Animation_d1pub")
|
||||
}
|
||||
|
||||
[node name="GetNode" type="Node"]
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_gs7mj")
|
||||
}
|
||||
|
@ -0,0 +1,6 @@
|
||||
[input]
|
||||
scene="res://completion/argument_options/argument_options.tscn"
|
||||
[output]
|
||||
include=[
|
||||
{"display": "\"bounce\""},
|
||||
]
|
@ -0,0 +1,5 @@
|
||||
@onready var anim := $AnimationPlayer
|
||||
|
||||
func test():
|
||||
anim.play(➡)
|
||||
pass
|
@ -0,0 +1,6 @@
|
||||
[input]
|
||||
scene="res://completion/argument_options/argument_options.tscn"
|
||||
[output]
|
||||
include=[
|
||||
{"display": "\"bounce\""},
|
||||
]
|
@ -0,0 +1,5 @@
|
||||
@onready var anim: AnimationPlayer = $AnimationPlayer
|
||||
|
||||
func test():
|
||||
anim.play(➡)
|
||||
pass
|
@ -0,0 +1,6 @@
|
||||
[input]
|
||||
scene="res://completion/argument_options/argument_options.tscn"
|
||||
[output]
|
||||
include=[
|
||||
{"display": "\"bounce\""},
|
||||
]
|
@ -0,0 +1,5 @@
|
||||
@onready var anim = $AnimationPlayer
|
||||
|
||||
func test():
|
||||
anim.play(➡)
|
||||
pass
|
@ -876,6 +876,20 @@ Tween::EaseType AnimationPlayer::get_auto_capture_ease_type() const {
|
||||
return auto_capture_ease_type;
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
void AnimationPlayer::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {
|
||||
const String pf = p_function;
|
||||
if (p_idx == 0 && (pf == "play" || pf == "play_backwards" || pf == "has_animation" || pf == "queue")) {
|
||||
List<StringName> al;
|
||||
get_animation_list(&al);
|
||||
for (const StringName &name : al) {
|
||||
r_options->push_back(String(name).quote());
|
||||
}
|
||||
}
|
||||
AnimationMixer::get_argument_options(p_function, p_idx, r_options);
|
||||
}
|
||||
#endif
|
||||
|
||||
void AnimationPlayer::_animation_removed(const StringName &p_name, const StringName &p_library) {
|
||||
AnimationMixer::_animation_removed(p_name, p_library);
|
||||
|
||||
|
@ -178,6 +178,10 @@ public:
|
||||
void set_auto_capture_ease_type(Tween::EaseType p_auto_capture_ease_type);
|
||||
Tween::EaseType get_auto_capture_ease_type() const;
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const override;
|
||||
#endif
|
||||
|
||||
void play(const StringName &p_name = StringName(), double p_custom_blend = -1, float p_custom_scale = 1.0, bool p_from_end = false);
|
||||
void play_section_with_markers(const StringName &p_name = StringName(), const StringName &p_start_marker = StringName(), const StringName &p_end_marker = StringName(), double p_custom_blend = -1, float p_custom_scale = 1.0, bool p_from_end = false);
|
||||
void play_section(const StringName &p_name = StringName(), double p_start_time = -1, double p_end_time = -1, double p_custom_blend = -1, float p_custom_scale = 1.0, bool p_from_end = false);
|
||||
|
Loading…
Reference in New Issue
Block a user