feat(store): sell multi-vehicle packs and localize country names
Offer the five three-vehicle packs and nine starter packs as bundles. Grant their unowned vehicles and bonuses on purchase. Encode each vehicle in an aircraftGift field and validate duplicate IDs and vehicle assignments. Read group labels from units.csv and country names from _common_languages.csv. Use those names in packs and browser filters. Type checking and local catalogue and price response checks passed. In-game acceptance is pending.
This commit is contained in:
1 parent
78f1857918
commit
259cd0f32c
12 files changed
+412
-104
No files matched your search
@@ -10,5 +10,5 @@ export { emptyBlock } from './model.ts';
|
||||
export { BlkFormatError } from './errors.ts';
|
||||
export { BlkLabel, decodeBlk, encodeBlk, type SharedNameContext } from './binary/format.ts';
|
||||
export { parseSharedNameMap, type SharedNameMap } from './shared-name-map.ts';
|
||||
export { ensureBlock, findBlock, findParam, setParam, visitParams } from './tree.ts';
|
||||
export { appendParam, ensureBlock, findBlock, findParam, setParam, visitParams } from './tree.ts';
|
||||
export { formatBlkText } from './text/format-text.ts';
|
||||
@@ -29,6 +29,11 @@ export function setParam(block: BlkBlock, name: string, value: BlkValue): void {
|
||||
block.params = block.params.filter((param, position) => position <= index || param.name !== name);
|
||||
}
|
||||
|
||||
/** Append a parameter called `name` without touching existing parameters of the same name (for repeated BLK keys such as `aircraftGift:t`). */
|
||||
export function appendParam(block: BlkBlock, name: string, value: BlkValue): void {
|
||||
block.params.push({ name, value });
|
||||
}
|
||||
|
||||
/** Visit every parameter of the tree, depth first, with the path of block names leading to it. */
|
||||
export function visitParams(block: BlkBlock, visit: (param: BlkParam, path: readonly string[]) => void,
|
||||
path: readonly string[] = []): void {
|
||||
|
||||
Reference in new issue
Block a user