Files
WT-Offline/packages/local-service/src/game-data/datasets/store-bundles.ts
T
N0VAN0M4LY cfa6c04aa6 Add GJN balances, the local store, and redemption codes
Support currency and entitlement purchases, including packs, from the
local store and the in-game payment flow. Expose the supported
redemption codes.
2026-11-25 06:33:41 +08:00

28 lines
976 B
TypeScript

/**
* Dataset: entitlement-to-GUID mappings from aces.vromfs.bin config/gui.blk bundles/guid
* (gui.vromfs.bin scripts/onlineShop/onlineBundles.nut, implementation notes).
*/
import { findBlock } from '@wto/blk';
import type { Dataset } from './dataset.ts';
const GUI_CONFIG = 'config/gui.blk';
/** Entitlement name -> store item GUID (upper-case UUID string). */
export type StoreBundleGuids = Readonly<Record<string, string>>;
export const storeBundles: Dataset<StoreBundleGuids> = {
id: 'store-bundles',
version: 1,
extract: (source) => {
const gui = source.readBlk('aces.vromfs.bin', GUI_CONFIG);
const guidBlock = findBlock(findBlock(gui, 'bundles') ?? { name: '', params: [], blocks: [] }, 'guid');
const result: Record<string, string> = {};
for (const param of guidBlock?.params ?? []) {
if (param.value.type === 'string' && param.value.value) {
result[param.name] = param.value.value;
}
}
return result;
},
};