mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-27 04:01:24 +08:00
Rename PackedSkinResource -> SpineCustomSkinResource
This commit is contained in:
parent
aa84a4244f
commit
af08ca6882
@ -27,13 +27,13 @@
|
|||||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "PackedSpineSkinResource.h"
|
#include "SpineCustomSkinResource.h"
|
||||||
|
|
||||||
void PackedSpineSkinResource::_bind_methods() {
|
void SpineCustomSkinResource::_bind_methods() {
|
||||||
ClassDB::bind_method(D_METHOD("set_skin_name", "v"), &PackedSpineSkinResource::set_skin_name);
|
ClassDB::bind_method(D_METHOD("set_skin_name", "v"), &SpineCustomSkinResource::set_skin_name);
|
||||||
ClassDB::bind_method(D_METHOD("get_skin_name"), &PackedSpineSkinResource::get_skin_name);
|
ClassDB::bind_method(D_METHOD("get_skin_name"), &SpineCustomSkinResource::get_skin_name);
|
||||||
ClassDB::bind_method(D_METHOD("set_sub_skin_names", "v"), &PackedSpineSkinResource::set_sub_skin_names);
|
ClassDB::bind_method(D_METHOD("set_sub_skin_names", "v"), &SpineCustomSkinResource::set_sub_skin_names);
|
||||||
ClassDB::bind_method(D_METHOD("get_sub_skin_names"), &PackedSpineSkinResource::get_sub_skin_names);
|
ClassDB::bind_method(D_METHOD("get_sub_skin_names"), &SpineCustomSkinResource::get_sub_skin_names);
|
||||||
|
|
||||||
ADD_SIGNAL(MethodInfo("property_changed"));
|
ADD_SIGNAL(MethodInfo("property_changed"));
|
||||||
|
|
||||||
@ -41,21 +41,24 @@ void PackedSpineSkinResource::_bind_methods() {
|
|||||||
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "sub_skin_names"), "set_sub_skin_names", "get_sub_skin_names");
|
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "sub_skin_names"), "set_sub_skin_names", "get_sub_skin_names");
|
||||||
}
|
}
|
||||||
|
|
||||||
PackedSpineSkinResource::PackedSpineSkinResource() : skin_name("custom_skin_name") {}
|
SpineCustomSkinResource::SpineCustomSkinResource() : skin_name("custom_skin_name") {}
|
||||||
PackedSpineSkinResource::~PackedSpineSkinResource() {}
|
|
||||||
|
|
||||||
void PackedSpineSkinResource::set_skin_name(const String &v) {
|
SpineCustomSkinResource::~SpineCustomSkinResource() {}
|
||||||
|
|
||||||
|
void SpineCustomSkinResource::set_skin_name(const String &v) {
|
||||||
skin_name = v;
|
skin_name = v;
|
||||||
emit_signal("property_changed");
|
emit_signal("property_changed");
|
||||||
}
|
}
|
||||||
String PackedSpineSkinResource::get_skin_name() {
|
|
||||||
|
String SpineCustomSkinResource::get_skin_name() {
|
||||||
return skin_name;
|
return skin_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PackedSpineSkinResource::set_sub_skin_names(Array v) {
|
void SpineCustomSkinResource::set_sub_skin_names(Array v) {
|
||||||
sub_skin_names = v;
|
sub_skin_names = v;
|
||||||
emit_signal("property_changed");
|
emit_signal("property_changed");
|
||||||
}
|
}
|
||||||
Array PackedSpineSkinResource::get_sub_skin_names() {
|
|
||||||
|
Array SpineCustomSkinResource::get_sub_skin_names() {
|
||||||
return sub_skin_names;
|
return sub_skin_names;
|
||||||
}
|
}
|
||||||
@ -27,15 +27,14 @@
|
|||||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#ifndef GODOT_PACKEDSPINESKINRESOURCE_H
|
#ifndef GODOT_SPINECUSTOMSKINRESOURCE_H
|
||||||
#define GODOT_PACKEDSPINESKINRESOURCE_H
|
#define GODOT_SPINECUSTOMSKINRESOURCE_H
|
||||||
|
|
||||||
#include "core/variant_parser.h"
|
#include "core/variant_parser.h"
|
||||||
|
#include "SpineSKin.h"
|
||||||
|
|
||||||
#include "SpineSkin.h"
|
class SpineCustomSkinResource : public Resource {
|
||||||
|
GDCLASS(SpineCustomSkinResource, Resource);
|
||||||
class PackedSpineSkinResource : public Resource {
|
|
||||||
GDCLASS(PackedSpineSkinResource, Resource);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
@ -45,8 +44,8 @@ private:
|
|||||||
Array sub_skin_names;
|
Array sub_skin_names;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PackedSpineSkinResource();
|
SpineCustomSkinResource();
|
||||||
virtual ~PackedSpineSkinResource();
|
virtual ~SpineCustomSkinResource();
|
||||||
|
|
||||||
void set_skin_name(const String &v);
|
void set_skin_name(const String &v);
|
||||||
String get_skin_name();
|
String get_skin_name();
|
||||||
@ -54,5 +53,6 @@ public:
|
|||||||
void set_sub_skin_names(Array v);
|
void set_sub_skin_names(Array v);
|
||||||
Array get_sub_skin_names();
|
Array get_sub_skin_names();
|
||||||
};
|
};
|
||||||
|
#include "SpineSkin.h"
|
||||||
#endif//GODOT_PACKEDSPINESKINRESOURCE_H
|
#include "core/variant_parser.h"
|
||||||
|
#endif //GODOT_SPINECUSTOMSKINRESOURCE_H
|
||||||
@ -29,8 +29,9 @@
|
|||||||
|
|
||||||
#include "SpineSprite.h"
|
#include "SpineSprite.h"
|
||||||
|
|
||||||
#include "SpineTrackEntry.h"
|
#include "SpineCustomSkinResource.h"
|
||||||
#include "SpineEvent.h"
|
#include "SpineEvent.h"
|
||||||
|
#include "SpineTrackEntry.h"
|
||||||
|
|
||||||
void SpineSprite::_bind_methods() {
|
void SpineSprite::_bind_methods() {
|
||||||
ClassDB::bind_method(D_METHOD("set_animation_state_data_res", "animation_state_data_res"), &SpineSprite::set_animation_state_data_res);
|
ClassDB::bind_method(D_METHOD("set_animation_state_data_res", "animation_state_data_res"), &SpineSprite::set_animation_state_data_res);
|
||||||
@ -86,7 +87,7 @@ void SpineSprite::_bind_methods() {
|
|||||||
|
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "overlap"), "set_overlap", "get_overlap");
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "overlap"), "set_overlap", "get_overlap");
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "bind_slot_nodes"), "set_bind_slot_nodes", "get_bind_slot_nodes");
|
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "bind_slot_nodes"), "set_bind_slot_nodes", "get_bind_slot_nodes");
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "packed_skin_resource", PropertyHint::PROPERTY_HINT_RESOURCE_TYPE, "PackedSpineSkinResource"), "set_skin", "get_skin");
|
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "packed_skin_resource", PropertyHint::PROPERTY_HINT_RESOURCE_TYPE, "SpineCustomSkinResource"), "set_skin", "get_skin");
|
||||||
|
|
||||||
ADD_GROUP("animation", "");
|
ADD_GROUP("animation", "");
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "process_mode", PROPERTY_HINT_ENUM, "Process,Physics,Manually"), "set_process_mode", "get_process_mode");
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "process_mode", PROPERTY_HINT_ENUM, "Process,Physics,Manually"), "set_process_mode", "get_process_mode");
|
||||||
@ -646,7 +647,7 @@ void SpineSprite::set_overlap(bool v) {
|
|||||||
overlap = v;
|
overlap = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpineSprite::set_skin(Ref<PackedSpineSkinResource> v) {
|
void SpineSprite::set_skin(Ref<SpineCustomSkinResource> v) {
|
||||||
if (v != skin && skin.is_valid()) {
|
if (v != skin && skin.is_valid()) {
|
||||||
if (skin->is_connected("property_changed", this, "_on_skin_property_changed"))
|
if (skin->is_connected("property_changed", this, "_on_skin_property_changed"))
|
||||||
skin->disconnect("property_changed", this, "_on_skin_property_changed");
|
skin->disconnect("property_changed", this, "_on_skin_property_changed");
|
||||||
@ -660,7 +661,7 @@ void SpineSprite::set_skin(Ref<PackedSpineSkinResource> v) {
|
|||||||
update_runtime_skin();
|
update_runtime_skin();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ref<PackedSpineSkinResource> SpineSprite::get_skin() {
|
Ref<SpineCustomSkinResource> SpineSprite::get_skin() {
|
||||||
return skin;
|
return skin;
|
||||||
}
|
}
|
||||||
void SpineSprite::update_runtime_skin() {
|
void SpineSprite::update_runtime_skin() {
|
||||||
@ -675,7 +676,7 @@ void SpineSprite::_on_skin_property_changed() {
|
|||||||
update_runtime_skin();
|
update_runtime_skin();
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<SpineSkin> SpineSprite::gen_spine_skin_from_packed_resource(Ref<PackedSpineSkinResource> res) {
|
Ref<SpineSkin> SpineSprite::gen_spine_skin_from_packed_resource(Ref<SpineCustomSkinResource> res) {
|
||||||
if (!(animation_state.is_valid() && skeleton.is_valid()))
|
if (!(animation_state.is_valid() && skeleton.is_valid()))
|
||||||
return NULL;
|
return NULL;
|
||||||
if (!res.is_valid())
|
if (!res.is_valid())
|
||||||
|
|||||||
@ -34,11 +34,12 @@
|
|||||||
|
|
||||||
#include <scene/2d/collision_polygon_2d.h>
|
#include <scene/2d/collision_polygon_2d.h>
|
||||||
|
|
||||||
#include "SpineAnimationStateDataResource.h"
|
|
||||||
#include "SpineSkeleton.h"
|
|
||||||
#include "SpineAnimationState.h"
|
|
||||||
#include "SpineSpriteMeshInstance2D.h"
|
|
||||||
#include "PackedSpineSkinResource.h"
|
#include "PackedSpineSkinResource.h"
|
||||||
|
#include "SpineAnimationState.h"
|
||||||
|
#include "SpineAnimationStateDataResource.h"
|
||||||
|
#include "SpineCustomSkinResource.h"
|
||||||
|
#include "SpineSkeleton.h"
|
||||||
|
#include "SpineSpriteMeshInstance2D.h"
|
||||||
|
|
||||||
class SpineSprite : public Node2D, public spine::AnimationStateListenerObject {
|
class SpineSprite : public Node2D, public spine::AnimationStateListenerObject {
|
||||||
GDCLASS(SpineSprite, Node2D);
|
GDCLASS(SpineSprite, Node2D);
|
||||||
@ -75,7 +76,7 @@ private:
|
|||||||
|
|
||||||
Array bind_slot_nodes;
|
Array bind_slot_nodes;
|
||||||
bool overlap;
|
bool overlap;
|
||||||
Ref<PackedSpineSkinResource> skin;
|
Ref<SpineCustomSkinResource> skin;
|
||||||
|
|
||||||
ProcessMode process_mode;
|
ProcessMode process_mode;
|
||||||
|
|
||||||
@ -145,12 +146,12 @@ public:
|
|||||||
bool get_overlap();
|
bool get_overlap();
|
||||||
void set_overlap(bool v);
|
void set_overlap(bool v);
|
||||||
|
|
||||||
void set_skin(Ref<PackedSpineSkinResource> v);
|
void set_skin(Ref<SpineCustomSkinResource> v);
|
||||||
Ref<PackedSpineSkinResource> get_skin();
|
Ref<SpineCustomSkinResource> get_skin();
|
||||||
void _on_skin_property_changed();
|
void _on_skin_property_changed();
|
||||||
void update_runtime_skin();
|
void update_runtime_skin();
|
||||||
|
|
||||||
Ref<SpineSkin> gen_spine_skin_from_packed_resource(Ref<PackedSpineSkinResource> res);
|
Ref<SpineSkin> gen_spine_skin_from_packed_resource(Ref<SpineCustomSkinResource> res);
|
||||||
|
|
||||||
// current animation count
|
// current animation count
|
||||||
int64_t get_current_animation_count() const;
|
int64_t get_current_animation_count() const;
|
||||||
|
|||||||
@ -54,7 +54,7 @@
|
|||||||
#include "SpineTransformConstraintData.h"
|
#include "SpineTransformConstraintData.h"
|
||||||
#include "SpinePathConstraintData.h"
|
#include "SpinePathConstraintData.h"
|
||||||
#include "SpineSpriteMeshInstance2D.h"
|
#include "SpineSpriteMeshInstance2D.h"
|
||||||
#include "PackedSpineSkinResource.h"
|
#include "SpineCustomSkinResource.h"
|
||||||
#include "SpineTimeline.h"
|
#include "SpineTimeline.h"
|
||||||
#include "SpineConstant.h"
|
#include "SpineConstant.h"
|
||||||
#include "SpineCollisionShapeProxy.h"
|
#include "SpineCollisionShapeProxy.h"
|
||||||
@ -71,6 +71,7 @@ static Ref<ResourceFormatSaverSpineSkeletonJsonData> json_skeleton_saver;
|
|||||||
#include "editor/editor_export.h"
|
#include "editor/editor_export.h"
|
||||||
#include "editor/editor_node.h"
|
#include "editor/editor_node.h"
|
||||||
|
|
||||||
|
#include "SpineCustomSkinResource.h"
|
||||||
#include "SpineRuntimeEditorPlugin.h"
|
#include "SpineRuntimeEditorPlugin.h"
|
||||||
|
|
||||||
static void editor_init_callback() {
|
static void editor_init_callback() {
|
||||||
@ -115,7 +116,7 @@ void register_spine_godot_types() {
|
|||||||
ClassDB::register_class<SpinePathConstraint>();
|
ClassDB::register_class<SpinePathConstraint>();
|
||||||
ClassDB::register_class<SpineTransformConstraint>();
|
ClassDB::register_class<SpineTransformConstraint>();
|
||||||
ClassDB::register_class<SpineSpriteMeshInstance2D>();
|
ClassDB::register_class<SpineSpriteMeshInstance2D>();
|
||||||
ClassDB::register_class<PackedSpineSkinResource>();
|
ClassDB::register_class<SpineCustomSkinResource>();
|
||||||
ClassDB::register_class<SpineTimeline>();
|
ClassDB::register_class<SpineTimeline>();
|
||||||
ClassDB::register_class<SpineConstant>();
|
ClassDB::register_class<SpineConstant>();
|
||||||
ClassDB::register_class<SpineCollisionShapeProxy>();
|
ClassDB::register_class<SpineCollisionShapeProxy>();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user