Skip to content

Commit

Permalink
fix: Make helper editing available via command
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoinkwiz committed Nov 25, 2024
1 parent bfdae8c commit 25bb097
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 37 deletions.
6 changes: 5 additions & 1 deletion src/main/java/com/questhelper/QuestHelperPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
48 changes: 12 additions & 36 deletions src/main/java/com/questhelper/panel/QuestHelperPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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()
{
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -454,7 +430,7 @@ private void onSearchBarChanged()
revalidate();
}

private void toggleQuestCreator()
public void toggleQuestCreator()
{
creatorFrame.setVisible(!creatorFrame.isVisible());
}
Expand Down

0 comments on commit 25bb097

Please sign in to comment.