From f3ded1ed1af11dbeac0ab22ea27721cfd9342738 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Mon, 19 Aug 2024 14:01:08 +0200 Subject: [PATCH] [godot] Godot 4.3 updates --- .github/workflows/spine-godot-v4-all.yml | 4 ++-- spine-godot/spine_godot/SpineAnimationTrack.cpp | 4 ++-- spine-godot/spine_godot/SpineSprite.cpp | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/spine-godot-v4-all.yml b/.github/workflows/spine-godot-v4-all.yml index 47007e702..9a5a8d831 100644 --- a/.github/workflows/spine-godot-v4-all.yml +++ b/.github/workflows/spine-godot-v4-all.yml @@ -14,10 +14,10 @@ jobs: matrix: version: [ - {"tag": "4.1.4-stable", "version": "4.1.4.stable", "mono": false}, - {"tag": "4.1.4-stable", "version": "4.1.4.stable", "mono": true}, {"tag": "4.2.2-stable", "version": "4.2.2.stable", "mono": false}, {"tag": "4.2.2-stable", "version": "4.2.2.stable", "mono": true}, + {"tag": "4.2-stable", "version": "4.2.stable", "mono": false}, + {"tag": "4.2-stable", "version": "4.2.stable", "mono": true}, ] uses: ./.github/workflows/spine-godot-v4.yml with: diff --git a/spine-godot/spine_godot/SpineAnimationTrack.cpp b/spine-godot/spine_godot/SpineAnimationTrack.cpp index 4cad6e14c..4de781d47 100644 --- a/spine-godot/spine_godot/SpineAnimationTrack.cpp +++ b/spine-godot/spine_godot/SpineAnimationTrack.cpp @@ -182,8 +182,8 @@ void SpineAnimationTrack::setup_animation_player() { #if VERSION_MAJOR > 3 List animation_libraries; animation_player->get_animation_library_list(&animation_libraries); - for (int i = 0; i < animation_libraries.size(); i++) { - animation_player->remove_animation_library(animation_libraries[i]); + for (auto iter = animation_libraries.front(); iter; iter = iter->next()) { + animation_player->remove_animation_library(iter->get()); } #else List animation_names; diff --git a/spine-godot/spine_godot/SpineSprite.cpp b/spine-godot/spine_godot/SpineSprite.cpp index ae1daf1a5..49571d41f 100644 --- a/spine-godot/spine_godot/SpineSprite.cpp +++ b/spine-godot/spine_godot/SpineSprite.cpp @@ -53,8 +53,12 @@ #include "scene/main/viewport.h" #if TOOLS_ENABLED +#if VERSION_MAJOR > 4 && VERSION_MINOR > 2 +#include "editor/plugins/editor_plugin.h" +else #include "editor/editor_plugin.h" #endif +#endif Ref SpineSprite::default_materials[4] = {}; static int sprite_count = 0;