Skip to content

Commit

Permalink
Release 1.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Morph21 committed Aug 29, 2023
1 parent ef729a4 commit cb44df5
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 75 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.3.3";
public static final String APP_VERSION = "1.3.4";
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 @@ -7,6 +7,7 @@
import com.mercury.platform.ui.components.fields.style.MercuryComboBoxUI;
import com.mercury.platform.ui.components.fields.style.MercuryScrollBarUI;
import com.mercury.platform.ui.components.panel.misc.ToggleCallback;
import com.mercury.platform.ui.manager.FramesManager;
import com.mercury.platform.ui.misc.AppThemeColor;
import com.mercury.platform.ui.misc.MercuryStoreUI;
import lombok.AllArgsConstructor;
Expand All @@ -31,6 +32,9 @@
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.nio.file.Files;
import java.text.NumberFormat;
Expand Down Expand Up @@ -224,25 +228,16 @@ protected void paintBorder(Graphics g) {
super.paintBorder(g);
}
}

@Override
public JToolTip createToolTip() {
JToolTip tip = ComponentsFactory.this.createTooltip();
tip.setDoubleBuffered(true);
return tip;
}

@Override
public Point getToolTipLocation(MouseEvent event) {
return super.getToolTipLocation(event);
//return event.getLocationOnScreen();
}


};
button.setDoubleBuffered(true);
button.setBackground(background);
button.setFocusPainted(false);

button.addChangeListener(e -> {
if (!button.getModel().isPressed()) {
button.setBackground(button.getBackground());
Expand All @@ -251,7 +246,13 @@ public Point getToolTipLocation(MouseEvent event) {
if (tooltip.length() > 0) {
button.setToolTipText(tooltip);
}

button.setFocusPainted(false);

button.setFocusable(true);

button.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));

button.addActionListener(action -> {
MercuryStoreCore.soundSubject.onNext(SoundType.CLICKS);
button.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
Expand All @@ -266,15 +267,13 @@ public void mouseEntered(MouseEvent e) {
BorderFactory.createLineBorder(AppThemeColor.ADR_SELECTED_BORDER),
BorderFactory.createEmptyBorder(3, 3, 3, 3)));
button.setCursor(new Cursor(Cursor.HAND_CURSOR));

}

@Override
public void mouseExited(MouseEvent e) {
button.setBorder(prevBorder);
button.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}

});

button.setBorder(BorderFactory.createLineBorder(AppThemeColor.TRANSPARENT, 4));
Expand Down Expand Up @@ -304,7 +303,7 @@ public JToolTip createTooltip() {
JToolTip toolTip = new JToolTip();
toolTip.setBackground(AppThemeColor.SETTINGS_BG);
toolTip.setForeground(AppThemeColor.TEXT_DEFAULT);
toolTip.setFont(getFont(FontStyle.REGULAR, 18));
toolTip.setFont(getFont(FontStyle.REGULAR, 16));
toolTip.setBorder(BorderFactory.createLineBorder(AppThemeColor.BORDER));
return toolTip;
}
Expand Down Expand Up @@ -902,47 +901,47 @@ public JMenuItem getMenu(String text) {
return menu;
}

@EqualsAndHashCode(callSuper = true)
@Data
private class TooltipMouseListener extends MouseAdapter {
private String tooltip;
private Timer tooltipTimer;
private Timer tempTimer;
private boolean fired = false;

public TooltipMouseListener (String tooltip) {
this.tooltip = tooltip;
}

@Override
public void mouseEntered(MouseEvent e) {
fired = false;
this.tooltipTimer = new Timer(700, action -> {
MercuryStoreCore.tooltipSubject.onNext(tooltip);
fired = true;
this.tooltipTimer.stop();
});
this.tooltipTimer.start();
}

@Override
public void mouseExited(MouseEvent e) {
this.tooltipTimer.stop();
if (fired) {
MercuryStoreCore.tooltipSubject.onNext(null);
}
}

@Override
public void mousePressed(MouseEvent e) {
tempTimer = new Timer(100, action -> {
this.tooltipTimer.stop();
if (fired) {
MercuryStoreCore.tooltipSubject.onNext(null);
}
tempTimer.stop();
});
tempTimer.start();
}
}
// @EqualsAndHashCode(callSuper = true)
// @Data
// private class TooltipMouseListener extends MouseAdapter {
// private String tooltip;
// private Timer tooltipTimer;
// private Timer tempTimer;
// private boolean fired = false;
//
// public TooltipMouseListener (String tooltip) {
// this.tooltip = tooltip;
// }
//
// @Override
// public void mouseEntered(MouseEvent e) {
// fired = false;
// this.tooltipTimer = new Timer(700, action -> {
// MercuryStoreCore.tooltipSubject.onNext(tooltip);
// fired = true;
// this.tooltipTimer.stop();
// });
// this.tooltipTimer.start();
// }
//
// @Override
// public void mouseExited(MouseEvent e) {
// this.tooltipTimer.stop();
// if (fired) {
// MercuryStoreCore.tooltipSubject.onNext(null);
// }
// }
//
// @Override
// public void mousePressed(MouseEvent e) {
// tempTimer = new Timer(100, action -> {
// this.tooltipTimer.stop();
// if (fired) {
// MercuryStoreCore.tooltipSubject.onNext(null);
// }
// tempTimer.stop();
// });
// tempTimer.start();
// }
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private JPanel getHeader() {
tradeButton.addActionListener(e -> this.controller.performOfferTrade());
JButton leaveButton = componentsFactory.getIconButton(IconConst.LEAVE, 16, AppThemeColor.MSG_HEADER, TooltipConstants.LEAVE);
leaveButton.addActionListener(e -> {
this.controller.performLeave(this.notificationConfig.get().getPlayerNickname());
this.controller.performLeave();
if (this.notificationConfig.get().isDismissAfterLeave()) {
this.controller.performHide();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void performInvite() {
}

@Override
public void performLeave(String nickName) {
public void performLeave() {
MercuryStoreCore.chatCommandSubject.onNext("/leave");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public interface ScannerPanelController extends NotificationController {

void performInvite();

void performLeave(String nickName);
void performLeave();

void performWhoIs();
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void performInvite() {
}

@Override
public void performLeave(String nickName) {
public void performLeave() {

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,16 @@ private JPanel getGeneralPanel() {
limitPanel.add(limitLabel, BorderLayout.LINE_START);
limitPanel.add(limitSlider, BorderLayout.CENTER);
propertiesPanel.add(limitPanel);
propertiesPanel.add(this.componentsFactory.getTextLabel("Your nickname(for leave option):", FontStyle.REGULAR, 16));
JTextField nickNameField = this.componentsFactory.getTextField(this.generalSnapshot.getPlayerNickname(), FontStyle.DEFAULT, 15f);
nickNameField.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
generalSnapshot.setPlayerNickname(nickNameField.getText());
}
});
propertiesPanel.add(nickNameField);
//TODO: Remove after testing if nickname for leave group is no longer needed
// propertiesPanel.add(this.componentsFactory.getTextLabel("Your nickname(for leave option):", FontStyle.REGULAR, 16));
// JTextField nickNameField = this.componentsFactory.getTextField(this.generalSnapshot.getPlayerNickname(), FontStyle.DEFAULT, 15f);
// nickNameField.addFocusListener(new FocusAdapter() {
// @Override
// public void focusLost(FocusEvent e) {
// generalSnapshot.setPlayerNickname(nickNameField.getText());
// }
// });
// propertiesPanel.add(nickNameField);
root.add(this.componentsFactory.wrapToSlide(propertiesPanel, AppThemeColor.ADR_BG, 2, 0, 2, 2), BorderLayout.PAGE_START);
return root;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public class FramesManager implements AsSubscriber {
private AdrManager adrManager;
private TrayIcon trayIcon;

public AbstractOverlaidFrame taskBarFrame;

private FramesManager() {
this.framesMap = new HashMap<>();
this.locationCommander = new SetUpLocationCommander();
Expand All @@ -76,7 +78,7 @@ public void start() {
});
baseInitThread.start();

AbstractOverlaidFrame taskBarFrame = new TaskBarFrame();
taskBarFrame = new TaskBarFrame();
this.locationCommander.addFrame((AbstractMovableComponentFrame) taskBarFrame);
this.scaleCommander.addFrame((AbstractScalableComponentFrame) taskBarFrame);

Expand Down
13 changes: 13 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,17 @@
[
{
"version": "1.3.4",
"minorChanges": [
{
"changed": "Leave button was changed that it no longer requires player name to be set up in configuration"
}
],
"fix": [
{
"changed": "Fixed all tooltips that didn't work"
}
]
},
{
"version": "1.3.3",
"features": [
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/com/mercury/platform/AppMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public static void main(String[] args) {
System.setProperty("sun.java2d.d3d", "false");
System.setProperty("jna.nosys", "true");

UIManager.put("ToolTipManager.enableToolTipMode", "allWindows");
boolean standalone = BooleanUtils.toBoolean(System.getProperty("standalone"));
boolean dev = BooleanUtils.toBoolean(System.getProperty("dev"));
boolean hideLoadingIcon = BooleanUtils.toBoolean(System.getProperty("hideLoadingIcon"));
Expand Down
8 changes: 4 additions & 4 deletions release_files/release_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
<opt>-XX:+UseG1GC</opt>
</jre>
<versionInfo>
<fileVersion>1.3.3.0</fileVersion>
<txtFileVersion>1.3.3</txtFileVersion>
<fileVersion>1.3.4.0</fileVersion>
<txtFileVersion>1.3.4</txtFileVersion>
<fileDescription>MercuryTrade</fileDescription>
<copyright>Morph21</copyright>
<productVersion>1.3.3.0</productVersion>
<txtProductVersion>1.3.3</txtProductVersion>
<productVersion>1.3.4.0</productVersion>
<txtProductVersion>1.3.4</txtProductVersion>
<productName>MercuryTrade</productName>
<companyName>Morph</companyName>
<internalName>MercuryTrade</internalName>
Expand Down

0 comments on commit cb44df5

Please sign in to comment.