Skip to content

Commit

Permalink
fix (skin) Ignore empty addOutfit skins, not available slots
Browse files Browse the repository at this point in the history
  • Loading branch information
MikalDev committed Nov 3, 2021
1 parent 9416223 commit d06a8bb
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
Binary file added dist/Spine-v1.51.1.c3addon
Binary file not shown.
2 changes: 1 addition & 1 deletion src/addon.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "plugin",
"name": "Spine",
"id": "Gritsenko_Spine",
"version": "1.51.0",
"version": "1.51.1",
"author": "Mikal and Igor Gritsenko",
"website": "https://gritsenko.github.io/c3_spine_plugin",
"documentation": "https://gritsenko.github.io/c3_spine_plugin",
Expand Down
4 changes: 3 additions & 1 deletion src/c3runtime/instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,9 @@

slots.forEach( slotName =>
{
if (addOutfit[slotName].skinName == '') return
const slotRef = skeleton.findSlot(slotName)
if (!slotRef) return
let addSkinName = slotName+'/'+addOutfit[slotName].skinName;
let addSkin = skeleton.data.findSkin(addSkinName);
if (addSkin)
Expand All @@ -1019,7 +1022,6 @@
// Color
this.slotColors[slotName] = this._swap32(addOutfit[slotName].tintColor);
this.slotDarkColors[slotName] = this._swap32(addOutfit[slotName].tintDarkColor);
const slotRef = skeleton.findSlot(slotName)
spine.Color.rgba8888ToColor(slotRef.color, addOutfit[slotName].tintColor);
spine.Color.rgba8888ToColor(slotRef.darkColor, addOutfit[slotName].tintDarkColor);
// Dependent slots color
Expand Down
2 changes: 1 addition & 1 deletion src/c3runtime/spine-draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ class SpineBatch {
// @ts-ignore
if (!globalThis.spineBatcher)
{
console.log('[Spine] SpineBatcher init, 1.51.0');
console.log('[Spine] SpineBatcher init, 1.51.1');
// @ts-ignore
globalThis.spineBatcher = new SpineBatch();
}
2 changes: 1 addition & 1 deletion src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const C3 = self.C3;

const PLUGIN_ID = "Gritsenko_Spine";
const PLUGIN_VERSION = "1.51.0";
const PLUGIN_VERSION = "1.51.1";
const PLUGIN_CATEGORY = "general";

const PLUGIN_CLASS = SDK.Plugins.Gritsenko_Spine = class SpinePlugin extends SDK.IPluginBase {
Expand Down

0 comments on commit d06a8bb

Please sign in to comment.