Add catalogue filters, item detail views, and purchase and resale actions. Resolve images from the player's asset pack, public image URLs, or local game data. Add a utility for creating the optional local asset pack. Type checking and JavaScript syntax checks passed. Embedded browser appearance and in-game behavior still need acceptance.
18 lines
855 B
TypeScript
18 lines
855 B
TypeScript
/**
|
|
* A new account's profile: Gaijin's own new-account template from the player's game files
|
|
* (config/default_user.blk), plus the offline starting content (starting-content.ts) and the
|
|
* starting balances defined separately in tuning/new-profile.jsonc.
|
|
*/
|
|
import type { BlkBlock } from '@wto/blk';
|
|
import { setGjnCents, setGoldenEagles, setSilverLions } from './profile-currency.ts';
|
|
import { applyStartingContent, type StartingContent } from './starting-content.ts';
|
|
|
|
export function newProfile(template: BlkBlock, content: StartingContent): BlkBlock {
|
|
const profile = structuredClone(template);
|
|
applyStartingContent(profile, content);
|
|
setSilverLions(profile, content.startingBalance.silverLions);
|
|
setGoldenEagles(profile, content.startingBalance.goldenEagles);
|
|
setGjnCents(profile, content.startingBalance.gjnCents);
|
|
return profile;
|
|
}
|