@@ -7,6 +7,7 @@ import { createAction, createBarMenu } from '../util/moddingTools'
77import { translate } from '../util/translation'
88import { openAboutDialog } from './aboutDialog'
99import { openBlueprintSettingsDialog } from './blueprintSettingsDialog'
10+ import { openChangelogDialog } from './changelogDialog'
1011
1112function createIconImg ( ) {
1213 const IMG = document . createElement ( 'img' )
@@ -24,12 +25,11 @@ function createIconImg() {
2425 } )
2526 return IMG
2627}
28+ const MENU_ID = `${ PACKAGE . name } :menu` as `animated_java:menu`
2729const 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 }
30+ export const MENU = createBarMenu ( MENU_ID , [ ] , ( ) => Format === BLUEPRINT_FORMAT ) as BarMenu & {
31+ label : HTMLDivElement
32+ }
3333MENU . label . style . display = 'inline-block'
3434MENU . label . innerHTML = 'Animated Java'
3535MENU . label . prepend ( createIconImg ( ) )
@@ -59,6 +59,20 @@ MenuBar.addAction(
5959 MENU . id
6060)
6161
62+ MenuBar . addAction (
63+ createAction ( `${ PACKAGE . name } :changelog` , {
64+ icon : 'history' ,
65+ category : 'animated_java' ,
66+ name : translate ( 'action.open_changelog.name' ) ,
67+ click ( ) {
68+ openChangelogDialog ( )
69+ } ,
70+ } ) ,
71+ MENU . id
72+ )
73+
74+ MENU . structure . push ( new MenuSeparator ( ) )
75+
6276MenuBar . addAction (
6377 createAction ( `${ PACKAGE . name } :blueprint_settings` , {
6478 icon : 'settings' ,
@@ -74,6 +88,32 @@ MenuBar.addAction(
7488 MENU . id
7589)
7690
91+ MenuBar . menus [ MENU_ID ] . structure . push ( {
92+ id : 'animated_java:extract-open' ,
93+ name : translate ( 'action.extract.name' ) ,
94+ icon : 'fa-trash-can' ,
95+ searchable : false ,
96+ children : [ ] ,
97+ condition ( ) {
98+ return Format === BLUEPRINT_FORMAT
99+ } ,
100+ } )
101+
102+ MenuBar . addAction (
103+ createAction ( `${ PACKAGE . name } :extract` , {
104+ icon : 'fa-trash-can' ,
105+ category : 'animated_java' ,
106+ name : translate ( 'action.extract.confirm' ) ,
107+ condition ( ) {
108+ return Format === BLUEPRINT_FORMAT
109+ } ,
110+ click ( ) {
111+ void cleanupExportedFiles ( )
112+ } ,
113+ } ) ,
114+ MENU_ID + '.animated_java:extract-open'
115+ )
116+
77117MenuBar . addAction (
78118 createAction ( `${ PACKAGE . name } :extract` , {
79119 icon : 'fa-trash-can' ,
0 commit comments