From 8bc6db0641cba92cfd3c5c1caa0e24bbc85c9cb7 Mon Sep 17 00:00:00 2001 From: Adrian Klingen Date: Sat, 3 Aug 2024 18:16:04 +0200 Subject: [PATCH] Remove version before adding to equipmentspec proto --- ui/core/components/importers.ts | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/ui/core/components/importers.ts b/ui/core/components/importers.ts index 94dd646670..9a2f0ec76f 100644 --- a/ui/core/components/importers.ts +++ b/ui/core/components/importers.ts @@ -1,11 +1,11 @@ +import { JsonObject } from '@protobuf-ts/runtime'; + import { IndividualSimUI } from '../individual_sim_ui'; -import { SimUI } from '../sim_ui'; -import { TypedEvent } from '../typed_event'; import { Class, EquipmentSpec, - ItemSlot, Glyphs, + ItemSlot, ItemSpec, Profession, Race, @@ -13,15 +13,16 @@ import { } from '../proto/common'; import { IndividualSimSettings } from '../proto/ui'; import { Database } from '../proto_utils/database'; -import { classNames, nameToClass, nameToRace, nameToProfession } from '../proto_utils/names'; +import { classNames, nameToClass, nameToProfession,nameToRace } from '../proto_utils/names'; +import { SimSettingCategories } from '../sim'; +import { SimUI } from '../sim_ui'; import { classGlyphsConfig, talentSpellIdsToTalentString } from '../talents/factory'; import { GlyphConfig } from '../talents/glyphs_picker'; -import { BaseModal } from './base_modal'; +import { TypedEvent } from '../typed_event'; import { buf2hex, getEnumValues } from '../utils'; -import { JsonObject } from '@protobuf-ts/runtime'; -import { SimSettingCategories } from '../sim'; +import { BaseModal } from './base_modal'; -declare var pako: any; +declare let pako: any; export abstract class Importer extends BaseModal { protected readonly textElem: HTMLTextAreaElement; @@ -250,9 +251,9 @@ export class Individual80UImporter extends Importer { talentsStr = talentSpellIdsToTalentString(charClass, talentIds); } - let equipmentSpec = EquipmentSpec.create(); + const equipmentSpec = EquipmentSpec.create(); (importJson.items as Array).forEach(itemJson => { - let itemSpec = ItemSpec.create(); + const itemSpec = ItemSpec.create(); itemSpec.id = itemJson.id; if (itemJson.enchant?.id) { itemSpec.enchant = itemJson.enchant.id; @@ -513,6 +514,7 @@ export class IndividualAddonImporter extends Importer { const gearJson = importJson['gear']; gearJson.items = (gearJson.items as Array).filter(item => item != null); + delete gearJson.version; (gearJson.items as Array).forEach(item => { if (item.gems) { item.gems = (item.gems as Array).map(gem => gem || 0); @@ -529,7 +531,7 @@ function glyphNameToID(glyphName: string, glyphsConfig: Record