diff --git a/app-core/src/main/java/com/mercury/platform/core/MercuryConstants.java b/app-core/src/main/java/com/mercury/platform/core/MercuryConstants.java index 2a6a7df6..3157a4a9 100644 --- a/app-core/src/main/java/com/mercury/platform/core/MercuryConstants.java +++ b/app-core/src/main/java/com/mercury/platform/core/MercuryConstants.java @@ -1,7 +1,7 @@ package com.mercury.platform.core; public class MercuryConstants { - public static final String APP_VERSION = "1.3.4.1"; + public static final String APP_VERSION = "1.3.5"; public static final String SERVER_HOST = "exslims.ddns.net"; public static final int PORT = 5555; } diff --git a/app-core/src/main/java/com/mercury/platform/shared/MainWindowHWNDFetch.java b/app-core/src/main/java/com/mercury/platform/shared/MainWindowHWNDFetch.java index 37857321..cbb6e12b 100644 --- a/app-core/src/main/java/com/mercury/platform/shared/MainWindowHWNDFetch.java +++ b/app-core/src/main/java/com/mercury/platform/shared/MainWindowHWNDFetch.java @@ -1,5 +1,7 @@ package com.mercury.platform.shared; +import com.mercury.platform.shared.config.Configuration; +import com.mercury.platform.shared.config.descriptor.ApplicationDescriptor; import com.sun.jna.Native; import com.sun.jna.platform.DesktopWindow; import com.sun.jna.platform.WindowUtils; @@ -16,17 +18,12 @@ public class MainWindowHWNDFetch { private Logger logger = LogManager.getLogger(MainWindowHWNDFetch.class.getSimpleName()); public static MainWindowHWNDFetch INSTANCE = MainWindowHWNDFetch.MainWindowHWNDFetchHolder.HOLDER_INSTANCE; - private boolean isPoe2; - private static class MainWindowHWNDFetchHolder { static final MainWindowHWNDFetch HOLDER_INSTANCE = new MainWindowHWNDFetch(); } - public void initialize(boolean isPoe2) { - this.isPoe2 = isPoe2; - } - public boolean isPoe2() { + boolean isPoe2 = Configuration.get().applicationConfiguration().get().isPoe2(); return isPoe2; } @@ -45,7 +42,7 @@ public List getMainWindowList() { } public boolean isPoe(DesktopWindow desktopWindow) { -// if (this.isPoe2) { +// if (this.isPoe2()) { // return desktopWindow.getTitle().contains("PathOfExile"); // } else { char[] className = new char[512]; diff --git a/app-core/src/main/java/com/mercury/platform/shared/config/descriptor/ApplicationDescriptor.java b/app-core/src/main/java/com/mercury/platform/shared/config/descriptor/ApplicationDescriptor.java index c2511bf0..0b384e6a 100644 --- a/app-core/src/main/java/com/mercury/platform/shared/config/descriptor/ApplicationDescriptor.java +++ b/app-core/src/main/java/com/mercury/platform/shared/config/descriptor/ApplicationDescriptor.java @@ -17,4 +17,5 @@ public class ApplicationDescriptor implements Serializable { private boolean itemsGridEnable; private boolean checkOutUpdate; private boolean hideTaskbarUntilHover; + private boolean poe2; } diff --git a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/settings/page/GeneralSettingsPagePanel.java b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/settings/page/GeneralSettingsPagePanel.java index 2445bc64..9dedcd6b 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/settings/page/GeneralSettingsPagePanel.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/settings/page/GeneralSettingsPagePanel.java @@ -57,6 +57,11 @@ public void onViewInit() { this.applicationSnapshot.setHideTaskbarUntilHover(hideTaskbarUntilHover.isSelected()); }); + JCheckBox poe2Support = this.componentsFactory.getCheckBox(this.applicationSnapshot.isPoe2(), "Enable support for poe2"); + poe2Support.addActionListener(action -> { + this.applicationSnapshot.setPoe2(poe2Support.isSelected()); + }); + JSlider fadeTimeSlider = this.componentsFactory.getSlider(0, 10, this.applicationSnapshot.getFadeTime(), AppThemeColor.SLIDE_BG); fadeTimeSlider.addChangeListener(e -> { this.applicationSnapshot.setFadeTime(fadeTimeSlider.getValue()); @@ -143,6 +148,8 @@ public void keyTyped(KeyEvent e) { root.add(vulkanEnableCheck); root.add(this.componentsFactory.getTextLabel("Hide taskbar", FontStyle.REGULAR, 16)); root.add(hideTaskbarUntilHover); + root.add(this.componentsFactory.getTextLabel("POE 2 support", FontStyle.REGULAR, 16)); + root.add(poe2Support); root.add(this.componentsFactory.getTextLabel("Component fade out time: ", FontStyle.REGULAR, 16)); root.add(fadeTimeSlider); root.add(this.componentsFactory.getTextLabel("Min opacity: ", FontStyle.REGULAR, 16)); diff --git a/app-ui/src/main/java/com/mercury/platform/ui/frame/AbstractOverlaidFrame.java b/app-ui/src/main/java/com/mercury/platform/ui/frame/AbstractOverlaidFrame.java index 6d3044dc..0def42b0 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/frame/AbstractOverlaidFrame.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/frame/AbstractOverlaidFrame.java @@ -11,7 +11,9 @@ import com.mercury.platform.shared.store.MercuryStoreCore; import com.mercury.platform.ui.components.ComponentsFactory; import com.mercury.platform.ui.components.panel.misc.ViewInit; +import com.mercury.platform.ui.frame.movable.NotificationFrame; import com.mercury.platform.ui.frame.other.MercuryLoadingFrame; +import com.mercury.platform.ui.manager.FramesManager; import com.mercury.platform.ui.misc.AppThemeColor; import javax.swing.*; @@ -57,6 +59,7 @@ public void mouseEntered(MouseEvent e) { MercuryStoreCore.frameVisibleSubject.subscribe(state -> SwingUtilities.invokeLater(() -> { this.changeVisible(state); + FramesManager.INSTANCE.hideOrShowFrame(NotificationFrame.class, state); })); } diff --git a/app-ui/src/main/java/com/mercury/platform/ui/frame/movable/NotificationFrame.java b/app-ui/src/main/java/com/mercury/platform/ui/frame/movable/NotificationFrame.java index d7386e66..36706337 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/frame/movable/NotificationFrame.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/frame/movable/NotificationFrame.java @@ -19,6 +19,7 @@ import com.mercury.platform.ui.components.panel.notification.controller.stub.OutStubController; import com.mercury.platform.ui.components.panel.notification.factory.NotificationPanelFactory; import com.mercury.platform.ui.frame.titled.TestEngine; +import com.mercury.platform.ui.manager.FramesManager; import com.mercury.platform.ui.misc.AppThemeColor; import com.mercury.platform.ui.misc.MercuryStoreUI; import org.apache.commons.lang3.SystemUtils; @@ -113,6 +114,10 @@ public void subscribe() { .setData(notification) .setComponentsFactory(this.componentsFactory) .build(); + if (ProdStarter.APP_STATUS.equals(FrameVisibleState.HIDE)) { + FramesManager.INSTANCE.hideFrame(NotificationFrame.class); + } + if (preProcessor.isDuplicate(notification)) { notificationPanel.setDuplicate(true); } 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 86142f0a..30a57940 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 @@ -211,6 +211,15 @@ public void hideOrShowFrame(Class frameClass) { } } + public void hideOrShowFrame(Class frameClass, FrameVisibleState state) { + AbstractOverlaidFrame frame = this.framesMap.get(frameClass); + if (state.equals(FrameVisibleState.SHOW)) { + showFrame(frameClass); + } else { + hideFrame(frameClass); + } + } + public void enableMovementExclude(Class... frames) { this.locationCommander.setUpAllExclude(frames); } diff --git a/app-ui/src/main/resources/notes/patch/patch-notes-new.json b/app-ui/src/main/resources/notes/patch/patch-notes-new.json index 050d49de..2f0cf740 100644 --- a/app-ui/src/main/resources/notes/patch/patch-notes-new.json +++ b/app-ui/src/main/resources/notes/patch/patch-notes-new.json @@ -1,4 +1,17 @@ [ + { + "version": "1.3.5", + "minor": [ + { + "changed": "moved option to enable path of exile 2 support into in app settings, remember to save after changing" + } + ], + "fix": [ + { + "changed": "Fixed notifications showing while game is minimized" + } + ] + }, { "version": "1.3.4.1", "minorChanges": [ diff --git a/app/src/main/java/com/mercury/platform/AppMain.java b/app/src/main/java/com/mercury/platform/AppMain.java index f2db3f1b..8b9d31f9 100644 --- a/app/src/main/java/com/mercury/platform/AppMain.java +++ b/app/src/main/java/com/mercury/platform/AppMain.java @@ -46,15 +46,11 @@ public static void main(String[] args) { boolean standalone = BooleanUtils.toBoolean(System.getProperty("standalone")); boolean dev = BooleanUtils.toBoolean(System.getProperty("dev")); boolean hideLoadingIcon = BooleanUtils.toBoolean(System.getProperty("hideLoadingIcon")); - boolean isPoe2 = BooleanUtils.toBoolean(System.getProperty("poe2")); - MainWindowHWNDFetch.INSTANCE.initialize(isPoe2); logger.warn("loaded runtime settings: "); logger.warn("standalone=" + standalone); logger.warn("dev=" + dev); logger.warn("hideLoadingIcon=" + hideLoadingIcon); - logger.warn("isPoe2=" + isPoe2); - new ErrorHandler(); if (!hideLoadingIcon) { diff --git a/release_files/MercuryTrade/MercuryTrade.l4j.ini b/release_files/MercuryTrade/MercuryTrade.l4j.ini index 8051aebb..6b973b54 100644 --- a/release_files/MercuryTrade/MercuryTrade.l4j.ini +++ b/release_files/MercuryTrade/MercuryTrade.l4j.ini @@ -14,6 +14,4 @@ # -Dstandalone while you set that variable to true MercuryTrade will be always visiable even if you are in other window than PathOfExile -Dstandalone=false # -DhideLoadingIcon while you set that to true you won't see MercuryTrade loading animation at start --DhideLoadingIcon=false -# -Dpoe2 while you set that variable to true MercuryTrade will support path of exile 2 --Dpoe2=false \ No newline at end of file +-DhideLoadingIcon=false \ No newline at end of file diff --git a/release_files/release_config.xml b/release_files/release_config.xml index 57170a0e..142ea4b3 100644 --- a/release_files/release_config.xml +++ b/release_files/release_config.xml @@ -30,12 +30,12 @@ -XX:+UseG1GC - 1.3.4.1 - 1.3.4.1 + 1.3.5.0 + 1.3.5 MercuryTrade Morph21 - 1.3.4.1 - 1.3.4.1 + 1.3.5.0 + 1.3.5 MercuryTrade Morph MercuryTrade