Skip to content

Commit

Permalink
Merge pull request #199 from retro-pc/read-itemspack-from-constants
Browse files Browse the repository at this point in the history
fixes for stat editor
  • Loading branch information
retro-pc authored Mar 19, 2024
2 parents 95c3527 + 4a760c4 commit 51fe908
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
9 changes: 2 additions & 7 deletions src/components/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,6 @@
async readItem(bytes, version) {
this.preview = await d2s.readItem(bytes, version);
await this.setPropertiesOnItem(this.preview);
utils.removeMaxDurabilityFromRunwords(this.preview);
},
async setPreviewItem(e) {
this.baseOptions = null;
Expand All @@ -694,11 +693,7 @@
async setBase(e) {
if (this.baseModel) {
this.preview.type = this.baseModel;
//reload stats for runes
if (this.preview.socketed_items && this.preview.socketed_items.length) {
await d2s.enhanceItems(this.preview.socketed_items, window.constants, 1, {}, this.preview);
}
await d2s.enhanceItem(this.preview, window.constants);
await d2s.enhanceItems([this.preview], window.constants);
await this.setPropertiesOnItem(this.preview);
}
},
Expand Down Expand Up @@ -832,7 +827,7 @@
if (!item.socketed_items) {
return;
}
item.socketed_attributes = [];
if (!item.socketed_attributes) item.socketed_attributes = [];
for(let i = 0; i < item.socketed_items.length; i++) {
item.socketed_items[i].src = await utils.b64PNGFromDC6(item.socketed_items[i]);
item.socketed_items[i].magic_attributes.forEach((it, idx) => { if (item.socketed_attributes.findIndex(x => x.id == it.id) == -1) item.socketed_attributes.push(it) });
Expand Down
6 changes: 0 additions & 6 deletions src/components/inventory/ItemStatsEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ export default {
},
methods: {
onItemModified() {
for (let i = 0; i < this.itemStats.length; i++) {
let numVal = this.numValues(this.itemStats[i].id)
if (numVal != this.itemStats[i].values.length) {
this.itemStats[i].values = [1, 0, 1].slice(0, numVal)
}
}
this.$emit('stat-change', this.itemStats)
},
getMaxValue(id) {
Expand Down

0 comments on commit 51fe908

Please sign in to comment.