|
1 | 1 | import { registerPatch, registerPropertyOverridePatch } from 'blockbench-patch-manager' |
2 | | -import { |
3 | | - activeProjectIsBlueprintFormat, |
4 | | - type IBlueprintDisplayEntityConfigJSON, |
5 | | -} from '../formats/blueprint' |
| 2 | +import { activeProjectIsBlueprintFormat } from '../formats/blueprint' |
6 | 3 | import { DisplayEntityConfig } from '../nodeConfigs' |
7 | 4 | import { sanitizeOutlinerElementName } from '../outliner/util' |
| 5 | +import type { IDisplayEntityConfigs } from '../systems/rigRenderer' |
| 6 | +import { localize } from '../util/lang' |
8 | 7 | import { DeepClonedObjectProperty } from '../util/property' |
9 | 8 |
|
10 | 9 | declare global { |
11 | 10 | // @ts-expect-error - Broken BB types |
12 | 11 | interface Group { |
13 | 12 | onSummonFunction: string |
14 | | - configs: { |
15 | | - default: IBlueprintDisplayEntityConfigJSON |
16 | | - /** |
17 | | - * @key Variant UUID |
18 | | - * @value Variant Bone Config |
19 | | - */ |
20 | | - variants: Record<string, IBlueprintDisplayEntityConfigJSON> |
21 | | - } |
| 13 | + configs: IDisplayEntityConfigs |
22 | 14 | } |
23 | 15 | } |
24 | 16 |
|
| 17 | +registerPropertyOverridePatch({ |
| 18 | + id: `animated_java:structure-group-icon`, |
| 19 | + target: Group.prototype, |
| 20 | + key: 'icon', |
| 21 | + |
| 22 | + get: function (this, original) { |
| 23 | + if (activeProjectIsBlueprintFormat()) { |
| 24 | + if (this.children.some(child => child instanceof Cube)) { |
| 25 | + return original |
| 26 | + } |
| 27 | + return 'account_tree' |
| 28 | + } |
| 29 | + return original |
| 30 | + }, |
| 31 | +}) |
| 32 | + |
| 33 | +registerPropertyOverridePatch({ |
| 34 | + id: `animated_java:structure-group-title`, |
| 35 | + target: Group.prototype, |
| 36 | + key: 'title', |
| 37 | + |
| 38 | + get: function (this, original) { |
| 39 | + if (activeProjectIsBlueprintFormat()) { |
| 40 | + if (this.children.some(child => child instanceof Cube)) { |
| 41 | + return original |
| 42 | + } |
| 43 | + return localize('outliner.structure_group.title') |
| 44 | + } |
| 45 | + return original |
| 46 | + }, |
| 47 | +}) |
| 48 | + |
25 | 49 | // region Properties |
26 | 50 | registerPatch({ |
27 | 51 | id: `animated_java:bone-properties`, |
|
0 commit comments