1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Add shorthand for using singleton string names

This commit is contained in:
kobewi
2023-09-04 17:01:33 +02:00
parent 916ea002c1
commit a262d2d881
77 changed files with 382 additions and 380 deletions

View File

@@ -984,12 +984,12 @@ void AnimationPlayerEditor::_update_animation_list_icons() {
Ref<Texture2D> icon;
if (anim_name == player->get_autoplay()) {
if (anim_name == SceneStringNames::get_singleton()->RESET) {
if (anim_name == SceneStringName(RESET)) {
icon = autoplay_reset_icon;
} else {
icon = autoplay_icon;
}
} else if (anim_name == SceneStringNames::get_singleton()->RESET) {
} else if (anim_name == SceneStringName(RESET)) {
icon = reset_icon;
}
@@ -1459,7 +1459,7 @@ void AnimationPlayerEditor::_onion_skinning_menu(int p_option) {
onion.enabled = !onion.enabled;
if (onion.enabled) {
if (get_player() && !get_player()->has_animation(SceneStringNames::get_singleton()->RESET)) {
if (get_player() && !get_player()->has_animation(SceneStringName(RESET))) {
EditorNode::get_singleton()->show_warning(TTR("Onion skinning requires a RESET animation."));
}
_start_onion_skinning(); // It will check for RESET animation anyway.
@@ -1592,7 +1592,7 @@ void AnimationPlayerEditor::_prepare_onion_layers_1() {
return;
}
if (!onion.enabled || !is_visible() || !get_player() || !get_player()->has_animation(SceneStringNames::get_singleton()->RESET)) {
if (!onion.enabled || !is_visible() || !get_player() || !get_player()->has_animation(SceneStringName(RESET))) {
_stop_onion_skinning();
return;
}
@@ -1783,7 +1783,7 @@ void AnimationPlayerEditor::_prepare_onion_layers_2_epilog() {
}
void AnimationPlayerEditor::_start_onion_skinning() {
if (get_player() && !get_player()->has_animation(SceneStringNames::get_singleton()->RESET)) {
if (get_player() && !get_player()->has_animation(SceneStringName(RESET))) {
onion.enabled = false;
onion_toggle->set_pressed_no_signal(false);
return;