From 5eb77173e911ebe1fcc8bdf4425b0c4618d90185 Mon Sep 17 00:00:00 2001 From: Exslims Date: Tue, 14 Mar 2017 00:07:23 +0400 Subject: [PATCH] Fixed an issue with "Restart" panel appearing beyond the screen, 1.0.0.6 release --- .../com/mercury/platform/core/MercuryConstants.java | 2 +- .../ui/components/panel/settings/HelpPanel.java | 13 +++++++++++++ .../platform/ui/frame/impl/UpdateReadyFrame.java | 6 +++++- .../src/main/resources/notes/patch/patch-notes.json | 4 ++-- 4 files changed, 21 insertions(+), 4 deletions(-) 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 43869881..b9f8865a 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 @@ -4,7 +4,7 @@ * Created by Константин on 29.01.2017. */ public class MercuryConstants { - public static final String APP_VERSION = "1.0.0.5"; + public static final String APP_VERSION = "1.0.0.6"; public static final String SERVER_HOST = "exslims.ddns.net"; public static final int PORT = 5555; } diff --git a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/settings/HelpPanel.java b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/settings/HelpPanel.java index ebb843a5..6f86996f 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/components/panel/settings/HelpPanel.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/components/panel/settings/HelpPanel.java @@ -1,6 +1,8 @@ package com.mercury.platform.ui.components.panel.settings; import com.mercury.platform.shared.ConfigManager; +import com.mercury.platform.shared.events.EventRouter; +import com.mercury.platform.shared.events.custom.UpdateInfoEvent; import com.mercury.platform.ui.components.ComponentsFactory; import com.mercury.platform.ui.components.panel.misc.HasUI; import com.mercury.platform.ui.frame.impl.NotesFrame; @@ -67,8 +69,19 @@ public void mouseClicked(MouseEvent e) { } } }); + JButton updateEvent = componentsFactory.getBorderedButton("Update event"); + updateEvent.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + if(SwingUtilities.isLeftMouseButton(e)){ + EventRouter.INSTANCE.fireEvent(new UpdateInfoEvent(123)); + FramesManager.INSTANCE.hideFrame(SettingsFrame.class); + } + } + }); this.add(openTutorial); this.add(openTests); this.add(patchNotes); + this.add(updateEvent); } } diff --git a/app-ui/src/main/java/com/mercury/platform/ui/frame/impl/UpdateReadyFrame.java b/app-ui/src/main/java/com/mercury/platform/ui/frame/impl/UpdateReadyFrame.java index 98b87f42..d68bbeb9 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/frame/impl/UpdateReadyFrame.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/frame/impl/UpdateReadyFrame.java @@ -74,7 +74,11 @@ public void initHandlers() { if(tbLocation.y + 30 + this.getHeight() > dim.height){ this.setLocation(tbLocation.x,tbLocation.y - 44); }else { - this.setLocation(tbLocation.x, tbLocation.y + 40); + this.setLocation(tbLocation.x, tbLocation.y + 44); + } + int deltaWidth = dim.width - (this.getLocation().x + this.getWidth()); + if(deltaWidth < 0){ + this.setLocation(tbLocation.x - Math.abs(deltaWidth), this.getLocation().y); } if (!this.isVisible() && AppStarter.APP_STATUS == FrameStates.SHOW) { this.setVisible(true); 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 a55f3e22..bb1c4868 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.0.5", + "version":"1.0.0.6", "notes":[ { "title" : "New update", - "text" : "- New feature: Stash Highlight - now Mercury highlights where the item is located via a small overlay box on your screen. Check it out!\n\n- IMPORTANT: We are opening the code on github. This should completely clear MercuryTrade from any possible controversy from now on.\n\nWe are making a thread on Reddit with the announcement. Thanks for your support!", + "text" : "FOR THE USERS WHO HAVE ISSUES WITH BUTTONS NOT WORKING:\na) Do not run Path of Exile as administrator. This will most likely fix the problem.\nb) If that doesn't help either, we made another launcher as an alternative way to run the application - please check out our github page.\n\n- Item Name section in the notification panel is now a button. Click to copy item name to clipboard.\n- Better Item Grid clarity.\n- Fixed an issue with \"Restart\" panel appearing beyond the screen.", "image" : "", "layout" : "VERTICAL" }