Window Framework for UI Toolkit v2.0.x
GWG.WindowFramework.Theming.PlayerThemeExporter Class Reference

Creates a new independently editable player theme from resolved framework values. More...

Static Public Member Functions

static bool TryCreate (string root, string name, PlayerThemeValues values, VisualElement scope, PlayerThemeExtensionRegistry extensions, PlayerThemeManifest original, out string folderName, out string error)
 Exports into staging, validates by reimporting, then promotes with Directory.Move.
static bool TryCreate (string root, string name, PlayerThemeValues values, VisualElement scope, PlayerThemeExtensionRegistry extensions, PlayerThemeManifest original, Texture2D preview, out string folderName, out string error)
 Exports an independent optional raster preview alongside the effective styling snapshot.

Static Private Member Functions

static byte[] Encode (Texture2D source)

Detailed Description

Creates a new independently editable player theme from resolved framework values.

Never rewrites the source. Requires every catalog key so inherited defaults are not lost. Raster images are copied through public GPU readback; arbitrary vector/font export is not claimed. Unknown extension data is preserved, but opaque asset references require a separate declared asset contract before they can be copied safely.

Member Function Documentation

◆ Encode()

byte[] GWG.WindowFramework.Theming.PlayerThemeExporter.Encode ( Texture2D source)
inlinestaticprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ TryCreate() [1/2]

bool GWG.WindowFramework.Theming.PlayerThemeExporter.TryCreate ( string root,
string name,
PlayerThemeValues values,
VisualElement scope,
PlayerThemeExtensionRegistry extensions,
PlayerThemeManifest original,
out string folderName,
out string error )
inlinestatic

Exports into staging, validates by reimporting, then promotes with Directory.Move.

Parameters
rootExisting validated player root.
namePlayer-facing display name.
valuesComplete effective framework snapshot.
scopePurchaser UI scope for extension snapshots.
extensionsCompiled registry, or null when no extensions apply.
originalSource player manifest for preserving unregistered extension data, or null.
folderNameNew folder on success.
errorBounded failure diagnostic.
Returns
True only when a complete importable copy was committed.

Source styles/assets and existing destination folders are never overwritten. Staging cleanup targets only this operation's unique folder. Root link checking uses the same importer policy. Call on the Unity main thread for GPU image export.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TryCreate() [2/2]

bool GWG.WindowFramework.Theming.PlayerThemeExporter.TryCreate ( string root,
string name,
PlayerThemeValues values,
VisualElement scope,
PlayerThemeExtensionRegistry extensions,
PlayerThemeManifest original,
Texture2D preview,
out string folderName,
out string error )
inlinestatic

Exports an independent optional raster preview alongside the effective styling snapshot.

Preview shares importer limits and folder ownership; the source is borrowed, never modified/destroyed. Existing overload remains available. Vector/font export is not implied by raster preview support.

Here is the call graph for this function: