editorContent
Namespace of @v12-engine/editor
Members
categoryLabel beta
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
categoryOfAsset: (client: Pick<EditorClient, 'assetCategoryOf'>, asset: ProjectAsset) => string | undefinedThe category of a file of the project, by id, as the game says it (EditorClient.assetCategoryOf)
CONTENT_SIZES beta
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
export interface ContentFilterWhat the drawer shows of all of it: the words typed (ranked, see rankWords), a group, the favourites alone
ContentHost beta
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
export interface ContentItemA thing of the Content drawer
contentOf beta
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
export interface ContentPrefsHow 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
fileName: (path: string) => stringThe name of a file without its folders or its kind: trees/oak.glb is oak
filesOf beta
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
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
keepContentPrefs: (game: string, prefs: ContentPrefs, storage: KeptStorage) => voidKeeps the Content panel's state for a game in the storage
nextTile beta
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
readContentPrefs: (game: string, storage: KeptStorage) => ContentPrefsReads what the Content panel kept for a game from the storage; the defaults where nothing was kept
sharedGroupName beta
sharedGroupName: (id: string) => stringWhat a group of @v12-engine/assets is called where it is shown: Nature
sharedGroupOrder beta
sharedGroupOrder: (id: string) => numberThe order a group of @v12-engine/assets is shown in: those of SHARED_FIRST first, the rest after by name
typePicture beta
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
usedNow: (recent: readonly string[], id: string) => string[]What was used last, with this one first