Skip to content

Commit

Permalink
Release 1.2.0
Browse files Browse the repository at this point in the history
Fixed errors while item image was not found
Added base currency images for pathofexile.com/trade
Fixed error when item name containted 'in' message was wrongly parsed
Added max heap size to .exe runner to limit memory usage
Added better garbage collector to .exe runner to reduce cpu load
Updated betrayal chart for 3.17 (You are still able to replace that image, more in README.txt
Changed message ui to be more readable when transaction item does not have image
  • Loading branch information
Morph21 committed Feb 7, 2022
1 parent 2280c39 commit 5405b65
Show file tree
Hide file tree
Showing 56 changed files with 72 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.mercury.platform.core;

public class MercuryConstants {
public static final String APP_VERSION = "1.1.9";
public static final String APP_VERSION = "1.2.0";
public static final String SERVER_HOST = "exslims.ddns.net";
public static final int PORT = 5555;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

class PoeTradeStashTabParser extends BaseRegexParser {

private static final String poeTradeStashTabPattern = "^(.*\\s)?(.+): (.+ to buy your\\s+?(.+?)(\\s+?listed for\\s+?([\\d\\.]+?)\\s+?(.+))?\\s+?in\\s+?(.+?)\\s+?\\(stash tab \"(.*)\"; position: left (\\d+), top (\\d+)\\)\\s*?(.*))$";
// private static final String poeTradeStashTabPattern = "^(.*\\s)?(.+): (.+ to buy your\\s+?(.+?)(\\s+?listed for\\s+?([\\d\\.]+?)\\s+?(.+))?\\s+?in\\s+?(.+?)\\s+?\\(stash tab \"(.*)\"; position: left (\\d+), top (\\d+)\\)\\s*?(.*))$";
private static final String poeTradeStashTabPattern = "^(.*\\s)?(.+): ((.+ to buy your\\s+?(.+?))listed for\\s+?([\\d\\.]+?)\\s+?(.+)\\s+?in\\s+?(.+?)\\s+?\\(stash tab \"(.*)\"; position: left (\\d+), top (\\d+)\\)\\s*?(.*)$)";

public PoeTradeStashTabParser() {
super(poeTradeStashTabPattern);
Expand All @@ -19,7 +20,7 @@ protected NotificationDescriptor parse(Matcher matcher, String whisper) {
ItemTradeNotificationDescriptor tradeNotification = new ItemTradeNotificationDescriptor();
tradeNotification.setWhisperNickname(matcher.group(2));
tradeNotification.setSourceString(matcher.group(3));
tradeNotification.setItemName(matcher.group(4));
tradeNotification.setItemName(matcher.group(5));
if (matcher.group(6) != null) {
tradeNotification.setCurCount(Double.parseDouble(matcher.group(6)));
tradeNotification.setCurrency(matcher.group(7));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,22 @@ public void mouseClicked(MouseEvent e) {
return button;
}

public JButton getIconButton(String iconPath, float iconSize, Color background, String tooltip) {
int i = iconPath.lastIndexOf("/");
String temp = iconPath.substring(i + 1);
temp = temp.replace(".png", "");
return getIconButton(iconPath, iconSize, background, tooltip, temp);
}


/**
* Get button with icon
*
* @param iconPath icon path from maven resources
* @param iconSize icon size
* @return JButton object with icon
*/
public JButton getIconButton(String iconPath, float iconSize, Color background, String tooltip) {
public JButton getIconButton(String iconPath, float iconSize, Color background, String tooltip, String textIfImgNotFound) {
JButton button = new JButton("") {
@Override
protected void paintBorder(Graphics g) {
Expand Down Expand Up @@ -255,14 +263,22 @@ public void mouseExited(MouseEvent e) {
button.setVerticalAlignment(SwingConstants.CENTER);
BufferedImage icon = null;
try {
BufferedImage buttonIcon = ImageIO.read(getClass().getClassLoader().getResource(iconPath));
icon = Scalr.resize(buttonIcon, (int) (scale * iconSize));
URL resource = getClass().getClassLoader().getResource(iconPath);
if (resource != null) {
BufferedImage buttonIcon = ImageIO.read(resource);
icon = Scalr.resize(buttonIcon, (int) (scale * iconSize));
}
} catch (Exception e) {
e.printStackTrace();
}
if (icon != null) {
button.setIcon(new ImageIcon(icon));
} else {
button.setText(textIfImgNotFound);
button.setForeground(AppThemeColor.TEXT_DEFAULT);
button.setFont(getFont(FontStyle.REGULAR, scale * 14));
}

return button;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ protected JPanel getHeader() {

JPanel nickNamePanel = this.componentsFactory.getJPanel(new BorderLayout(), AppThemeColor.MSG_HEADER);
this.nicknameLabel = this.componentsFactory.getTextLabel(FontStyle.BOLD, AppThemeColor.TEXT_NICKNAME, TextAlignment.LEFTOP, 15f, this.getNicknameText());
nicknameLabel.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 5));
nickNamePanel.add(this.getExpandButton(), BorderLayout.LINE_START);
JPanel headerPanel = this.componentsFactory.getJPanel(new GridLayout(1, 0, 3, 0), AppThemeColor.MSG_HEADER);
nicknameLabel.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4));
JPanel headerPanel = this.componentsFactory.getJPanel(new GridBagLayout(), AppThemeColor.MSG_HEADER);
headerPanel.add(this.getExpandButton());
headerPanel.add(this.nicknameLabel);
headerPanel.add(this.getForPanel("app/incoming_arrow.png"));
nickNamePanel.add(headerPanel, BorderLayout.CENTER);
nickNamePanel.add(headerPanel, BorderLayout.LINE_START);
root.add(nickNamePanel, BorderLayout.CENTER);

JPanel opPanel = this.componentsFactory.getJPanel(new BorderLayout(), AppThemeColor.MSG_HEADER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,16 @@ public void mouseExited(MouseEvent e) {
}

protected JPanel getForPanel(String signIconPath) {
JPanel forPanel = new JPanel(new BorderLayout());
JPanel forPanel = new JPanel(new GridBagLayout());
forPanel.setBorder(BorderFactory.createEmptyBorder(0,4,0,4));
forPanel.setBackground(AppThemeColor.MSG_HEADER);
JLabel separator = componentsFactory.getIconLabel(signIconPath, 16);
forPanel.add(separator, BorderLayout.LINE_START);
separator.setBorder(BorderFactory.createEmptyBorder(0,5,0,5));
forPanel.add(separator);
separator.setHorizontalAlignment(SwingConstants.CENTER);
JPanel currencyPanel = this.getCurrencyPanel(this.data.getCurCount(), this.data.getCurrency());
if (currencyPanel != null) {
forPanel.add(currencyPanel, BorderLayout.CENTER);
forPanel.add(currencyPanel);
}
return forPanel;
}
Expand All @@ -197,9 +199,10 @@ protected JPanel getCurrencyPanel(Double curCount, String curIconPath) {
currencyButton.addActionListener((action) -> {
MercuryStoreCore.findInStashTab.onNext(curIconPath);
});
JPanel curPanel = this.componentsFactory.getJPanel(new GridLayout(1, 0, 4, 0), AppThemeColor.MSG_HEADER);
JPanel curPanel = this.componentsFactory.getJPanel(new GridBagLayout(), AppThemeColor.MSG_HEADER);
curPanel.setAlignmentX(SwingConstants.LEFT);
JLabel countLabel = this.componentsFactory.getTextLabel(curCountStr, FontStyle.BOLD, 17f);
countLabel.setBorder(BorderFactory.createEmptyBorder(0,5,0,0));
countLabel.setHorizontalAlignment(SwingConstants.RIGHT);
curPanel.add(countLabel);
curPanel.add(currencyButton);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ protected JPanel getHeader() {

JPanel nickNamePanel = this.componentsFactory.getJPanel(new BorderLayout(), AppThemeColor.MSG_HEADER);
this.nicknameLabel = this.componentsFactory.getTextLabel(FontStyle.BOLD, AppThemeColor.TEXT_NICKNAME, TextAlignment.LEFTOP, 15f, this.data.getWhisperNickname());
nickNamePanel.add(this.getExpandButton(), BorderLayout.LINE_START);
JPanel headerPanel = this.componentsFactory.getJPanel(new GridLayout(1, 0, 3, 0), AppThemeColor.MSG_HEADER);
this.nicknameLabel.setBorder(BorderFactory.createEmptyBorder(0,4,0,4));
JPanel headerPanel = this.componentsFactory.getJPanel(new GridBagLayout(), AppThemeColor.MSG_HEADER);
headerPanel.add(this.getExpandButton());
headerPanel.add(this.nicknameLabel);
headerPanel.add(this.getForPanel("app/outgoing_arrow.png"));
nickNamePanel.add(headerPanel, BorderLayout.CENTER);
nickNamePanel.add(headerPanel, BorderLayout.LINE_START);
root.add(nickNamePanel, BorderLayout.CENTER);

JPanel opPanel = this.componentsFactory.getJPanel(new BorderLayout(), AppThemeColor.MSG_HEADER);
Expand Down
Binary file modified app-ui/src/main/resources/app/helpIGImg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app-ui/src/main/resources/currency/Divine Orb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app-ui/src/main/resources/currency/Regal Orb.png
Binary file added app-ui/src/main/resources/currency/Sacred Orb.png
26 changes: 26 additions & 0 deletions app-ui/src/main/resources/notes/patch/patch-notes-new.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
[
{
"version": "1.2.0",
"fix": [
{
"changed": "Fixed errors while item image was not found"
},
{
"changed": "Added base currency images for pathofexile.com/trade"
},
{
"changed": "Fixed error when item name containted 'in' message was wrongly parsed"
},
{
"changed": "Added max heap size to .exe runner to limit memory usage"
},
{
"changed": "Added better garbage collector to .exe runner to reduce cpu load"
},
{
"changed": "Updated betrayal chart for 3.17 (You are still able to replace that image, more in README.txt"
},
{
"changed": "Changed message ui to be more readable when transaction item does not have image"
}
]
},
{
"version": "1.1.9",
"fix": [
Expand Down
3 changes: 1 addition & 2 deletions app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@
<configuration>
<source>1.8</source>
<target>1.8</target>
<meminitial>1024m</meminitial>
<maxmem>2024m</maxmem>
<maxmem>256m</maxmem>
</configuration>
</plugin>
</plugins>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<packaging>pom</packaging>

<properties>
<project.version>1.1.4</project.version>
<project.version>1.2.0</project.version>

<jnativehook.version>2.0.2</jnativehook.version>
<devjna.version>4.4.0</devjna.version>
Expand Down
10 changes: 6 additions & 4 deletions release_files/release_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@
<maxVersion></maxVersion>
<jdkPreference>preferJre</jdkPreference>
<runtimeBits>64/32</runtimeBits>
<maxHeapSize>256</maxHeapSize>
<opt>-XX:+UseG1GC</opt>
</jre>
<versionInfo>
<fileVersion>1.1.9.0</fileVersion>
<txtFileVersion>1.1.9</txtFileVersion>
<fileVersion>1.2.0.0</fileVersion>
<txtFileVersion>1.2.0</txtFileVersion>
<fileDescription>MercuryTrade</fileDescription>
<copyright>Morph21</copyright>
<productVersion>1.1.9.0</productVersion>
<txtProductVersion>1.1.9</txtProductVersion>
<productVersion>1.2.0.0</productVersion>
<txtProductVersion>1.2.0</txtProductVersion>
<productName>MercuryTrade</productName>
<companyName>Morph</companyName>
<internalName>MercuryTrade</internalName>
Expand Down

0 comments on commit 5405b65

Please sign in to comment.