Skip to content

editorContent ​

Namespace of @v12-engine/editor

Members ​

categoryLabel beta ​

ts
export declare function categoryLabel(client: Pick<EditorClient, 'assetCategoryName' | 'assetCategoryOf'>, asset: ProjectAsset): string;

What the category of a file of the project is called, or its kind's words (Models, Sounds…) for a file of none

categoryOfAsset beta ​

ts
categoryOfAsset: (client: Pick<EditorClient, 'assetCategoryOf'>, asset: ProjectAsset) => string | undefined

The category of a file of the project, by id, as the game says it (EditorClient.assetCategoryOf)

CONTENT_SIZES beta ​

ts
CONTENT_SIZES: {
    min: number;
    max: number;
    default: number;
}

The bounds of the picture size the drawer can be set to, and its default, in pixels

ContentFilter beta ​

ts
export interface ContentFilter

What the drawer shows of all of it: the words typed (ranked, see rankWords), a group, the favourites alone

ContentHost beta ​

ts
export type ContentHost = Pick<EditorClient, 'assetCategoryName' | 'assetCategoryOf' | 'assets' | 'cinematics' | 'kinds' | 'ownerFrom' | 'pack' | 'palette' | 'panels' | 'prefabFiles' | 'registry' | 'tool' | 'view'>;

What the Content drawer reaches of the editor: these, and nothing else of it

ContentItem beta ​

ts
export interface ContentItem

A thing of the Content drawer

contentOf beta ​

ts
export declare function contentOf(client: ContentHost): ContentItem[];

Every unit type, doodad and prefab the editor can put down, as the game gives them, in the groups it shows them in

ContentPrefs beta ​

ts
export interface ContentPrefs

How the drawer is, kept for the next time by game: its favourites, what was used last, its pictures' size, a grid or a list

fileName beta ​

ts
fileName: (path: string) => string

The name of a file without its folders or its kind: trees/oak.glb is oak

filesOf beta ​

ts
export declare function filesOf(client: ContentHost, assets: readonly Asset[]): ContentItem[];

The project's models, from the editor's index of every file (editor.assetIndex): each put down as a doodad, in its category (categoryLabel: the game's, a folder's, a group of @v12-engine/assets), or Models for none. The game's own first, then the project's shared ones, then the groups of @v12-engine/assets (Nature first). The map's own models are doodads already (contentOf), and the files that are not put down (textures, sounds, pictures) are the Assets panel's

filterContent beta ​

ts
export declare function filterContent(items: readonly ContentItem[], filter: ContentFilter): ContentItem[];

The items that pass the filter, best match first when words are typed; items keep their order otherwise

keepContentPrefs beta ​

ts
keepContentPrefs: (game: string, prefs: ContentPrefs, storage: KeptStorage) => void

Keeps the Content panel's state for a game in the storage

nextTile beta ​

ts
export declare function nextTile(tiles: readonly {
    x: number;
    y: number;
    width: number;
    height: number;
}[], at: number, key: string): number;

Which tile an arrow goes to from the one at at, among the tiles as they stand on the screen, in their order (the drawer's groups one after another, each with as many columns as fit): the one before or after along the order, or the nearest in the row above or below. at when there is none that way

readContentPrefs beta ​

ts
readContentPrefs: (game: string, storage: KeptStorage) => ContentPrefs

Reads what the Content panel kept for a game from the storage; the defaults where nothing was kept

sharedGroupName beta ​

ts
sharedGroupName: (id: string) => string

What a group of @v12-engine/assets is called where it is shown: Nature

sharedGroupOrder beta ​

ts
sharedGroupOrder: (id: string) => number

The order a group of @v12-engine/assets is shown in: those of SHARED_FIRST first, the rest after by name

typePicture beta ​

ts
export declare function typePicture(client: ContentHost, type: string): {
    model?: ModelDef;
    icon?: string;
};

What a unit type is drawn as, for its picture: its model, and the game's icon of it first, where there is one

usedNow beta ​

ts
usedNow: (recent: readonly string[], id: string) => string[]

What was used last, with this one first