Reads player-setting metadata and supported variable mappings from the configured source order.
More...
|
| static void | AddDiagnostic (List< string > diagnostics, Declaration declaration, string message) |
| static List< DeveloperThemeDefinition > | CompileCore (ThemeSourceGraph graph, ISet< string > dependencies) |
| static int | End (string text, int start, char end) |
| static Dictionary< string, string > | Expand (string property, string expression) |
| static InvalidDataException | Failure (Declaration declaration, string message) |
| static void | Parse (Value value, string property, Declaration declaration, ISet< string > dependencies) |
| static List< Declaration > | Read (ThemeSourceGraph graph) |
| static float | ReadBound (string text, Declaration declaration) |
| static void | ReadMetadata (string comment, Declaration declaration) |
| static Value | Resolve (Declaration consumer, string expression, List< Declaration > declarations, HashSet< string > seen, ISet< string > dependencies) |
| static bool | ScopeApplies (string declaring, string consumer) |
Reads player-setting metadata and supported variable mappings from the configured source order.
METADATA FORMAT: inside /* WFW:BEGIN DEVELOPER / ... / WFW:END DEVELOPER /, put a block comment immediately before the developer custom-property declaration. Each field MUST occupy its own line (LF or CRLF); commas do NOT separate metadata fields. The first nonempty line is WFWDevExt: namespace.key. Required: type (number, color, image). Numbers require unit: px, exactly one of min/min-exclusive, and max. Label/description are optional. Leading '' comment decoration is allowed. The USS declaration supplies the default value. Example block (each field below is a separate line):
First annotated identity wins; later definitions warn without blocking Copy. Ordinary stylesheet declarations and suffixes are Unity's responsibility, not player-data validation. Only prepared settings/defaults and the fixed runtime mapping vocabulary are processed here.
REQUIRED MAINTENANCE BOUNDARY: this authoring and mapping behavior is accepted. Preserve it. Do not redesign the metadata format, add a general USS/CSS validator, infer defaults from competing consumers, or reinstate whole-Copy rejection for duplicate identities without an explicitly authorized change. Fix only the reported defect; do not rewrite developer styling to satisfy this reader.
HOW IT WORKS: the editor supplies the actual ordered ThemeSourceGraph for the selected theme and its configured application styling/imports. Read() extracts marked declarations and their following variable/default values from source text; there is no Demo-key lookup or preset palette. CompileCore() retains the first namespace/key identity, resolves its authored default and supported aliases, then associates supported var(...) consumers with that identity. Newly authored identities therefore become prepared settings without requiring a matching hardcoded C# field.
The declaration owns the exported default and explicit numeric bounds. Consumer properties supply application targets, not a second defaults authority. Optional label/description remain developer metadata; player overrides cannot supply selectors, setters, types or weaker bounds. Keep finite/type/bounds checks, bounded processing and existing asset/path security intact.
FIXED STYLING IS NOT AN EDITABLE SETTING: an unannotated literal such as border-width: 0 is not automatically exported as a developer value. General framework inline bindings can take precedence over such USS literals, so successful metadata Copy does not certify identical output for every unmarked styling rule. Do not silently add metadata or copy arbitrary CSS to hide this distinction.
This compiler prepares metadata and asset references; it does not build or mutate a native runtime stylesheet, apply live player values, or write developer USS files. Runtime application and player-file/image validation belong to their existing adapters. Image/cursor rendering and platform fidelity require their own verification; successful metadata preparation is not that proof.
| bool GWG.WindowFramework.Editor.DeveloperThemeMappingCompiler.TryUpdateAuthoredValues |
( |
ThemeSourceGraph | graph, |
|
|
IReadOnlyDictionary< string, string > | values, |
|
|
IReadOnlyDictionary< string, string > | originals, |
|
|
out Dictionary< string, string > | updated, |
|
|
out string | error ) |
|
inlinestatic |
Updates explicitly edited developer defaults at their original annotated value spans.
- Parameters
-
| graph | The source graph read when the Studio form was loaded. |
| values | Changed namespace.key identities and replacement USS values only. |
| originals | Original declaring source texts captured with that graph. |
| updated | Only modified source texts, for the existing transactional writer. |
| error | Specific metadata, type, bounds or source failure. |
- Returns
- True when every requested identity is updated without replacing headers or selectors.
First annotated identity remains authoritative. Unchanged aliases and all unrelated declarations stay untouched. No source file, image or player data is written here.
ACCEPTED STUDIO CONTRACT: this uses the same metadata reader as runtime preparation, not a parallel Studio parser or another defaults authority. It returns only value-span edits for explicitly supplied identities; it never moves scoped declarations into :root, rewrites metadata headers, changes selectors, copies images or writes player files. The existing Studio transaction owns persistence, original-byte checks and failure recovery.
The user accepted the connected form and its simple workflow. Preserve the metadata format, first-identity handling and existing bounds/image rules. Further testing remains; that is not authorization for speculative hardening, schema changes or source reorganization. Make only a specifically authorized defect/requirement change and verify that change.