diff --git a/app-core/src/main/java/com/mercury/platform/shared/config/descriptor/TaskBarDescriptor.java b/app-core/src/main/java/com/mercury/platform/shared/config/descriptor/TaskBarDescriptor.java index 201ee4b3..f368a34d 100644 --- a/app-core/src/main/java/com/mercury/platform/shared/config/descriptor/TaskBarDescriptor.java +++ b/app-core/src/main/java/com/mercury/platform/shared/config/descriptor/TaskBarDescriptor.java @@ -9,4 +9,5 @@ public class TaskBarDescriptor implements Serializable { private boolean inGameDnd; private String dndResponseText = "Response message"; private HotKeyDescriptor hideoutHotkey = new HotKeyDescriptor(); + private HotKeyDescriptor helpIGHotkey = new HotKeyDescriptor(); } diff --git a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/settings/page/TaskBarSettingsPagePanel.java b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/settings/page/TaskBarSettingsPagePanel.java index b2a71308..871d85a6 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/settings/page/TaskBarSettingsPagePanel.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/settings/page/TaskBarSettingsPagePanel.java @@ -47,9 +47,17 @@ public void focusLost(FocusEvent e) { hotKeysPanel.setBorder(BorderFactory.createLineBorder(AppThemeColor.ADR_DEFAULT_BORDER)); root.add(this.componentsFactory.getIconLabel("app/hideout.png", 24, SwingConstants.CENTER)); HotKeyGroup hotKeyGroup = new HotKeyGroup(true); - HotKeyPanel hotKeyPanel = new HotKeyPanel(this.taskBarSnapshot.getHideoutHotkey()); - hotKeyGroup.registerHotkey(hotKeyPanel); - root.add(this.componentsFactory.wrapToSlide(hotKeyPanel, AppThemeColor.SETTINGS_BG, 2, 4, 1, 1)); + HotKeyPanel hotKeyHideoutPanel = new HotKeyPanel(this.taskBarSnapshot.getHideoutHotkey()); + hotKeyGroup.registerHotkey(hotKeyHideoutPanel); + root.add(this.componentsFactory.wrapToSlide(hotKeyHideoutPanel, AppThemeColor.SETTINGS_BG, 2, 4, 1, 1)); + this.container.add(this.componentsFactory.wrapToSlide(root)); + this.container.add(this.componentsFactory.wrapToSlide(hotKeysPanel)); + + root.add(this.componentsFactory.getIconLabel("app/helpIG_icon.png", 24, SwingConstants.CENTER)); + HotKeyPanel hotKeyHelpIGPanel = new HotKeyPanel(this.taskBarSnapshot.getHelpIGHotkey()); + hotKeyGroup.registerHotkey(hotKeyHelpIGPanel); + root.add(this.componentsFactory.wrapToSlide(hotKeyHelpIGPanel, AppThemeColor.SETTINGS_BG, 2, 4, 1, 1)); + this.container.add(this.componentsFactory.wrapToSlide(root)); this.container.add(this.componentsFactory.wrapToSlide(hotKeysPanel)); } diff --git a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/taskbar/MercuryTaskBarController.java b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/taskbar/MercuryTaskBarController.java index c5961698..8442f3b2 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/taskbar/MercuryTaskBarController.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/taskbar/MercuryTaskBarController.java @@ -6,6 +6,7 @@ import com.mercury.platform.ui.frame.titled.ChatScannerFrame; import com.mercury.platform.ui.frame.titled.HistoryFrame; import com.mercury.platform.ui.frame.titled.SettingsFrame; +import com.mercury.platform.ui.frame.other.HelpIGFrame; import com.mercury.platform.ui.manager.FramesManager; import com.mercury.platform.ui.misc.MercuryStoreUI; @@ -34,6 +35,11 @@ public void performHideout() { MercuryStoreCore.chatCommandSubject.onNext("/hideout"); } + @Override + public void showHelpIG() { + FramesManager.INSTANCE.hideOrShowFrame(HelpIGFrame.class); + } + @Override public void showChatFiler() { FramesManager.INSTANCE.hideOrShowFrame(ChatScannerFrame.class); diff --git a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/taskbar/TaskBarController.java b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/taskbar/TaskBarController.java index 93a5b75e..7cc1b90a 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/taskbar/TaskBarController.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/taskbar/TaskBarController.java @@ -12,6 +12,8 @@ public interface TaskBarController { void performHideout(); + void showHelpIG(); + void showChatFiler(); void showHistory(); diff --git a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/taskbar/TaskBarPanel.java b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/taskbar/TaskBarPanel.java index 7ea9a147..653495ba 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/taskbar/TaskBarPanel.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/taskbar/TaskBarPanel.java @@ -24,6 +24,7 @@ public class TaskBarPanel extends JPanel implements ViewInit { private TaskBarController controller; private PlainConfigurationService taskBarService; private JButton toHideout; + private JButton showHelpIG; public TaskBarPanel(@NonNull TaskBarController controller, @NonNull ComponentsFactory factory) { this.controller = controller; @@ -35,6 +36,8 @@ public TaskBarPanel(@NonNull TaskBarController controller, @NonNull ComponentsFa if (ProdStarter.APP_STATUS.equals(FrameVisibleState.SHOW)) { if (this.taskBarService.get().getHideoutHotkey().equals(hotkeyDescriptor)) { this.toHideout.doClick(); + } else if (this.taskBarService.get().getHelpIGHotkey().equals(hotkeyDescriptor)) { + this.showHelpIG.doClick(); } } }); @@ -87,6 +90,16 @@ public void mousePressed(MouseEvent e) { this.toHideout.addActionListener(action -> { this.controller.performHideout(); }); + + this.showHelpIG = componentsFactory.getIconButton( + "app/helpIG_icon.png", + 24, + AppThemeColor.FRAME, + TooltipConstants.HELPIG); + this.showHelpIG.addActionListener(action -> { + this.controller.showHelpIG(); + }); + JButton adr = componentsFactory.getIconButton( "app/overseer_icon.png", 24, @@ -184,6 +197,8 @@ public void mousePressed(MouseEvent e) { this.add(Box.createRigidArea(new Dimension(3, 4))); this.add(visibleMode); this.add(Box.createRigidArea(new Dimension(2, 4))); + this.add(this.showHelpIG); + this.add(Box.createRigidArea(new Dimension(2, 4))); this.add(historyButton); this.add(Box.createRigidArea(new Dimension(3, 4))); this.add(itemGrid); diff --git a/app-ui/src/main/java/com/mercury/platform/ui/frame/movable/TaskBarFrame.java b/app-ui/src/main/java/com/mercury/platform/ui/frame/movable/TaskBarFrame.java index 875255fa..8e5645d0 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/frame/movable/TaskBarFrame.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/frame/movable/TaskBarFrame.java @@ -172,6 +172,10 @@ public void showITH() { public void performHideout() { } + @Override + public void showHelpIG() { + } + @Override public void showChatFiler() { } diff --git a/app-ui/src/main/java/com/mercury/platform/ui/frame/other/HelpIGFrame.java b/app-ui/src/main/java/com/mercury/platform/ui/frame/other/HelpIGFrame.java new file mode 100644 index 00000000..b8175493 --- /dev/null +++ b/app-ui/src/main/java/com/mercury/platform/ui/frame/other/HelpIGFrame.java @@ -0,0 +1,46 @@ +package com.mercury.platform.ui.frame.other; + +import com.mercury.platform.ui.frame.AbstractOverlaidFrame; + +import javax.swing.*; +import java.awt.*; + +public class HelpIGFrame extends AbstractOverlaidFrame { + private int MARGIN = 400; + public HelpIGFrame() { + super(); + } + + @Override + protected void initialize() { + this.componentsFactory.setScale(1.1f); + } + + @Override + public void subscribe() { + } + + @Override + protected LayoutManager getFrameLayout() { + return new BorderLayout(); + } + + @Override + public void onViewInit() { + this.setOpacity(this.applicationConfig.get().getMaxOpacity() / 100f); + Dimension dim = Toolkit.getDefaultToolkit().getScreenSize(); + + ImageIcon icon = this.componentsFactory.getImage("app/helpIGImg.png"); + Image image = icon.getImage(); // transform it + Image newimg = image.getScaledInstance(dim.width - MARGIN, -1, java.awt.Image.SCALE_SMOOTH); + if(dim.height-MARGIN < newimg.getHeight(null)) { + newimg = image.getScaledInstance(-1, dim.height - MARGIN, java.awt.Image.SCALE_SMOOTH); + } + icon = new ImageIcon(newimg); + + JLabel img = new JLabel(icon); + this.add(img); + this.pack(); + this.setLocation(dim.width/2-this.getSize().width/2, 0); + } +} diff --git a/app-ui/src/main/java/com/mercury/platform/ui/manager/FramesManager.java b/app-ui/src/main/java/com/mercury/platform/ui/manager/FramesManager.java index 0c226b4b..a19ece6c 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/manager/FramesManager.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/manager/FramesManager.java @@ -81,6 +81,7 @@ public void start() { this.framesMap.put(SetUpLocationFrame.class, new SetUpLocationFrame()); this.framesMap.put(SetUpScaleFrame.class, new SetUpScaleFrame()); this.framesMap.put(AlertFrame.class, new AlertFrame()); + this.framesMap.put(HelpIGFrame.class, new HelpIGFrame()); this.framesMap.forEach((k, v) -> v.init()); diff --git a/app-ui/src/main/java/com/mercury/platform/ui/misc/TooltipConstants.java b/app-ui/src/main/java/com/mercury/platform/ui/misc/TooltipConstants.java index b7cf5ae2..3af676ef 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/misc/TooltipConstants.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/misc/TooltipConstants.java @@ -8,6 +8,7 @@ public class TooltipConstants { public static final String TRADE_MODE = "SuperTradeMode. All notifications you receive will be unfolded."; public static final String CHAT_FILTER = "Chat Scanner. All chat messages with matching words will be displayed in a separate window."; public static final String HIDEOUT = "Travel to your hideout"; + public static final String HELPIG = "See IG help"; public static final String ADR_SETTINGS = "Overseer settings"; public static final String TIMER = "Timer. Just a simple timer."; public static final String HISTORY = "History. Browse through all notifications you received previously."; diff --git a/app-ui/src/main/resources/app/helpIGImg.png b/app-ui/src/main/resources/app/helpIGImg.png new file mode 100644 index 00000000..6e730773 Binary files /dev/null and b/app-ui/src/main/resources/app/helpIGImg.png differ diff --git a/app-ui/src/main/resources/app/helpIG_icon.png b/app-ui/src/main/resources/app/helpIG_icon.png new file mode 100644 index 00000000..480d8dc6 Binary files /dev/null and b/app-ui/src/main/resources/app/helpIG_icon.png differ