Skip to content

Commit 271a0f6

Browse files
committed
🚧 Add extraction confirmation
1 parent 0070b9c commit 271a0f6

File tree

4 files changed

+2783
-9
lines changed

4 files changed

+2783
-9
lines changed

src/interface/animatedJavaBarItem.ts

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@ function createIconImg() {
2424
})
2525
return IMG
2626
}
27+
const MENU_ID = `${PACKAGE.name}:menu` as `animated_java:menu`
2728
const BLOCKBENCH_MENU_BAR = document.querySelector('#menu_bar') as HTMLDivElement
28-
export const MENU = createBarMenu(
29-
`${PACKAGE.name}:menu`,
30-
[],
31-
() => Format === BLUEPRINT_FORMAT
32-
) as BarMenu & { label: HTMLDivElement }
29+
export const MENU = createBarMenu(MENU_ID, [], () => Format === BLUEPRINT_FORMAT) as BarMenu & {
30+
label: HTMLDivElement
31+
}
3332
MENU.label.style.display = 'inline-block'
3433
MENU.label.innerHTML = 'Animated Java'
3534
MENU.label.prepend(createIconImg())
@@ -74,19 +73,30 @@ MenuBar.addAction(
7473
MENU.id
7574
)
7675

76+
MenuBar.menus[MENU_ID].structure.push({
77+
id: 'animated_java:extract-open',
78+
name: translate('action.extract.name'),
79+
icon: 'fa-trash-can',
80+
searchable: false,
81+
children: [],
82+
condition() {
83+
return Format === BLUEPRINT_FORMAT
84+
},
85+
})
86+
7787
MenuBar.addAction(
7888
createAction(`${PACKAGE.name}:extract`, {
7989
icon: 'fa-trash-can',
8090
category: 'animated_java',
81-
name: translate('action.extract.name'),
91+
name: translate('action.extract.confirm'),
8292
condition() {
8393
return Format === BLUEPRINT_FORMAT
8494
},
8595
click() {
8696
void cleanupExportedFiles()
8797
},
8898
}),
89-
MENU.id
99+
MENU_ID + '.animated_java:extract-open'
90100
)
91101

92102
MenuBar.addAction(

src/lang/en.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ animated_java.action.open_locator_config.name: Locator Config
77
animated_java.action.open_text_display_config.name: Text Display Config
88
animated_java.action.export.name: Export
99
animated_java.action.extract.name: Extract
10+
animated_java.action.extract.confirm: Confirm Extraction
1011
animated_java.action.create_text_display.title: Add Text Display
1112
animated_java.action.create_vanilla_item_display.title: Add Item Display
1213
animated_java.action.create_vanilla_block_display.title: Add Block Display

0 commit comments

Comments
 (0)