diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/animation_track_editor_plugins.cpp | 36 | ||||
-rw-r--r-- | editor/animation_track_editor_plugins.h | 4 | ||||
-rw-r--r-- | editor/editor_help.cpp | 5 | ||||
-rw-r--r-- | editor/editor_node.cpp | 2 | ||||
-rw-r--r-- | editor/icons/icon_crypto_key.svg | 1 | ||||
-rw-r--r-- | editor/icons/icon_x509_certificate.svg | 1 | ||||
-rw-r--r-- | editor/node_dock.cpp | 1 |
7 files changed, 42 insertions, 8 deletions
diff --git a/editor/animation_track_editor_plugins.cpp b/editor/animation_track_editor_plugins.cpp index 226eef9c1e..3e0b644b20 100644 --- a/editor/animation_track_editor_plugins.cpp +++ b/editor/animation_track_editor_plugins.cpp @@ -337,7 +337,7 @@ AnimationTrackEditAudio::AnimationTrackEditAudio() { AudioStreamPreviewGenerator::get_singleton()->connect("preview_updated", this, "_preview_changed"); } -/// SPRITE FRAME /// +/// SPRITE FRAME / FRAME_COORDS /// int AnimationTrackEditSpriteFrame::get_key_height() const { @@ -439,14 +439,24 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in if (Object::cast_to<Sprite>(object) || Object::cast_to<Sprite3D>(object)) { - int frame = get_animation()->track_get_key_value(get_track(), p_index); - texture = object->call("get_texture"); if (!texture.is_valid()) { AnimationTrackEdit::draw_key(p_index, p_pixels_sec, p_x, p_selected, p_clip_left, p_clip_right); return; } + int hframes = object->call("get_hframes"); + int vframes = object->call("get_vframes"); + + Vector2 coords; + if (is_coords) { + coords = get_animation()->track_get_key_value(get_track(), p_index); + } else { + int frame = get_animation()->track_get_key_value(get_track(), p_index); + coords.x = frame % hframes; + coords.y = frame / hframes; + } + region.size = texture->get_size(); if (bool(object->call("is_region"))) { @@ -454,9 +464,6 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in region = Rect2(object->call("get_region_rect")); } - int hframes = object->call("get_hframes"); - int vframes = object->call("get_vframes"); - if (hframes > 1) { region.size.x /= hframes; } @@ -464,8 +471,8 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in region.size.y /= vframes; } - region.position.x += region.size.x * (frame % hframes); - region.position.y += region.size.y * (frame / hframes); + region.position.x += region.size.x * coords.x; + region.position.y += region.size.y * coords.y; } else if (Object::cast_to<AnimatedSprite>(object) || Object::cast_to<AnimatedSprite3D>(object)) { @@ -532,6 +539,11 @@ void AnimationTrackEditSpriteFrame::set_node(Object *p_object) { id = p_object->get_instance_id(); } +void AnimationTrackEditSpriteFrame::set_as_coords() { + + is_coords = true; +} + /// SUB ANIMATION /// int AnimationTrackEditSubAnim::get_key_height() const { @@ -1297,6 +1309,14 @@ AnimationTrackEdit *AnimationTrackEditDefaultPlugin::create_value_track_edit(Obj return sprite; } + if (p_property == "frame_coords" && (p_object->is_class("Sprite") || p_object->is_class("Sprite3D"))) { + + AnimationTrackEditSpriteFrame *sprite = memnew(AnimationTrackEditSpriteFrame); + sprite->set_as_coords(); + sprite->set_node(p_object); + return sprite; + } + if (p_property == "current_animation" && (p_object->is_class("AnimationPlayer"))) { AnimationTrackEditSubAnim *player = memnew(AnimationTrackEditSubAnim); diff --git a/editor/animation_track_editor_plugins.h b/editor/animation_track_editor_plugins.h index 5f0ea6196c..1013cccf72 100644 --- a/editor/animation_track_editor_plugins.h +++ b/editor/animation_track_editor_plugins.h @@ -81,6 +81,7 @@ class AnimationTrackEditSpriteFrame : public AnimationTrackEdit { GDCLASS(AnimationTrackEditSpriteFrame, AnimationTrackEdit); ObjectID id; + bool is_coords; public: virtual int get_key_height() const; @@ -89,6 +90,9 @@ public: virtual void draw_key(int p_index, float p_pixels_sec, int p_x, bool p_selected, int p_clip_left, int p_clip_right); void set_node(Object *p_object); + void set_as_coords(); + + AnimationTrackEditSpriteFrame() { is_coords = false; } }; class AnimationTrackEditSubAnim : public AnimationTrackEdit { diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 4a1e93eaad..690538f44c 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -1467,6 +1467,11 @@ void EditorHelp::_notification(int p_what) { _update_doc(); } break; + case NOTIFICATION_THEME_CHANGED: { + if (is_visible_in_tree()) { + _class_desc_resized(); + } + } break; default: break; } } diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 2c3a84857a..6e2a4810cd 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -56,6 +56,7 @@ #include "editor/editor_help.h" #include "editor/editor_properties.h" #include "editor/editor_settings.h" +#include "editor/editor_spin_slider.h" #include "editor/editor_themes.h" #include "editor/import/editor_import_collada.h" #include "editor/import/editor_scene_importer_gltf.h" @@ -3558,6 +3559,7 @@ void EditorNode::register_editor_types() { ClassDB::register_class<AnimationTrackEditPlugin>(); ClassDB::register_class<ScriptCreateDialog>(); ClassDB::register_class<EditorFeatureProfile>(); + ClassDB::register_class<EditorSpinSlider>(); // FIXME: Is this stuff obsolete, or should it be ported to new APIs? ClassDB::register_class<EditorScenePostImport>(); diff --git a/editor/icons/icon_crypto_key.svg b/editor/icons/icon_crypto_key.svg new file mode 100644 index 0000000000..45b53c815d --- /dev/null +++ b/editor/icons/icon_crypto_key.svg @@ -0,0 +1 @@ +<svg height="16" viewBox="0 0 4.233 4.233" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m2.397.34-.374.373-.375.374v.375l.188.187-1.497 1.496v.375l.374.374h.374l.187-.188.282-.092.092-.282.282-.093.093-.28.094-.28.28-.095.187-.187.187.187h.374l.375-.375.373-.373.001-.374-1.122-1.122zm.374.858a.264.264 0 1 1 .002.528.264.264 0 0 1 -.002-.528z" fill="#e0e0e0"/></svg>
\ No newline at end of file diff --git a/editor/icons/icon_x509_certificate.svg b/editor/icons/icon_x509_certificate.svg new file mode 100644 index 0000000000..e175fa3234 --- /dev/null +++ b/editor/icons/icon_x509_certificate.svg @@ -0,0 +1 @@ +<svg height="16" viewBox="0 0 4.233 4.233" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m3.967.263-3.704.001v2.646h1.427a.993.993 0 0 1 -.022-.096.993.993 0 0 1 -.012-.099.993.993 0 0 1 -.002-.07.993.993 0 0 1 .005-.1.993.993 0 0 1 .014-.097.993.993 0 0 1 .025-.096.993.993 0 0 1 .034-.093.993.993 0 0 1 .043-.09.993.993 0 0 1 .052-.085.993.993 0 0 1 .06-.079.993.993 0 0 1 .068-.072.993.993 0 0 1 .074-.066.993.993 0 0 1 .08-.057.993.993 0 0 1 .087-.05.993.993 0 0 1 .09-.04.993.993 0 0 1 .095-.031.993.993 0 0 1 .096-.022.993.993 0 0 1 .099-.012.993.993 0 0 1 .07-.003.993.993 0 0 1 .099.006.993.993 0 0 1 .098.014.993.993 0 0 1 .096.025.993.993 0 0 1 .094.034.993.993 0 0 1 .089.043.993.993 0 0 1 .084.052.993.993 0 0 1 .08.06.993.993 0 0 1 .072.068.993.993 0 0 1 .065.074.993.993 0 0 1 .058.08.993.993 0 0 1 .05.087.993.993 0 0 1 .04.09.993.993 0 0 1 .031.095.993.993 0 0 1 .022.096.993.993 0 0 1 .012.099.993.993 0 0 1 .002.07.993.993 0 0 1 -.004.1.993.993 0 0 1 -.015.097.993.993 0 0 1 -.017.068h.365z" fill="#e0e0e0"/><g fill="#ff8484"><path d="m2.116 3.175v.793l.53-.253.529.253v-.793z"/><circle cx="2.646" cy="2.645" r=".794"/></g></svg>
\ No newline at end of file diff --git a/editor/node_dock.cpp b/editor/node_dock.cpp index d6df3bd369..7ba1796600 100644 --- a/editor/node_dock.cpp +++ b/editor/node_dock.cpp @@ -129,6 +129,7 @@ NodeDock::NodeDock() { select_a_node = memnew(Label); select_a_node->set_text(TTR("Select a single node to edit its signals and groups.")); + select_a_node->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); select_a_node->set_v_size_flags(SIZE_EXPAND_FILL); select_a_node->set_valign(Label::VALIGN_CENTER); select_a_node->set_align(Label::ALIGN_CENTER); |