diff --git a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/chat/ChatFilterPanel.java b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/chat/ChatFilterPanel.java index 565f0af8..9609d663 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/chat/ChatFilterPanel.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/chat/ChatFilterPanel.java @@ -1,6 +1,7 @@ package com.mercury.platform.ui.components.panel.chat; import com.mercury.platform.shared.events.EventRouter; +import com.mercury.platform.shared.events.custom.ChatFilterMessageEvent; import com.mercury.platform.ui.components.ComponentsFactory; import com.mercury.platform.ui.components.fields.style.MercuryScrollBarUI; import com.mercury.platform.ui.components.panel.VerticalScrollContainer; @@ -25,6 +26,7 @@ public class ChatFilterPanel extends JPanel { private HtmlMessageBuilder messageBuilder; private boolean scrollToBottom = true; + private boolean soundEnable = false; private JPanel container; public ChatFilterPanel() { this.componentsFactory = new ComponentsFactory(); @@ -88,6 +90,10 @@ public void scrollToBottom(boolean value) { } } + public void sound(boolean enable){ + this.soundEnable = enable; + } + private void addMessageToFilter(String message) { if(!message.isEmpty()){ String nickname = StringUtils.substringBefore(message, ":"); @@ -105,6 +111,9 @@ private void addMessageToFilter(String message) { trimContainer(); expiresMessages.put(nickname,message); EventRouter.UI.fireEvent(new PackEvent.PackChatFilter()); + if(soundEnable){ + EventRouter.CORE.fireEvent(new ChatFilterMessageEvent()); + } if(scrollToBottom) { container.scrollRectToVisible(new Rectangle(0, container.getHeight() - 1, 1, 1)); } diff --git a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/chat/ChatMessagePanel.java b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/chat/ChatMessagePanel.java index 55e516ce..52df271e 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/chat/ChatMessagePanel.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/chat/ChatMessagePanel.java @@ -32,7 +32,7 @@ public ChatMessagePanel( this.message = message; this.componentsFactory = componentsFactory; - this.setBorder(BorderFactory.createEmptyBorder(2,4,2,2)); + this.setBorder(BorderFactory.createEmptyBorder(2,2,2,2)); this.setBackground(AppThemeColor.TRANSPARENT); createUI(); } diff --git a/app-ui/src/main/java/com/mercury/platform/ui/frame/titled/SettingsFrame.java b/app-ui/src/main/java/com/mercury/platform/ui/frame/titled/SettingsFrame.java index 31d99add..020c2235 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/frame/titled/SettingsFrame.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/frame/titled/SettingsFrame.java @@ -47,7 +47,7 @@ private void initContainer() { tabbedPane.addTab("General",generalSettings); tabbedPane.addTab("Notification panel",cbSettings); tabbedPane.addTab("Task panel",taskBarSettings); - // tabbedPane.addTab("Help",new HelpPanel()); + tabbedPane.addTab("Help",new HelpPanel()); tabbedPane.addTab("Support",new SupportPanel()); tabbedPane.addTab("About",new AboutPanel()); diff --git a/app-ui/src/main/java/com/mercury/platform/ui/frame/titled/TitledComponentFrame.java b/app-ui/src/main/java/com/mercury/platform/ui/frame/titled/TitledComponentFrame.java index 07a5df0e..522bfe82 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/frame/titled/TitledComponentFrame.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/frame/titled/TitledComponentFrame.java @@ -13,7 +13,7 @@ */ public abstract class TitledComponentFrame extends ComponentFrame { protected JPanel miscPanel; - private JButton hideButton; + protected JButton hideButton; private JLabel frameTitleLabel; protected TitledComponentFrame(String title) { super(title); @@ -45,7 +45,7 @@ private void initHeaderPanel(){ headerPanel.add(frameTitleLabel, BorderLayout.CENTER); miscPanel.setBackground(AppThemeColor.TRANSPARENT); - hideButton = componentsFactory.getIconButton("app/close.png", 14, AppThemeColor.FRAME_ALPHA, ""); + hideButton = componentsFactory.getIconButton("app/close.png", 14, AppThemeColor.FRAME_ALPHA, "Hide"); hideButton.setBorder(BorderFactory.createEmptyBorder(0,0,0,2)); hideButton.addMouseListener(new MouseAdapter() { @Override diff --git a/app-ui/src/main/java/com/mercury/platform/ui/frame/titled/chat/ChatFilterFrame.java b/app-ui/src/main/java/com/mercury/platform/ui/frame/titled/chat/ChatFilterFrame.java index a5e0b90d..d5a2b095 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/frame/titled/chat/ChatFilterFrame.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/frame/titled/chat/ChatFilterFrame.java @@ -2,10 +2,8 @@ import com.mercury.platform.core.utils.interceptor.MessageInterceptor; import com.mercury.platform.core.utils.interceptor.filter.MessageFilter; -import com.mercury.platform.shared.ConfigManager; import com.mercury.platform.shared.events.EventRouter; import com.mercury.platform.shared.events.custom.AddInterceptorEvent; -import com.mercury.platform.shared.events.custom.AddShowDelayEvent; import com.mercury.platform.shared.events.custom.ChatFilterMessageEvent; import com.mercury.platform.shared.events.custom.RemoveInterceptorEvent; import com.mercury.platform.shared.pojo.FrameSettings; @@ -49,6 +47,7 @@ public void componentResized(ComponentEvent e) { setPreferredSize(getSize()); } }); + this.hideButton.setIcon(componentsFactory.getIcon("app/hide.png",14)); this.settingsFrame.init(); this.msgContainer = new ChatFilterPanel(); this.add(msgContainer,BorderLayout.CENTER); @@ -80,9 +79,6 @@ private void performNewStrings(String[] strings){ protected void process(String message) { SwingUtilities.invokeLater(() -> { msgContainer.addMessage(message); - if(soundEnable){ - EventRouter.CORE.fireEvent(new ChatFilterMessageEvent()); - } ChatFilterFrame.this.pack(); if(scrollToBottom){ msgContainer.scrollToBottom(true); @@ -139,7 +135,7 @@ private JPanel getNavigationPanel(){ "app/edit.png", 17, AppThemeColor.TRANSPARENT, - ""); + "Chat Scanner settings"); edit.addActionListener( action -> this.settingsFrame.showAuxiliaryFrame( new Point(this.getLocation().x+this.getSize().width/2,this.getLocation().y), @@ -162,10 +158,12 @@ private JPanel getNavigationPanel(){ sound.addActionListener(action -> { if (soundEnable) { sound.setIcon(componentsFactory.getIcon("app/sound-disable.png", 18)); + msgContainer.sound(false); this.soundEnable = false; this.repaint(); } else { sound.setIcon(componentsFactory.getIcon("app/sound-enable.png", 18)); + msgContainer.sound(true); this.soundEnable = true; this.repaint(); } diff --git a/app-ui/src/main/resources/app/hide.png b/app-ui/src/main/resources/app/hide.png new file mode 100644 index 00000000..fe62a8e5 Binary files /dev/null and b/app-ui/src/main/resources/app/hide.png differ diff --git a/app-ui/src/main/resources/notes/patch/patch-notes.json b/app-ui/src/main/resources/notes/patch/patch-notes.json index 50a33415..eeeb17fa 100644 --- a/app-ui/src/main/resources/notes/patch/patch-notes.json +++ b/app-ui/src/main/resources/notes/patch/patch-notes.json @@ -1,9 +1,9 @@ { - "version":"1.0.1.0", + "version":"1.0.1.1", "notes":[ { "title" : "Update", - "text" : "- Added Scalability! Added a related icon to Taskbar.\n- Added Currency Rate display to Notification panel (currency.poe.trade support).\n- Added \"Still interested in ITEM for PRICE?\" button to Notification panel.\n- Added League name display to Notification panel.\n- Fixed reported bugs and issues you guys had.\n- Minor yet numerous improvements.\nIf you enjoy the app and it makes your life a bit happier consider supporting it!", + "text" : "- Introducing CHAT SCANNER.\nThis feature allows you to look for something specific in chat without paying much attention to it. You can set up what to look for and what to ignore. We expect you to fall in love with this feature as soon as you start doing League Challenges!\n- Added an option to remove League display from Notification header.\n- Updated component Fade Time behavior.\n- Fixed things, improved things.\n\nIf you like MercuryTrade so much it has already become your \"must have\" application consider supporting it!\nVisit our Discord channel if you seek help or have suggestions to offer!", "image" : "", "layout" : "VERTICAL" }