Add support for never_be_nested metadata.
rodzic
c62214186b
commit
b1b0176e4a
|
@ -39,7 +39,10 @@ const ATTACHMENT_SYMBOLS = ROOT_SYMBOLS;
|
||||||
|
|
||||||
/** Symbols that can be nested within any part of a creature. */
|
/** Symbols that can be nested within any part of a creature. */
|
||||||
const NESTED_SYMBOLS = SvgVocabulary.filter(
|
const NESTED_SYMBOLS = SvgVocabulary.filter(
|
||||||
(data) => data.meta?.always_nest !== true
|
// Since we don't currently support recursive nesting, ignore anything that
|
||||||
|
// wants nested children.
|
||||||
|
(data) =>
|
||||||
|
data.meta?.always_nest !== true && data.meta?.never_be_nested !== true
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -10,11 +10,18 @@ type SvgSymbolMetadataBooleans = {
|
||||||
* be nested inside another symbol's nesting area.
|
* be nested inside another symbol's nesting area.
|
||||||
*/
|
*/
|
||||||
always_be_nested?: boolean;
|
always_be_nested?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If true, this indicates that the symbol should never
|
||||||
|
* be nested inside another symbol's nesting area.
|
||||||
|
*/
|
||||||
|
never_be_nested?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const METADATA_BOOLEANS: Set<keyof SvgSymbolMetadataBooleans> = new Set([
|
const METADATA_BOOLEANS: Set<keyof SvgSymbolMetadataBooleans> = new Set([
|
||||||
"always_nest",
|
"always_nest",
|
||||||
"always_be_nested",
|
"always_be_nested",
|
||||||
|
"never_be_nested",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
function isSvgSymbolMetadataBoolean(
|
function isSvgSymbolMetadataBoolean(
|
||||||
|
|
|
@ -15,3 +15,7 @@ always_nest = false
|
||||||
# If true, this indicates that the symbol should always
|
# If true, this indicates that the symbol should always
|
||||||
# be nested inside another symbol's nesting area.
|
# be nested inside another symbol's nesting area.
|
||||||
always_be_nested = false
|
always_be_nested = false
|
||||||
|
|
||||||
|
# If true, this indicates that the symbol should never
|
||||||
|
# be nested inside another symbol's nesting area.
|
||||||
|
never_be_nested = false
|
||||||
|
|
Ładowanie…
Reference in New Issue