Skip to content

ViewFiles beta ​

Interface of @v12-engine/client

ts
export interface ViewFiles

The game's files, as its view says them (GameView.files): its own folder of models, sounds and pictures, the categories the editor sorts them in, what is kept in the browser between visits, the unit types loaded late, and the files laid over the view's code (layFiles)

Members ​

assetCategories ​

ts
assetCategories?: AssetCategory[];

The game's categories of asset files, which the editor sorts its models, pictures and sounds into (Content, Assets, Place): each with what it is called and the files it holds ( id: 'my-weapons', name: 'My weapons', files: ['models/blades/*'] ). A folder is a category without being said (models/my-weapons/axe.glb), and a group of @v12-engine/assets is one; the editor keeps those it makes in the game folder's assets.json. See assetCategoryOf

assetCategory ​

ts
assetCategory?: AssetCategoryHook;

Says the category of any file in code, by its id, before the declared ones: nothing leaves it to them

assets ​

ts
assets?: string;

The game's own folder of files, under public ('games/td'): sounds, models and music, with an assets.json saying what is in it (see Assets). What is not in it comes from the shared folders. Only those when left out

assetUses ​

ts
assetUses?: (asset: {
        path: string;
        kind: AssetKind;
    }) => {
        what: string;
        where: string;
    }[];

Where else a file of the game's is used, as the game knows it (a wave's icon, a mission's picture): what the editor's Assets panel lists under Used by, and takes into account before a delete. Given the file, by its path and kind

keepFiles ​

ts
keepFiles?: string;

Keeps the game's models and sounds in the browser between visits (the Cache API), under this version: the next visit takes them from there, with nothing asked of the network. A new version (a new build: its hash, or the game's version) starts over and lets go of the one before. Fetched every visit, as the browser's own cache allows, when left out. See KeptFiles

laid ​

ts
laid?: readonly LaidFile[];

The game's files laid over what its code says, in the order they were laid (layFiles): what each was laid over, so that the editor lays one again as it writes it (relayFile) and a copy of the view knows it too. Set by layFiles, not by hand

later ​

ts
later?: string[];

Unit types whose models are not loaded before the game starts: big ones that come late, like a boss. The view loads them while the game runs (kit.load, client.loadUnits), or they load when one first shows up

preload ​

ts
preload?: 'map' | 'all';

What is loaded before the game starts. map (when left out): the models and sounds of the unit types the game starts with and of what those make, build or turn into, the rest coming behind the game as it plays, drawn with their parts until they are there. all: of every unit type. later and GameView.sounds.preload say first either way