feat: handle hidden transmog items
This commit is contained in:
parent
0e4fa65d3c
commit
276fde88e8
2 changed files with 20 additions and 10 deletions
|
|
@ -437,12 +437,16 @@ export class CharacterController {
|
||||||
if (appearance === undefined) {
|
if (appearance === undefined) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
appearance = { ...appearance };
|
||||||
|
|
||||||
let invType = this.itemInventoryTypes[equipment.itemEntry];
|
let invType = this.itemInventoryTypes[equipment.itemEntry];
|
||||||
items.push([invType, appearance.itemDisplayInfoId]);
|
items.push([invType, appearance.itemDisplayInfoId]);
|
||||||
|
|
||||||
if (transmogOut !== undefined) {
|
if (transmogOut !== undefined) {
|
||||||
if (equipment.transmog !== undefined) {
|
if (equipment.transmog !== undefined) {
|
||||||
|
if (equipment.transmog === 1) {
|
||||||
|
appearance.itemDisplayInfoId = -1; // Hidden gear piece from transmog
|
||||||
|
} else {
|
||||||
const modifiedAppearance = await this.armory.dbc.itemModifiedAppearance().find((row) => row.itemId === equipment.transmog);
|
const modifiedAppearance = await this.armory.dbc.itemModifiedAppearance().find((row) => row.itemId === equipment.transmog);
|
||||||
if (modifiedAppearance !== undefined) {
|
if (modifiedAppearance !== undefined) {
|
||||||
const tmogAppearance = await this.armory.dbc.itemAppearance().find((row) => row.id === modifiedAppearance.itemAppearanceId);
|
const tmogAppearance = await this.armory.dbc.itemAppearance().find((row) => row.id === modifiedAppearance.itemAppearanceId);
|
||||||
|
|
@ -452,6 +456,7 @@ export class CharacterController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
transmogOut.push([invType, appearance.itemDisplayInfoId]);
|
transmogOut.push([invType, appearance.itemDisplayInfoId]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,7 @@
|
||||||
$("#list-transmogs-container").show();
|
$("#list-transmogs-container").show();
|
||||||
|
|
||||||
for (const item of charData.equipment) {
|
for (const item of charData.equipment) {
|
||||||
if (item.transmog !== undefined) {
|
if (item.transmog !== undefined && item.transmog !== 1) {
|
||||||
const $li = $("<li>").appendTo("#list-transmogs ul");
|
const $li = $("<li>").appendTo("#list-transmogs ul");
|
||||||
$("<a>")
|
$("<a>")
|
||||||
.attr("href", `{{aowow}}/?item=${item.transmog}`)
|
.attr("href", `{{aowow}}/?item=${item.transmog}`)
|
||||||
|
|
@ -173,7 +173,7 @@
|
||||||
const hideHelm = $("#cb-hide-helmet").prop("checked");
|
const hideHelm = $("#cb-hide-helmet").prop("checked");
|
||||||
const hideCloak = $("#cb-hide-cloak").prop("checked");
|
const hideCloak = $("#cb-hide-cloak").prop("checked");
|
||||||
const hideTabard = $("#cb-hide-tabard").prop("checked");
|
const hideTabard = $("#cb-hide-tabard").prop("checked");
|
||||||
setItems(items.filter(item => !((item[0] === 1 && hideHelm) || (item[0] === 16 && hideCloak) || (item[0] === 19 && hideTabard))));
|
setItems(items.filter(item => !((item[0] === 1 && hideHelm) || (item[0] === 16 && hideCloak) || (item[0] === 19 && hideTabard)) && item[1] !== -1));
|
||||||
});
|
});
|
||||||
|
|
||||||
let viewer;
|
let viewer;
|
||||||
|
|
@ -198,8 +198,12 @@
|
||||||
const items = transmogged ? charData.characterModelTransmogs : charData.characterModelItems;
|
const items = transmogged ? charData.characterModelTransmogs : charData.characterModelItems;
|
||||||
const item = items.find(([sl, appearance]) => sl === slot);
|
const item = items.find(([sl, appearance]) => sl === slot);
|
||||||
if (item !== undefined) {
|
if (item !== undefined) {
|
||||||
|
if (item[1] === -1) {
|
||||||
|
clearSlots([slot]);
|
||||||
|
} else {
|
||||||
setItems([item]);
|
setItems([item]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
clearSlots([slot]);
|
clearSlots([slot]);
|
||||||
}
|
}
|
||||||
|
|
@ -416,7 +420,8 @@
|
||||||
sheathOff: -1,
|
sheathOff: -1,
|
||||||
},
|
},
|
||||||
cls: charData.class,
|
cls: charData.class,
|
||||||
items: (charData.characterModelTransmogs ?? charData.characterModelItems).filter(item => !((item[0] === 1 && hideHelm) || (item[0] === 16 && hideCloak))),
|
items: (charData.characterModelTransmogs ?? charData.characterModelItems)
|
||||||
|
.filter(item => !((item[0] === 1 && hideHelm) || (item[0] === 16 && hideCloak)) && item[1] !== -1),
|
||||||
models: {
|
models: {
|
||||||
type: ZamModelViewer.Wow.Types.CHARACTER,
|
type: ZamModelViewer.Wow.Types.CHARACTER,
|
||||||
id: `${races[charData.race]}${genders[charData.gender]}`,
|
id: `${races[charData.race]}${genders[charData.gender]}`,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue