From e623ee531209f602b944dfc710878cbdd31c9aaa Mon Sep 17 00:00:00 2001 From: Chomp Date: Thu, 22 Dec 2022 10:50:07 +0000 Subject: [PATCH] Update example 13 to take into account new locale changes from bsg --- TypeScript/13AddTrader/src/mod.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/TypeScript/13AddTrader/src/mod.ts b/TypeScript/13AddTrader/src/mod.ts index a136ff6..cd60713 100644 --- a/TypeScript/13AddTrader/src/mod.ts +++ b/TypeScript/13AddTrader/src/mod.ts @@ -13,7 +13,6 @@ import { ITraderAssort, ITraderBase } from "@spt-aki/models/eft/common/tables/IT import { ITraderConfig, UpdateTime } from "@spt-aki/models/spt/config/ITraderConfig"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; -import { ILocaleGlobalBase } from "@spt-aki/models/spt/server/ILocaleBase"; // The new trader config import * as baseJson from "../db/base.json"; @@ -54,15 +53,14 @@ class SampleTrader implements IPreAkiLoadMod, IPostDBLoadMod { }; // For each language, add locale for the new trader - const locales = Object.values(tables.locales.global) as ILocaleGlobalBase[]; + const locales = Object.values(tables.locales.global) as Record[]; for (const locale of locales) { - locale.trading[baseJson._id] = { - FullName: baseJson.name, - FirstName: "Cat", - Nickname: baseJson.nickname, - Location: baseJson.location, - Description: "This is the cat shop" - }; + locale[`${baseJson._id} FullName`] = baseJson.name; + locale[`${baseJson._id} FirstName`] = "Cat"; + locale[`${baseJson._id} Nickname`] = baseJson.nickname; + locale[`${baseJson._id} Nickname`] = baseJson.nickname; + locale[`${baseJson._id} Location`] = baseJson.location; + locale[`${baseJson._id} Description`] = "This is the cat shop"; } this.logger.debug(`[${this.mod}] Delayed Loaded`); }