mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 22:34:53 +08:00
[godot| Animation mixes editor property beginnings.
This commit is contained in:
parent
f5fba4ec05
commit
935c7b463b
@ -86,8 +86,9 @@ bool SpineEditorPlugin::handles(Object *object) const {
|
||||
return object->is_class("SpineSprite") || object->is_class("SpineSkeletonDataResource");
|
||||
}
|
||||
|
||||
SpineAnimationMixesInspectorPlugin::SpineAnimationMixesInspectorPlugin() {
|
||||
|
||||
SpineAnimationMixesInspectorPlugin::SpineAnimationMixesInspectorPlugin(): add_mix_button(nullptr) {
|
||||
add_mix_button = memnew(Button);
|
||||
add_mix_button->set_text("Add mix");
|
||||
}
|
||||
|
||||
SpineAnimationMixesInspectorPlugin::~SpineAnimationMixesInspectorPlugin() {
|
||||
@ -99,23 +100,16 @@ bool SpineAnimationMixesInspectorPlugin::can_handle(Object *object) {
|
||||
}
|
||||
|
||||
void SpineAnimationMixesInspectorPlugin::parse_begin(Object *object) {
|
||||
EditorInspectorPlugin::parse_begin(object);
|
||||
}
|
||||
|
||||
void SpineAnimationMixesInspectorPlugin::parse_category(Object *object, const String &parse_category) {
|
||||
EditorInspectorPlugin::parse_category(object, parse_category);
|
||||
if (parse_category == "Animation mixes") {
|
||||
|
||||
}
|
||||
sprite = object->cast_to<SpineSprite>(object);
|
||||
}
|
||||
|
||||
bool SpineAnimationMixesInspectorPlugin::parse_property(Object *object, Variant::Type type, const String &path,
|
||||
PropertyHint hint, const String &hint_text, int usage) {
|
||||
if (path == "animation_mixes") {
|
||||
add_custom_control(add_mix_button);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void SpineAnimationMixesInspectorPlugin::parse_end() {
|
||||
EditorInspectorPlugin::parse_end();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -32,6 +32,8 @@
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
#include "editor/editor_node.h"
|
||||
#include "SpineSprite.h"
|
||||
#include "editor/editor_properties.h"
|
||||
|
||||
class SpineAtlasResourceImportPlugin : public EditorImportPlugin {
|
||||
GDCLASS(SpineAtlasResourceImportPlugin, EditorImportPlugin)
|
||||
@ -125,15 +127,18 @@ public:
|
||||
class SpineAnimationMixesInspectorPlugin: public EditorInspectorPlugin {
|
||||
GDCLASS(SpineAnimationMixesInspectorPlugin, EditorInspectorPlugin)
|
||||
|
||||
SpineSprite *sprite;
|
||||
|
||||
Button *add_mix_button;
|
||||
Vector<Button *> delete_mix;
|
||||
|
||||
public:
|
||||
SpineAnimationMixesInspectorPlugin();
|
||||
~SpineAnimationMixesInspectorPlugin() override;
|
||||
|
||||
bool can_handle(Object *object) override;
|
||||
void parse_begin(Object *object) override;
|
||||
void parse_category(Object *object, const String &parse_category) override;
|
||||
bool parse_property(Object *object, Variant::Type type, const String &path, PropertyHint hint, const String &hint_text, int usage) override;
|
||||
void parse_end() override;
|
||||
};
|
||||
|
||||
class SpineAnimationMixesProperty: public EditorProperty {
|
||||
@ -143,6 +148,16 @@ public:
|
||||
SpineAnimationMixesProperty();
|
||||
~SpineAnimationMixesProperty();
|
||||
};
|
||||
|
||||
class SpineEditorPropertyMix: public EditorProperty {
|
||||
GDCLASS(SpineEditorPropertyMix, EditorProperty)
|
||||
|
||||
EditorPropertyText *from_property;
|
||||
EditorPropertyText *to_property;
|
||||
EditorPropertyFloat *mix_property;
|
||||
public:
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif//GODOT_SPINEEDITORPLUGIN_H
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user