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
Atul Varma 2021-07-05 06:30:05 -04:00 zatwierdzone przez GitHub
rodzic f7bc1bdc56
commit 7d53e97262
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 8 dodań i 0 usunięć

Wyświetl plik

@ -13,6 +13,7 @@ export const ATTACHMENT_POINT_COLORS: {
arm: "#00ff00",
horn: "#00ffff",
crown: "#0000ff",
wildcard: "#000000",
};
export const NESTING_BOUNDING_BOX_COLOR = "#ff00ff";

Wyświetl plik

@ -64,6 +64,11 @@ const ATTACHMENT_SYMBOLS: AttachmentSymbolMap = (() => {
result[type] = SvgVocabulary.items.filter((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 (!meta) return true;

Wyświetl plik

@ -19,6 +19,7 @@ type AttachmentPointSpecs = {
arm: PointWithNormal[];
horn: PointWithNormal[];
crown: PointWithNormal[];
wildcard: PointWithNormal[];
};
type FullSpecs = AttachmentPointSpecs & {
@ -41,6 +42,7 @@ export const ATTACHMENT_POINT_TYPES: AttachmentPointType[] = [
"arm",
"horn",
"crown",
"wildcard",
];
const ATTACHMENT_POINT_SET = new Set(ATTACHMENT_POINT_TYPES);