mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[godot] Fixes for latest Godot 4.0, closes #2133, fix setters.
This commit is contained in:
parent
ffe4ad8538
commit
62f0c6deca
@ -12,9 +12,9 @@ config_version=5
|
|||||||
|
|
||||||
config/name="spine-godot-examples"
|
config/name="spine-godot-examples"
|
||||||
run/main_scene="res://examples/08-animation-player/animation-player.tscn"
|
run/main_scene="res://examples/08-animation-player/animation-player.tscn"
|
||||||
|
config/features=PackedStringArray("4.0")
|
||||||
run/low_processor_mode=true
|
run/low_processor_mode=true
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.png"
|
||||||
config/features=PackedStringArray("4.0")
|
|
||||||
|
|
||||||
[global]
|
[global]
|
||||||
|
|
||||||
|
|||||||
@ -487,7 +487,7 @@ float SpineAnimationTrack::get_alpha() {
|
|||||||
return alpha;
|
return alpha;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpineAnimationTrack::set_attachment_threshold(bool _attachment_threshold) {
|
void SpineAnimationTrack::set_attachment_threshold(float _attachment_threshold) {
|
||||||
attachment_threshold = _attachment_threshold;
|
attachment_threshold = _attachment_threshold;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -495,7 +495,7 @@ float SpineAnimationTrack::get_attachment_threshold() {
|
|||||||
return attachment_threshold;
|
return attachment_threshold;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpineAnimationTrack::set_draw_order_threshold(bool _draw_order_threshold) {
|
void SpineAnimationTrack::set_draw_order_threshold(float _draw_order_threshold) {
|
||||||
draw_order_threshold = _draw_order_threshold;
|
draw_order_threshold = _draw_order_threshold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -113,11 +113,11 @@ public:
|
|||||||
|
|
||||||
float get_alpha();
|
float get_alpha();
|
||||||
|
|
||||||
void set_attachment_threshold(bool _attachment_threshold);
|
void set_attachment_threshold(float _attachment_threshold);
|
||||||
|
|
||||||
float get_attachment_threshold();
|
float get_attachment_threshold();
|
||||||
|
|
||||||
void set_draw_order_threshold(bool _draw_order_threshold);
|
void set_draw_order_threshold(float _draw_order_threshold);
|
||||||
|
|
||||||
float get_draw_order_threshold();
|
float get_draw_order_threshold();
|
||||||
|
|
||||||
|
|||||||
@ -254,7 +254,11 @@ bool SpineAtlasResourceFormatLoader::handles_type(const String &type) const {
|
|||||||
return type == "SpineAtlasResource" || ClassDB::is_parent_class(type, "SpineAtlasResource");
|
return type == "SpineAtlasResource" || ClassDB::is_parent_class(type, "SpineAtlasResource");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if VERSION_MAJOR > 3
|
||||||
|
Error SpineAtlasResourceFormatSaver::save(const RES &resource, const String &path, uint32_t flags) {
|
||||||
|
#else
|
||||||
Error SpineAtlasResourceFormatSaver::save(const String &path, const RES &resource, uint32_t flags) {
|
Error SpineAtlasResourceFormatSaver::save(const String &path, const RES &resource, uint32_t flags) {
|
||||||
|
#endif
|
||||||
Ref<SpineAtlasResource> res = resource;
|
Ref<SpineAtlasResource> res = resource;
|
||||||
return res->save_to_file(path);
|
return res->save_to_file(path);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -97,7 +97,11 @@ class SpineAtlasResourceFormatSaver : public ResourceFormatSaver {
|
|||||||
GDCLASS(SpineAtlasResourceFormatSaver, ResourceFormatSaver)
|
GDCLASS(SpineAtlasResourceFormatSaver, ResourceFormatSaver)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
#if VERSION_MAJOR > 3
|
||||||
|
Error save(const RES &resource, const String &path, uint32_t flags) override;
|
||||||
|
#else
|
||||||
Error save(const String &path, const RES &resource, uint32_t flags) override;
|
Error save(const String &path, const RES &resource, uint32_t flags) override;
|
||||||
|
#endif
|
||||||
|
|
||||||
void get_recognized_extensions(const RES &resource, List<String> *extensions) const override;
|
void get_recognized_extensions(const RES &resource, List<String> *extensions) const override;
|
||||||
|
|
||||||
|
|||||||
@ -42,7 +42,11 @@ Error SpineAtlasResourceImportPlugin::import(const String &source_file, const St
|
|||||||
atlas->load_from_atlas_file(source_file);
|
atlas->load_from_atlas_file(source_file);
|
||||||
|
|
||||||
String file_name = vformat("%s.%s", save_path, get_save_extension());
|
String file_name = vformat("%s.%s", save_path, get_save_extension());
|
||||||
|
#if VERSION_MAJOR > 3
|
||||||
|
auto error = ResourceSaver::save(atlas, file_name);
|
||||||
|
#else
|
||||||
auto error = ResourceSaver::save(file_name, atlas);
|
auto error = ResourceSaver::save(file_name, atlas);
|
||||||
|
#endif
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,7 +74,11 @@ Error SpineJsonResourceImportPlugin::import(const String &source_file, const Str
|
|||||||
skeleton_file_res->load_from_file(source_file);
|
skeleton_file_res->load_from_file(source_file);
|
||||||
|
|
||||||
String file_name = vformat("%s.%s", save_path, get_save_extension());
|
String file_name = vformat("%s.%s", save_path, get_save_extension());
|
||||||
|
#if VERSION_MAJOR > 3
|
||||||
|
auto error = ResourceSaver::save(skeleton_file_res, file_name);
|
||||||
|
#else
|
||||||
auto error = ResourceSaver::save(file_name, skeleton_file_res);
|
auto error = ResourceSaver::save(file_name, skeleton_file_res);
|
||||||
|
#endif
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,7 +91,11 @@ Error SpineBinaryResourceImportPlugin::import(const String &source_file, const S
|
|||||||
skeleton_file_res->load_from_file(source_file);
|
skeleton_file_res->load_from_file(source_file);
|
||||||
|
|
||||||
String file_name = vformat("%s.%s", save_path, get_save_extension());
|
String file_name = vformat("%s.%s", save_path, get_save_extension());
|
||||||
|
#if VERSION_MAJOR > 3
|
||||||
|
auto error = ResourceSaver::save(skeleton_file_res, file_name);
|
||||||
|
#else
|
||||||
auto error = ResourceSaver::save(file_name, skeleton_file_res);
|
auto error = ResourceSaver::save(file_name, skeleton_file_res);
|
||||||
|
#endif
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,7 +217,7 @@ void SpineEditorPropertyAnimationMixes::update_property() {
|
|||||||
hbox->add_child(delete_button);
|
hbox->add_child(delete_button);
|
||||||
delete_button->set_text("Remove");
|
delete_button->set_text("Remove");
|
||||||
#if VERSION_MAJOR > 3
|
#if VERSION_MAJOR > 3
|
||||||
delete_button->connect("pressed", callable_mp(this, &SpineEditorPropertyAnimationMixes::delete_mix), varray(i));
|
delete_button->connect("pressed", callable_mp(this, &SpineEditorPropertyAnimationMixes::delete_mix), i);
|
||||||
#else
|
#else
|
||||||
delete_button->connect("pressed", this, "delete_mix", varray(i));
|
delete_button->connect("pressed", this, "delete_mix", varray(i));
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -94,7 +94,11 @@ bool SpineSkeletonFileResourceFormatLoader::handles_type(const String &type) con
|
|||||||
return type == "SpineSkeletonFileResource" || ClassDB::is_parent_class(type, "SpineSkeletonFileResource");
|
return type == "SpineSkeletonFileResource" || ClassDB::is_parent_class(type, "SpineSkeletonFileResource");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if VERSION_MAJOR > 3
|
||||||
|
Error SpineSkeletonFileResourceFormatSaver::save(const RES &resource, const String &path, uint32_t flags) {
|
||||||
|
#else
|
||||||
Error SpineSkeletonFileResourceFormatSaver::save(const String &path, const RES &resource, uint32_t flags) {
|
Error SpineSkeletonFileResourceFormatSaver::save(const String &path, const RES &resource, uint32_t flags) {
|
||||||
|
#endif
|
||||||
Ref<SpineSkeletonFileResource> res = resource;
|
Ref<SpineSkeletonFileResource> res = resource;
|
||||||
Error error = res->save_to_file(path);
|
Error error = res->save_to_file(path);
|
||||||
return error;
|
return error;
|
||||||
|
|||||||
@ -75,7 +75,11 @@ class SpineSkeletonFileResourceFormatSaver : public ResourceFormatSaver {
|
|||||||
GDCLASS(SpineSkeletonFileResourceFormatSaver, ResourceFormatSaver);
|
GDCLASS(SpineSkeletonFileResourceFormatSaver, ResourceFormatSaver);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
#if VERSION_MAJOR > 3
|
||||||
|
Error save(const RES &resource, const String &path, uint32_t flags) override;
|
||||||
|
#else
|
||||||
Error save(const String &path, const RES &resource, uint32_t flags) override;
|
Error save(const String &path, const RES &resource, uint32_t flags) override;
|
||||||
|
#endif
|
||||||
|
|
||||||
void get_recognized_extensions(const RES &resource, List<String> *p_extensions) const override;
|
void get_recognized_extensions(const RES &resource, List<String> *p_extensions) const override;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user