Merge 39d7d49e6c into 6cb84817ac
This commit is contained in:
commit
d9347406cc
3 changed files with 14 additions and 9 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
|
@ -5,9 +5,11 @@ node_modules/
|
||||||
build/
|
build/
|
||||||
|
|
||||||
# Downloaded data files
|
# Downloaded data files
|
||||||
data/*
|
# Ignore all generated/cached assets under data
|
||||||
|
data/**
|
||||||
|
# Keep only the local background image and optional CSVs tracked
|
||||||
|
!data/modelviewer-background.png
|
||||||
!data/*.csv
|
!data/*.csv
|
||||||
!data/*.png
|
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
config.json
|
config.json
|
||||||
|
|
|
||||||
|
|
@ -390,7 +390,8 @@ async function parseModels(): Promise<void> {
|
||||||
const texturesOffset = buffer.readUInt32LE(60);
|
const texturesOffset = buffer.readUInt32LE(60);
|
||||||
const uncompressedSize = buffer.readUInt32LE(112);
|
const uncompressedSize = buffer.readUInt32LE(112);
|
||||||
const compressedData = buffer.slice(116);
|
const compressedData = buffer.slice(116);
|
||||||
const data = Buffer.from(pako.inflate(compressedData));
|
const inflated = pako.inflate(new Uint8Array(compressedData));
|
||||||
|
const data = Buffer.from(inflated);
|
||||||
if (data.length !== uncompressedSize) {
|
if (data.length !== uncompressedSize) {
|
||||||
throw `Unexpected data size ${data.length}, expected ${uncompressedSize}`;
|
throw `Unexpected data size ${data.length}, expected ${uncompressedSize}`;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,9 @@
|
||||||
}
|
}
|
||||||
$("#cb-hide-transmogs").change(() => {
|
$("#cb-hide-transmogs").change(() => {
|
||||||
const hide = $("#cb-hide-transmogs").prop("checked");
|
const hide = $("#cb-hide-transmogs").prop("checked");
|
||||||
const items = hide ? charData.characterModelItems : charData.characterModelTransmogs;
|
const items = hide || !Array.isArray(charData.characterModelTransmogs)
|
||||||
|
? charData.characterModelItems
|
||||||
|
: charData.characterModelTransmogs;
|
||||||
for (const slot of (items.map((item) => item[0]))) {
|
for (const slot of (items.map((item) => item[0]))) {
|
||||||
clearSlots([slot]);
|
clearSlots([slot]);
|
||||||
}
|
}
|
||||||
|
|
@ -194,8 +196,8 @@
|
||||||
|
|
||||||
function setSlotVisible(slot, visible) {
|
function setSlotVisible(slot, visible) {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
const transmogged = !$("#cb-hide-transmogs").prop("checked");
|
const useTransmog = !$("#cb-hide-transmogs").prop("checked") && Array.isArray(charData.characterModelTransmogs);
|
||||||
const items = transmogged ? charData.characterModelTransmogs : charData.characterModelItems;
|
const items = useTransmog ? 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) {
|
if (item[1] === -1) {
|
||||||
|
|
@ -410,7 +412,7 @@
|
||||||
type: ZamModelViewer.WOW,
|
type: ZamModelViewer.WOW,
|
||||||
contentPath: "{{ contentPath }}",
|
contentPath: "{{ contentPath }}",
|
||||||
container: $model,
|
container: $model,
|
||||||
hd: true,
|
hd: false,
|
||||||
aspect: $model.outerWidth() / $model.outerHeight(),
|
aspect: $model.outerWidth() / $model.outerHeight(),
|
||||||
charCustomization: {
|
charCustomization: {
|
||||||
race: charData.race,
|
race: charData.race,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue