@@ -102,35 +102,7 @@ function getDivider(): MenuItem {
102102 * Generates menu items for a given project.
103103 */
104104function getMenuItems ( t : ( key : string ) => string , project : storageProject . Project , currentLanguage : string ) : MenuItem [ ] {
105- const mechanisms : MenuItem [ ] = [ ] ;
106- const opmodes : MenuItem [ ] = [ ] ;
107-
108- // Build mechanisms menu items
109- project . mechanisms . forEach ( ( mechanism ) => {
110- mechanisms . push ( getItem (
111- mechanism . className ,
112- mechanism . modulePath ,
113- < BlockOutlined />
114- ) ) ;
115- } ) ;
116- if ( mechanisms . length > 0 ) {
117- mechanisms . push ( getDivider ( ) ) ;
118- }
119- mechanisms . push ( getItem ( 'Manage...' , 'manageMechanisms' ) ) ;
120-
121- // Build opmodes menu items
122- project . opModes . forEach ( ( opmode ) => {
123- opmodes . push ( getItem (
124- opmode . className ,
125- opmode . modulePath ,
126- < CodeOutlined />
127- ) ) ;
128- } ) ;
129- if ( opmodes . length > 0 ) {
130- opmodes . push ( getDivider ( ) ) ;
131- }
132- opmodes . push ( getItem ( 'Manage...' , 'manageOpmodes' ) ) ;
133-
105+
134106 return [
135107 getItem ( t ( 'PROJECT' ) , 'project' , < FolderOutlined /> , [
136108 getItem ( t ( 'SAVE' ) , 'save' , < SaveOutlined /> ) ,
@@ -140,8 +112,8 @@ function getMenuItems(t: (key: string) => string, project: storageProject.Projec
140112 ] ) ,
141113 getItem ( t ( 'EXPLORER' ) , 'explorer' , < FileOutlined /> , [
142114 getItem ( t ( 'ROBOT' ) , project . robot . modulePath , < RobotOutlined /> ) ,
143- getItem ( t ( 'MECHANISMS' ) , 'mechanisms ' , < BlockOutlined /> , mechanisms ) ,
144- getItem ( t ( 'OPMODES' ) , 'opmodes ' , < CodeOutlined /> , opmodes ) ,
115+ getItem ( t ( 'MECHANISMS' ) + '...' , 'manageMechanisms ' , < BlockOutlined /> ) ,
116+ getItem ( t ( 'OPMODES' ) + '...' , 'manageOpmodes ' , < CodeOutlined /> ) ,
145117 ] ) ,
146118 getItem ( t ( 'SETTINGS' ) , 'settings' , < SettingOutlined /> , [
147119 getItem ( t ( 'WPI_TOOLBOX' ) , 'wpi_toolbox' ) ,
0 commit comments