From 25bb0978f624c9e529bc82435cb9feb05bc30e31 Mon Sep 17 00:00:00 2001 From: Zoinkwiz Date: Mon, 25 Nov 2024 23:35:33 +0000 Subject: [PATCH] fix: Make helper editing available via command --- .../com/questhelper/QuestHelperPlugin.java | 6 ++- .../questhelper/panel/QuestHelperPanel.java | 48 +++++-------------- 2 files changed, 17 insertions(+), 37 deletions(-) diff --git a/src/main/java/com/questhelper/QuestHelperPlugin.java b/src/main/java/com/questhelper/QuestHelperPlugin.java index 5fe5114570..93a7f00b47 100644 --- a/src/main/java/com/questhelper/QuestHelperPlugin.java +++ b/src/main/java/com/questhelper/QuestHelperPlugin.java @@ -413,10 +413,14 @@ else if (developerMode && commandExecuted.getCommand().equals("qh-inv")) } System.out.println(inv); } - else if (commandExecuted.getCommand().equals("import-quest")) + else if (commandExecuted.getCommand().equals("import-helper")) { questHelperSharingManager.promptForImport(); } + else if (commandExecuted.getCommand().equals("helper-editor")) + { + panel.toggleQuestCreator(); + } } @Subscribe(priority = 100) diff --git a/src/main/java/com/questhelper/panel/QuestHelperPanel.java b/src/main/java/com/questhelper/panel/QuestHelperPanel.java index fc5e9a2126..00bd91ff05 100644 --- a/src/main/java/com/questhelper/panel/QuestHelperPanel.java +++ b/src/main/java/com/questhelper/panel/QuestHelperPanel.java @@ -153,37 +153,6 @@ public QuestHelperPanel(QuestHelperPlugin questHelperPlugin, QuestManager questM final JPanel viewControls = new JPanel(new GridLayout(1, 3, 10, 0)); viewControls.setBackground(ColorScheme.DARK_GRAY_COLOR); - // Make Helper Button - JButton makeHelperButton = new JButton(); - SwingUtil.removeButtonDecorations(makeHelperButton); - makeHelperButton.setIcon(SETTINGS_ICON); - makeHelperButton.setToolTipText("Make a new helper"); - makeHelperButton.setBackground(ColorScheme.DARK_GRAY_COLOR); - makeHelperButton.setUI(new BasicButtonUI()); - makeHelperButton.addActionListener((ev) -> { - toggleQuestCreator(); - }); - makeHelperButton.addMouseListener(new java.awt.event.MouseAdapter() - { - public void mouseEntered(java.awt.event.MouseEvent evt) - { - makeHelperButton.setBackground(ColorScheme.DARK_GRAY_HOVER_COLOR); - } - - public void mouseExited(java.awt.event.MouseEvent evt) - { - if (settingsPanelActive) - { - makeHelperButton.setBackground(ColorScheme.LIGHT_GRAY_COLOR); - } - else - { - makeHelperButton.setBackground(ColorScheme.DARK_GRAY_COLOR); - } - } - }); - viewControls.add(makeHelperButton); - // Settings JButton settingsBtn = new JButton(); SwingUtil.removeButtonDecorations(settingsBtn); @@ -192,7 +161,17 @@ public void mouseExited(java.awt.event.MouseEvent evt) settingsBtn.setBackground(ColorScheme.DARK_GRAY_COLOR); settingsBtn.setUI(new BasicButtonUI()); settingsBtn.addActionListener((ev) -> { - toggleQuestCreator(); + assistLevelPanel.rebuild(null, configManager, this); + if (settingsPanelActive) + { + settingsBtn.setBackground(ColorScheme.LIGHT_GRAY_COLOR); + deactivateSettings(); + } + else + { + settingsBtn.setBackground(ColorScheme.DARK_GRAY_COLOR); + activateSettings(); + } }); settingsBtn.addMouseListener(new java.awt.event.MouseAdapter() { @@ -343,9 +322,6 @@ public void changedUpdate(DocumentEvent e) JPanel orderPanel = makeDropdownPanel(orderDropdown, "Ordering"); orderPanel.setPreferredSize(new Dimension(PANEL_WIDTH, DROPDOWN_HEIGHT)); - JPanel assistanceToggles = new JPanel(); - - // Skill filtering SkillFilterPanel skillFilterPanel = new SkillFilterPanel(questHelperPlugin.skillIconManager, questHelperPlugin.getConfigManager()); skillFilterPanel.setVisible(false); @@ -454,7 +430,7 @@ private void onSearchBarChanged() revalidate(); } - private void toggleQuestCreator() + public void toggleQuestCreator() { creatorFrame.setVisible(!creatorFrame.isVisible()); }