mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[ts] Port of commit 687260a: Removed SlotData#path.
The name now always contains the full path.
This commit is contained in:
parent
e99899e819
commit
24dc328b15
@ -128,14 +128,6 @@ export class SkeletonBinary {
|
||||
for (let i = 0; i < n; i++) {
|
||||
let slotName = input.readString();
|
||||
if (!slotName) throw new Error("Slot name must not be null.");
|
||||
let path: string | null = null;
|
||||
if (nonessential) {
|
||||
const slash = slotName!.lastIndexOf('/');
|
||||
if (slash != -1) {
|
||||
path = slotName.substring(0, slash);
|
||||
slotName = slotName.substring(slash + 1);
|
||||
}
|
||||
}
|
||||
let boneData = skeletonData.bones[input.readInt(true)];
|
||||
let data = new SlotData(i, slotName, boneData);
|
||||
Color.rgba8888ToColor(data.color, input.readInt32());
|
||||
@ -145,10 +137,7 @@ export class SkeletonBinary {
|
||||
|
||||
data.attachmentName = input.readStringRef();
|
||||
data.blendMode = input.readInt(true);
|
||||
if (nonessential) {
|
||||
data.visible = input.readBoolean();
|
||||
data.path = path;
|
||||
}
|
||||
if (nonessential) data.visible = input.readBoolean();
|
||||
skeletonData.slots.push(data);
|
||||
}
|
||||
|
||||
|
||||
@ -116,13 +116,8 @@ export class SkeletonJson {
|
||||
if (root.slots) {
|
||||
for (let i = 0; i < root.slots.length; i++) {
|
||||
let slotMap = root.slots[i];
|
||||
let path: string | null = null;
|
||||
let slotName = slotMap.name;
|
||||
const slash = slotName.lastIndexOf('/');
|
||||
if (slash != -1) {
|
||||
path = slotName.substring(0, slash);
|
||||
slotName = slotName.substring(slash + 1);
|
||||
}
|
||||
|
||||
let boneData = skeletonData.findBone(slotMap.bone);
|
||||
if (!boneData) throw new Error(`Couldn't find bone ${slotMap.bone} for slot ${slotName}`);
|
||||
let data = new SlotData(skeletonData.slots.length, slotName, boneData);
|
||||
@ -136,7 +131,6 @@ export class SkeletonJson {
|
||||
data.attachmentName = getValue(slotMap, "attachment", null);
|
||||
data.blendMode = Utils.enumValue(BlendMode, getValue(slotMap, "blend", "normal"));
|
||||
data.visible = getValue(slotMap, "visible", true);
|
||||
data.path = path;
|
||||
skeletonData.slots.push(data);
|
||||
}
|
||||
}
|
||||
|
||||
@ -58,10 +58,6 @@ export class SlotData {
|
||||
/** False if the slot was hidden in Spine and nonessential data was exported. Does not affect runtime rendering. */
|
||||
visible = true;
|
||||
|
||||
/** The folders for this slot in the draw order, delimited by <code>/</code>, or null if nonessential data was not exported. */
|
||||
path: string | null = null;
|
||||
|
||||
|
||||
constructor (index: number, name: string, boneData: BoneData) {
|
||||
if (index < 0) throw new Error("index must be >= 0.");
|
||||
if (!name) throw new Error("name cannot be null.");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user