Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ node_modules/
build/

# 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/*.png

# Configuration
config.json
Expand Down
5 changes: 3 additions & 2 deletions src/tools/fetchdata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,9 @@ async function parseModels(): Promise<void> {

const texturesOffset = buffer.readUInt32LE(60);
const uncompressedSize = buffer.readUInt32LE(112);
const compressedData = buffer.slice(116);
const data = Buffer.from(pako.inflate(compressedData));
const compressedData = buffer.slice(116);
const inflated = pako.inflate(new Uint8Array(compressedData));
const data = Buffer.from(inflated);
if (data.length !== uncompressedSize) {
throw `Unexpected data size ${data.length}, expected ${uncompressedSize}`;
}
Expand Down
12 changes: 7 additions & 5 deletions static/character.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@
}
$("#cb-hide-transmogs").change(() => {
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]))) {
clearSlots([slot]);
}
Expand Down Expand Up @@ -194,8 +196,8 @@

function setSlotVisible(slot, visible) {
if (visible) {
const transmogged = !$("#cb-hide-transmogs").prop("checked");
const items = transmogged ? charData.characterModelTransmogs : charData.characterModelItems;
const useTransmog = !$("#cb-hide-transmogs").prop("checked") && Array.isArray(charData.characterModelTransmogs);
const items = useTransmog ? charData.characterModelTransmogs : charData.characterModelItems;
const item = items.find(([sl, appearance]) => sl === slot);
if (item !== undefined) {
if (item[1] === -1) {
Expand Down Expand Up @@ -408,9 +410,9 @@

const characterModel = {
type: ZamModelViewer.WOW,
contentPath: "{{ contentPath }}",
contentPath: "{{ contentPath }}",
container: $model,
hd: true,
hd: false,
aspect: $model.outerWidth() / $model.outerHeight(),
charCustomization: {
race: charData.race,
Expand Down