-
Notifications
You must be signed in to change notification settings - Fork 814
将世界管理界面“生成启动脚本”按钮折叠到二级菜单 #5198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
将世界管理界面“生成启动脚本”按钮折叠到二级菜单 #5198
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -112,7 +112,6 @@ public WorldManagePage(World world, Path backupsDir, Profile profile, String id) | |||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| if (world.getGameVersion() != null && world.getGameVersion().isAtLeast("1.20", "23w14a")) { | ||||||||||||||||||||||||
| toolbar.addNavigationDrawerItem(i18n("version.launch"), SVG.ROCKET_LAUNCH, this::launch, advancedListItem -> advancedListItem.setDisable(isReadOnly())); | ||||||||||||||||||||||||
| toolbar.addNavigationDrawerItem(i18n("version.launch_script"), SVG.SCRIPT, this::generateLaunchScript, null); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| if (ChunkBaseApp.isSupported(world)) { | ||||||||||||||||||||||||
|
|
@@ -144,6 +143,14 @@ public WorldManagePage(World world, Path backupsDir, Profile profile, String id) | |||||||||||||||||||||||
| PopupMenu managePopupMenu = new PopupMenu(); | ||||||||||||||||||||||||
| JFXPopup managePopup = new JFXPopup(managePopupMenu); | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| if (world.getGameVersion() != null && world.getGameVersion().isAtLeast("1.20", "23w14a")) { | ||||||||||||||||||||||||
| managePopupMenu.getContent().addAll( | ||||||||||||||||||||||||
| new IconedMenuItem(SVG.ROCKET_LAUNCH, i18n("version.launch"), this::launch, managePopup), | ||||||||||||||||||||||||
| new IconedMenuItem(SVG.SCRIPT, i18n("version.launch_script"), this::generateLaunchScript, managePopup), | ||||||||||||||||||||||||
| new MenuSeparator() | ||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
Comment on lines
+149
to
+153
|
||||||||||||||||||||||||
| new IconedMenuItem(SVG.SCRIPT, i18n("version.launch_script"), this::generateLaunchScript, managePopup), | |
| new MenuSeparator() | |
| ); | |
| } | |
| new IconedMenuItem(SVG.SCRIPT, i18n("version.launch_script"), this::generateLaunchScript, managePopup) | |
| ); | |
| } | |
| if (managePopupMenu.getContent().size() > 1) { | |
| managePopupMenu.getContent().add(new MenuSeparator()); | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version check condition is duplicated on lines 113 and 146. Consider extracting this to a local variable or method to avoid code duplication and improve maintainability. For example, you could add a boolean variable before the toolbar creation to store this condition result.