diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 00000000..e96534fb --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app-core/src/main/java/com/mercury/platform/core/utils/interceptor/PlainMessageInterceptor.java b/app-core/src/main/java/com/mercury/platform/core/utils/interceptor/PlainMessageInterceptor.java index db7a93f2..3b38d70b 100644 --- a/app-core/src/main/java/com/mercury/platform/core/utils/interceptor/PlainMessageInterceptor.java +++ b/app-core/src/main/java/com/mercury/platform/core/utils/interceptor/PlainMessageInterceptor.java @@ -21,6 +21,8 @@ public PlainMessageInterceptor() { this.clients.add(new ArabicOutLocalizationMatcher()); this.clients.add(new BZIncLocalizationMatcher()); this.clients.add(new BZOutLocalizationMatcher()); + this.clients.add(new FrenchIncLocalizationMatcher()); + this.clients.add(new FrenchOutLocalizationMatcher()); } @Override diff --git a/app-core/src/main/java/com/mercury/platform/core/utils/interceptor/TradeIncMessagesInterceptor.java b/app-core/src/main/java/com/mercury/platform/core/utils/interceptor/TradeIncMessagesInterceptor.java index 6022d474..431196e5 100644 --- a/app-core/src/main/java/com/mercury/platform/core/utils/interceptor/TradeIncMessagesInterceptor.java +++ b/app-core/src/main/java/com/mercury/platform/core/utils/interceptor/TradeIncMessagesInterceptor.java @@ -23,6 +23,7 @@ public TradeIncMessagesInterceptor() { this.clients.add(new RuIncLocalizationMatcher()); this.clients.add(new ArabicInLocalizationMatcher()); this.clients.add(new BZIncLocalizationMatcher()); + this.clients.add(new FrenchIncLocalizationMatcher()); } @Override @@ -113,4 +114,16 @@ public String trimString(String src) { return StringUtils.substringAfter(src, "@De"); } } + + private class FrenchIncLocalizationMatcher extends LocalizationMatcher { + @Override + public boolean isSuitableFor(String message) { + return message.contains("@De") && super.isSuitableFor(message); + } + + @Override + public String trimString(String src) { + return StringUtils.substringAfter(src, "@De"); + } + } } diff --git a/app-core/src/main/java/com/mercury/platform/core/utils/interceptor/TradeOutMessagesInterceptor.java b/app-core/src/main/java/com/mercury/platform/core/utils/interceptor/TradeOutMessagesInterceptor.java index e6e14d0f..1f85b33c 100644 --- a/app-core/src/main/java/com/mercury/platform/core/utils/interceptor/TradeOutMessagesInterceptor.java +++ b/app-core/src/main/java/com/mercury/platform/core/utils/interceptor/TradeOutMessagesInterceptor.java @@ -25,6 +25,7 @@ public TradeOutMessagesInterceptor() { this.clients.add(new RuOutLocalizationMatcher()); this.clients.add(new ArabicOutLocalizationMatcher()); this.clients.add(new BZOutLocalizationMatcher()); + this.clients.add(new FrenchOutLocalizationMatcher()); } @Override @@ -159,4 +160,27 @@ public NotificationDescriptor getDescriptor(String message) { return descriptor; } } + + private class FrenchOutLocalizationMatcher extends LocalizationMatcher { + @Override + public boolean isSuitableFor(String message) { + return message.contains("@À") && super.isSuitableFor(message); + } + + @Override + public String trimString(String src) { + return StringUtils.substringAfter(src, "@À"); + } + + @Override + public NotificationDescriptor getDescriptor(String message) { + NotificationDescriptor descriptor = messageParser.parse(this.trimString(message)); + if (descriptor instanceof ItemTradeNotificationDescriptor) { + descriptor.setType(NotificationType.OUT_ITEM_MESSAGE); + } else { + descriptor.setType(NotificationType.OUT_CURRENCY_MESSAGE); + } + return descriptor; + } + } } diff --git a/app-core/src/main/java/com/mercury/platform/shared/config/configration/impl/HotKeyConfigurationService.java b/app-core/src/main/java/com/mercury/platform/shared/config/configration/impl/HotKeyConfigurationService.java index 3570a627..28095992 100644 --- a/app-core/src/main/java/com/mercury/platform/shared/config/configration/impl/HotKeyConfigurationService.java +++ b/app-core/src/main/java/com/mercury/platform/shared/config/configration/impl/HotKeyConfigurationService.java @@ -64,6 +64,14 @@ public void validate() { this.selectedProfile.getHotkeysSettingsDescriptor() .getOutNHotKeysList().add(new HotKeyPair(HotKeyType.N_WHO_IS, new HotKeyDescriptor())); } + + if (this.selectedProfile.getHotkeysSettingsDescriptor() + .getScannerNHotKeysList().stream() + .filter(it -> it.getType().equals(HotKeyType.N_WHO_IS)) + .findAny().orElse(null) == null) { + this.selectedProfile.getHotkeysSettingsDescriptor() + .getScannerNHotKeysList().add(new HotKeyPair(HotKeyType.N_WHO_IS, new HotKeyDescriptor())); + } } @Override diff --git a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/notification/ScannerNotificationPanel.java b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/notification/ScannerNotificationPanel.java index 5c5c1e1e..ba6c2a7f 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/notification/ScannerNotificationPanel.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/notification/ScannerNotificationPanel.java @@ -76,6 +76,8 @@ private JPanel getHeader() { }); JButton openChatButton = componentsFactory.getIconButton("app/openChat.png", 15, AppThemeColor.MSG_HEADER, TooltipConstants.OPEN_CHAT); openChatButton.addActionListener(e -> this.controller.performOpenChat()); + JButton whoIsButton = componentsFactory.getIconButton("app/who-is.png", 15, AppThemeColor.MSG_HEADER, TooltipConstants.WHO_IS); + whoIsButton.addActionListener(e -> controller.performWhoIs()); JButton hideButton = componentsFactory.getIconButton("app/close.png", 15, AppThemeColor.MSG_HEADER, TooltipConstants.HIDE_PANEL); hideButton.addActionListener(action -> { this.controller.performHide(); @@ -85,6 +87,7 @@ private JPanel getHeader() { interactionPanel.add(visiteHideout); interactionPanel.add(tradeButton); interactionPanel.add(leaveButton); + interactionPanel.add(whoIsButton); interactionPanel.add(openChatButton); interactionPanel.add(hideButton); @@ -93,6 +96,7 @@ private JPanel getHeader() { this.interactButtonMap.put(HotKeyType.N_VISITE_HIDEOUT, visiteHideout); this.interactButtonMap.put(HotKeyType.N_TRADE_PLAYER, tradeButton); this.interactButtonMap.put(HotKeyType.N_LEAVE, leaveButton); + this.interactButtonMap.put(HotKeyType.N_WHO_IS, whoIsButton); this.interactButtonMap.put(HotKeyType.N_OPEN_CHAT, openChatButton); this.interactButtonMap.put(HotKeyType.N_CLOSE_NOTIFICATION, hideButton); diff --git a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/notification/controller/NotificationScannerController.java b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/notification/controller/NotificationScannerController.java index f7c46934..4fdf2e25 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/notification/controller/NotificationScannerController.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/notification/controller/NotificationScannerController.java @@ -28,6 +28,11 @@ public void performLeave(String nickName) { MercuryStoreCore.chatCommandSubject.onNext("/kick " + nickName); } + @Override + public void performWhoIs() { + MercuryStoreCore.chatCommandSubject.onNext("/whois " + notificationDescriptor.getNickName()); + } + @Override public void performOfferTrade() { MercuryStoreCore.chatCommandSubject.onNext("/tradewith " + notificationDescriptor.getNickName()); diff --git a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/notification/controller/ScannerPanelController.java b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/notification/controller/ScannerPanelController.java index 8ceeefec..de0b6efc 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/notification/controller/ScannerPanelController.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/notification/controller/ScannerPanelController.java @@ -6,4 +6,6 @@ public interface ScannerPanelController extends NotificationController { void performInvite(); void performLeave(String nickName); + + void performWhoIs(); } diff --git a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/notification/controller/stub/ScannerStubController.java b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/notification/controller/stub/ScannerStubController.java index c0b314df..29d41609 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/notification/controller/stub/ScannerStubController.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/notification/controller/stub/ScannerStubController.java @@ -40,4 +40,9 @@ public void performInvite() { public void performLeave(String nickName) { } + + @Override + public void performWhoIs() { + + } } 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 71dc8fd5..b8ea4c10 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 @@ -156,8 +156,8 @@ private JPanel getOperationsButtons() { JButton openTests = this.getOperationButton("Open tests", "app/open-tests.png"); openTests.addActionListener(action -> { FramesManager.INSTANCE.hideFrame(SettingsFrame.class); -// FramesManager.INSTANCE.showFrame(TestCasesFrame.class); - FramesManager.INSTANCE.preShowFrame(TestCasesFrame.class); + FramesManager.INSTANCE.showFrame(TestCasesFrame.class); +// FramesManager.INSTANCE.preShowFrame(TestCasesFrame.class); }); root.add(this.componentsFactory.wrapToSlide(openTutorial)); root.add(this.componentsFactory.wrapToSlide(checkUpdates));