From d395657ee1c9379933fc9fe1ea1dde124d2ab7d2 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 17 Mar 2024 14:15:52 +0100 Subject: [PATCH] Now CharacterSkeleton2D inherits from YSort. It disables sorting by default, so the default behaviour won't change. --- .../entity_spell_system/doc_classes/CharacterSkeleton2D.xml | 2 +- .../entity_spell_system/skeleton/character_skeleton_2d.cpp | 2 ++ .../entity_spell_system/skeleton/character_skeleton_2d.h | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/entity_spell_system/doc_classes/CharacterSkeleton2D.xml b/modules/entity_spell_system/doc_classes/CharacterSkeleton2D.xml index fbf9902ac..84515651c 100644 --- a/modules/entity_spell_system/doc_classes/CharacterSkeleton2D.xml +++ b/modules/entity_spell_system/doc_classes/CharacterSkeleton2D.xml @@ -1,5 +1,5 @@ - + diff --git a/modules/entity_spell_system/skeleton/character_skeleton_2d.cpp b/modules/entity_spell_system/skeleton/character_skeleton_2d.cpp index 16ebdcfad..3fdebbbfc 100644 --- a/modules/entity_spell_system/skeleton/character_skeleton_2d.cpp +++ b/modules/entity_spell_system/skeleton/character_skeleton_2d.cpp @@ -454,6 +454,8 @@ Array CharacterSkeleton2D::bake_mesh_array_uv(Array arr, Ref tex, float } CharacterSkeleton2D::CharacterSkeleton2D() { + set_sort_enabled(false); + _model_dirty = false; _model_index = 0; _entity_type = 0; diff --git a/modules/entity_spell_system/skeleton/character_skeleton_2d.h b/modules/entity_spell_system/skeleton/character_skeleton_2d.h index 8aa7f15c5..313233f78 100644 --- a/modules/entity_spell_system/skeleton/character_skeleton_2d.h +++ b/modules/entity_spell_system/skeleton/character_skeleton_2d.h @@ -36,7 +36,7 @@ #include "core/string/node_path.h" #include "core/string/ustring.h" -#include "scene/main/node_2d.h" +#include "scene/2d/y_sort.h" #include "scene/main/node.h" @@ -54,8 +54,8 @@ class ModelVisual; -class CharacterSkeleton2D : public Node2D { - GDCLASS(CharacterSkeleton2D, Node2D); +class CharacterSkeleton2D : public YSort { + GDCLASS(CharacterSkeleton2D, YSort); public: int get_entity_type() const;