Skip to content

Commit 1b4d36b

Browse files
committed
🎨 No more Vanilla prefix for display entity elements!
1 parent e79dfa8 commit 1b4d36b

File tree

7 files changed

+28
-26
lines changed

7 files changed

+28
-26
lines changed

src/blockbench-additions/outliner-elements/blockDisplay.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ interface BlockDisplayOptions {
3737
visibility?: boolean
3838
}
3939

40+
@fixClassPropertyInheritance
4041
export class BlockDisplay extends ResizableOutlinerElement {
41-
static type = `${PACKAGE.name}:vanilla_block_display`
42+
static type = `${PACKAGE.name}:block_display`
4243
static selected: BlockDisplay[] = []
4344
static all: BlockDisplay[] = []
4445

@@ -417,8 +418,8 @@ createBlockbenchMod(
417418
}
418419
)
419420

420-
export const CREATE_ACTION = createAction(`${PACKAGE.name}:create_vanilla_block_display`, {
421-
name: translate('action.create_vanilla_block_display.title'),
421+
export const CREATE_ACTION = createAction(`${PACKAGE.name}:create_block_display`, {
422+
name: translate('action.create_block_display.title'),
422423
icon: 'deployed_code',
423424
category: 'animated_java',
424425
condition() {

src/blockbench-additions/outliner-elements/itemDisplay.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ interface ItemDisplayOptions {
2222
visibility?: boolean
2323
}
2424

25+
@fixClassPropertyInheritance
2526
export class ItemDisplay extends ResizableOutlinerElement {
26-
static type = `${PACKAGE.name}:vanilla_item_display`
27+
static type = `${PACKAGE.name}:item_display`
2728
static selected: ItemDisplay[] = []
2829
static all: ItemDisplay[] = []
2930

@@ -405,8 +406,8 @@ createBlockbenchMod(
405406
}
406407
)
407408

408-
export const CREATE_ACTION = createAction(`${PACKAGE.name}:create_vanilla_item_display`, {
409-
name: translate('action.create_vanilla_item_display.title'),
409+
export const CREATE_ACTION = createAction(`${PACKAGE.name}:create_item_display`, {
410+
name: translate('action.create_item_display.title'),
410411
icon: 'icecream',
411412
category: 'animated_java',
412413
condition() {

src/systems/datapack-compiler/tags.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export namespace TAGS {
2222

2323
export const GLOBAL_NODE = () => 'aj.global.node'
2424
export const GLOBAL_DISPLAY_NODE = () => 'aj.global.display_node'
25-
export const GLOBAL_VANILLA_DISPLAY_NODE = () => 'aj.global.vanilla_display_node'
25+
export const GLOBAL_VANILLA_DISPLAY_NODE = () => 'aj.global.display_node'
2626
export const GLOBAL_BONE = () => 'aj.global.bone'
2727
export const GLOBAL_ITEM_DISPLAY = () => 'aj.global.item_display'
2828
export const GLOBAL_BLOCK_DISPLAY = () => 'aj.global.block_display'
@@ -97,7 +97,7 @@ export namespace TAGS {
9797
export const PROJECT_DISPLAY_NODE = () =>
9898
`aj.${createTagPrefixFromBlueprintID(Project!.animated_java.id)}.display_node`
9999
export const PROJECT_VANILLA_DISPLAY_NODE = () =>
100-
`aj.${createTagPrefixFromBlueprintID(Project!.animated_java.id)}.vanilla_display_node`
100+
`aj.${createTagPrefixFromBlueprintID(Project!.animated_java.id)}.display_node`
101101
export const PROJECT_BONE = () =>
102102
`aj.${createTagPrefixFromBlueprintID(Project!.animated_java.id)}.bone`
103103
export const PROJECT_ITEM_DISPLAY = () =>

src/ui/dialogs/block-display-config/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function openBlockDisplayConfigDialog(display: BlockDisplay) {
3131

3232
new SvelteDialog({
3333
id: `${PACKAGE.name}:vanillaItemDisplayConfigDialog`,
34-
title: translate('dialog.vanilla_block_display_config.title'),
34+
title: translate('dialog.block_display_config.title'),
3535
width: 400,
3636
component: BlockDisplayConfigDialog,
3737
props: {
@@ -96,10 +96,10 @@ export function openBlockDisplayConfigDialog(display: BlockDisplay) {
9696
}
9797

9898
export const VANILLA_BLOCK_DISPLAY_CONFIG_ACTION = createAction(
99-
`${PACKAGE.name}:open_vanilla_block_display_config`,
99+
`${PACKAGE.name}:open_block_display_config`,
100100
{
101101
icon: 'settings',
102-
name: translate('action.open_vanilla_block_display_config.name'),
102+
name: translate('action.open_block_display_config.name'),
103103
condition: () => isCurrentFormat(),
104104
click: () => {
105105
if (BlockDisplay.selected.length === 0) return

src/ui/dialogs/item-display-config/index.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { isCurrentFormat } from '../../blueprintFormat'
2-
import VanillaItemDisplayElementPanel from '../../svelte/vanillaItemDisplayElementPanel.svelte'
2+
import ItemDisplayElementPanel from '../../svelte/itemDisplayElementPanel.svelte'
33
import { PACKAGE } from '../../constants'
4-
import { ItemDisplayMode, VanillaItemDisplay } from '../../outliner/vanillaItemDisplay'
4+
import { ItemDisplayMode, ItemDisplay } from '../../outliner/itemDisplay'
55
import { events } from '../../util/events'
66
import { injectSvelteCompomponentMod } from '../../util/injectSvelteComponent'
77
import { translate } from '../../util/translation'
88

99
injectSvelteCompomponentMod({
10-
component: VanillaItemDisplayElementPanel,
10+
component: ItemDisplayElementPanel,
1111
props: {},
1212
elementSelector() {
1313
return document.querySelector('#panel_element')
@@ -20,7 +20,7 @@ export const ITEM_DISPLAY_ITEM_DISPLAY_SELECT = new BarSelect(
2020
name: translate('tool.item_display.item_display.title'),
2121
icon: 'format_align_left',
2222
description: translate('tool.item_display.item_display.description'),
23-
condition: () => isCurrentFormat() && !!VanillaItemDisplay.selected.length,
23+
condition: () => isCurrentFormat() && !!ItemDisplay.selected.length,
2424
options: {
2525
none: translate('tool.item_display.item_display.options.none'),
2626
thirdperson_lefthand: translate(
@@ -43,15 +43,15 @@ export const ITEM_DISPLAY_ITEM_DISPLAY_SELECT = new BarSelect(
4343
}
4444
)
4545
ITEM_DISPLAY_ITEM_DISPLAY_SELECT.get = function () {
46-
const selected = VanillaItemDisplay.selected[0]
46+
const selected = ItemDisplay.selected[0]
4747
if (!selected) return 'left'
4848
return selected.itemDisplay
4949
}
5050
ITEM_DISPLAY_ITEM_DISPLAY_SELECT.set = function (
5151
this: BarSelect<ItemDisplayMode>,
5252
value: ItemDisplayMode
5353
) {
54-
const selected = VanillaItemDisplay.selected.at(0)
54+
const selected = ItemDisplay.selected.at(0)
5555
if (!selected) return this
5656
this.value = value
5757
const name = this.getNameFor(value)
@@ -64,23 +64,23 @@ ITEM_DISPLAY_ITEM_DISPLAY_SELECT.set = function (
6464

6565
if (selected.itemDisplay === value) return this
6666

67-
Undo.initEdit({ elements: VanillaItemDisplay.selected })
68-
if (VanillaItemDisplay.selected.length > 1) {
69-
for (const display of VanillaItemDisplay.selected) {
67+
Undo.initEdit({ elements: ItemDisplay.selected })
68+
if (ItemDisplay.selected.length > 1) {
69+
for (const display of ItemDisplay.selected) {
7070
display.itemDisplay = value
7171
}
7272
} else {
7373
selected.itemDisplay = value
7474
}
7575
Project!.saved = false
7676
Undo.finishEdit(`Change Item Display Node's Item Display Mode to ${value}`, {
77-
elements: VanillaItemDisplay.selected,
77+
elements: ItemDisplay.selected,
7878
})
7979
return this
8080
}
8181
function updateItemDisplaySelect() {
8282
console.log('updateItemDisplaySelect')
83-
let value = VanillaItemDisplay.selected.at(0)?.itemDisplay
83+
let value = ItemDisplay.selected.at(0)?.itemDisplay
8484
value ??= 'none'
8585
ITEM_DISPLAY_ITEM_DISPLAY_SELECT.set(value)
8686
}

src/ui/panels/block-display-element/vanillaBlockDisplayElementPanel.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
</script>
2525

2626
<p class="panel_toolbar_label label" style={!!visible ? '' : 'visibility:hidden; height: 0px;'}>
27-
{translate('panel.vanilla_block_display.title')}
27+
{translate('panel.block_display.title')}
2828
</p>
2929

3030
<div
3131
class="toolbar custom-toolbar"
3232
style={!!visible ? '' : 'visibility:hidden; height: 0px;'}
33-
title={translate('panel.vanilla_block_display.description')}
33+
title={translate('panel.block_display.description')}
3434
>
3535
<div class="content" style="width: 95%;">
3636
<input type="text" bind:value={$block} />

src/ui/panels/item-display-element/vanillaItemDisplayElementPanel.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131
</script>
3232

3333
<p class="panel_toolbar_label label" style={!!visible ? '' : 'visibility:hidden; height: 0px;'}>
34-
{translate('panel.vanilla_item_display.title')}
34+
{translate('panel.item_display.title')}
3535
</p>
3636

3737
<div
3838
class="toolbar custom-toolbar"
3939
style={!!visible ? '' : 'visibility:hidden; height: 0px;'}
40-
title={translate('panel.vanilla_item_display.description')}
40+
title={translate('panel.item_display.description')}
4141
>
4242
<div class="content" style="width: 95%;">
4343
<input type="text" bind:value={$item} />

0 commit comments

Comments
 (0)