Add a 'wildcard' (neutral) attachment point type. (#200)
This adds a new attachment point type called `wildcard` (colored `#000000` in the SVGs) which, as the name suggests, can contain _any_ kind of symbol. Fixes #187.pull/202/head
rodzic
f7bc1bdc56
commit
7d53e97262
|
@ -13,6 +13,7 @@ export const ATTACHMENT_POINT_COLORS: {
|
||||||
arm: "#00ff00",
|
arm: "#00ff00",
|
||||||
horn: "#00ffff",
|
horn: "#00ffff",
|
||||||
crown: "#0000ff",
|
crown: "#0000ff",
|
||||||
|
wildcard: "#000000",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const NESTING_BOUNDING_BOX_COLOR = "#ff00ff";
|
export const NESTING_BOUNDING_BOX_COLOR = "#ff00ff";
|
||||||
|
|
|
@ -64,6 +64,11 @@ const ATTACHMENT_SYMBOLS: AttachmentSymbolMap = (() => {
|
||||||
result[type] = SvgVocabulary.items.filter((data) => {
|
result[type] = SvgVocabulary.items.filter((data) => {
|
||||||
const { meta } = data;
|
const { meta } = data;
|
||||||
|
|
||||||
|
if (type === "wildcard") {
|
||||||
|
// The wildcard attachment point type can have anything!
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// If we have no metadata whatsoever, it can attach anywhere.
|
// If we have no metadata whatsoever, it can attach anywhere.
|
||||||
if (!meta) return true;
|
if (!meta) return true;
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ type AttachmentPointSpecs = {
|
||||||
arm: PointWithNormal[];
|
arm: PointWithNormal[];
|
||||||
horn: PointWithNormal[];
|
horn: PointWithNormal[];
|
||||||
crown: PointWithNormal[];
|
crown: PointWithNormal[];
|
||||||
|
wildcard: PointWithNormal[];
|
||||||
};
|
};
|
||||||
|
|
||||||
type FullSpecs = AttachmentPointSpecs & {
|
type FullSpecs = AttachmentPointSpecs & {
|
||||||
|
@ -41,6 +42,7 @@ export const ATTACHMENT_POINT_TYPES: AttachmentPointType[] = [
|
||||||
"arm",
|
"arm",
|
||||||
"horn",
|
"horn",
|
||||||
"crown",
|
"crown",
|
||||||
|
"wildcard",
|
||||||
];
|
];
|
||||||
|
|
||||||
const ATTACHMENT_POINT_SET = new Set(ATTACHMENT_POINT_TYPES);
|
const ATTACHMENT_POINT_SET = new Set(ATTACHMENT_POINT_TYPES);
|
||||||
|
|
Ładowanie…
Reference in New Issue