Skip to content

Commit

Permalink
removed temp poe2 outgoing trade fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zmilla93 committed Dec 18, 2024
1 parent ab61510 commit 3894777
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 103 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<groupId>github.zmilla93</groupId>
<artifactId>slimtrade</artifactId>
<version>0.5.0-pre5</version>
<version>0.5.0-pre6</version>
<packaging>jar</packaging>

<properties>
Expand Down
19 changes: 3 additions & 16 deletions src/main/java/github/zmilla93/core/chatparser/ChatParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import github.zmilla93.core.data.IgnoreItemData;
import github.zmilla93.core.data.PlayerMessage;
import github.zmilla93.core.managers.AudioManager;
import github.zmilla93.core.managers.HotkeyManager;
import github.zmilla93.core.managers.SaveManager;
import github.zmilla93.core.poe.Game;
import github.zmilla93.core.trading.LangRegex;
Expand Down Expand Up @@ -54,11 +53,8 @@ public class ChatParser implements FileTailerListener {
// Regex
public static final String CLIENT_MESSAGE_REGEX = "((?<date>\\d{4}\\/\\d{2}\\/\\d{2}) (?<time>\\d{2}:\\d{2}:\\d{2}))?.*] (?<message>.+)";
public static final String CLIENT_WHISPER_REGEX = "@(?<messageType>От кого|\\S+) (?<guildName><.+>)? ?(?<playerName>[^:]+):(\\s+)(?<message>.+)";
// FIXME : POE2 is currently missing the to/from part of whispers, so it uses a different pattern.
public static final String CLIENT_WHISPER_REGEX_POE2 = "(?<messageType>@)(?<playerName>[^:]+):(\\s+)(?<message>.+)";
private static final Pattern clientMessage = Pattern.compile(CLIENT_MESSAGE_REGEX);
private static final Pattern clientWhisper = Pattern.compile(CLIENT_WHISPER_REGEX);
private static final Pattern clientWhisperPoe2 = Pattern.compile(CLIENT_WHISPER_REGEX_POE2);

public ChatParser(Game game) {
this.game = game;
Expand Down Expand Up @@ -125,8 +121,7 @@ public void parseLine(String line) {
// Whispers
if (firstChar == '@') {
whisperCount++;
Pattern whisperPattern = game == Game.PATH_OF_EXILE_1 ? clientWhisper : clientWhisperPoe2;
Matcher whisperMatcher = whisperPattern.matcher(fullMessage);
Matcher whisperMatcher = clientWhisper.matcher(fullMessage);
if (whisperMatcher.matches()) {
String message = whisperMatcher.group("message");
String guildName = game.isPoe1() ? whisperMatcher.group("guildName") : null;
Expand All @@ -138,7 +133,8 @@ public void parseLine(String line) {
metaData.message = message;
metaData.guildName = guildName;
metaData.playerName = playerName;
metaData.offerType = getOfferType(messageType);
metaData.offerType = LangRegex.getMessageType(messageType);
if (metaData.offerType == TradeOfferType.UNKNOWN) return;
if (message != null && handleTradeOffer(metaData, message)) {
tradeCount++;
return;
Expand All @@ -149,15 +145,6 @@ public void parseLine(String line) {
if (handleChatScanner(line)) return;
}

private TradeOfferType getOfferType(String messageType) {
if (game.isPoe1()) return LangRegex.getMessageType(messageType);
else {
if (HotkeyManager.isHotkeyPressed(SaveManager.settingsSaveFile.data.poe2OutgoingTradeHotkey))
return TradeOfferType.OUTGOING_TRADE;
return TradeOfferType.INCOMING_TRADE;
}
}

private boolean handleChatScanner(String line) {
if (!SaveManager.chatScannerSaveFile.data.searching) return false;
Matcher chatMatcher = References.chatPatten.matcher(line);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/github/zmilla93/core/enums/SetupPhase.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
*/
public enum SetupPhase {

INSTALL_DIRECTORY, GAME_WINDOW, USING_STASH_FOLDERS, POE_2_OUTGOING_TRADE_FIX
INSTALL_DIRECTORY, GAME_WINDOW, USING_STASH_FOLDERS

}
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ public int getCurrentTargetVersion() {
public boolean hasInitUsingStashFolders;
public Poe1Settings settingsPoe1 = new Poe1Settings();
public Poe2Settings settingsPoe2 = new Poe2Settings();
// TODO : Hopefully this hotkey is temporary :^)
public HotkeyData poe2OutgoingTradeHotkey;
// Path of Exile - Shared Between Games
public GameWindowMode gameWindowMode = GameWindowMode.UNSET;
public Rectangle detectedGameBounds;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/github/zmilla93/core/trading/LangRegex.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package github.zmilla93.core.trading;

import github.zmilla93.core.References;
import github.zmilla93.modules.updater.ZLogger;

import java.util.HashSet;
import java.util.Set;
Expand Down Expand Up @@ -132,7 +131,7 @@ public static TradeOfferType getMessageType(String toFrom) {
toFrom = toFrom.toLowerCase();
if (incomingTags.contains(toFrom)) return TradeOfferType.INCOMING_TRADE;
if (outgoingTags.contains(toFrom)) return TradeOfferType.OUTGOING_TRADE;
ZLogger.err("Invalid message type: " + toFrom);
// ZLogger.err("Invalid message type: " + toFrom);
return TradeOfferType.UNKNOWN;
}

Expand Down

This file was deleted.

4 changes: 0 additions & 4 deletions src/main/java/github/zmilla93/gui/managers/SetupManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ public static ArrayList<SetupPhase> getSetupPhases() {
// Using Stash Folders
if (!SaveManager.settingsSaveFile.data.hasInitUsingStashFolders)
setupPhases.add(SetupPhase.USING_STASH_FOLDERS);
// POE2 Outgoing Trade Fix
if (SaveManager.settingsSaveFile.data.poe2OutgoingTradeHotkey == null)
if (!SaveManager.settingsSaveFile.data.settingsPoe2.notInstalled)
setupPhases.add(SetupPhase.POE_2_OUTGOING_TRADE_FIX);
// Add any forced setup phases
if (!App.forcedSetupPhases.isEmpty()) {
for (SetupPhase phase : App.forcedSetupPhases) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import github.zmilla93.gui.components.MonitorPicker;
import github.zmilla93.gui.components.poe.POEFolderPicker;
import github.zmilla93.gui.components.poe.POEInstallFolderExplanationPanel;
import github.zmilla93.gui.components.poe.Poe2OutgoingTradeHotkeyPanel;
import github.zmilla93.gui.components.poe.detection.GameDetectionButton;
import github.zmilla93.gui.managers.FrameManager;
import github.zmilla93.gui.options.AbstractOptionPanel;
Expand All @@ -38,7 +37,6 @@ public class PathOfExileOptionPanel extends AbstractOptionPanel implements ISava
private final POEFolderPicker poe2FolderPicker = new POEFolderPicker(Game.PATH_OF_EXILE_2);
private final AbstractOptionPanel poe1OptionPanel = new AbstractOptionPanel(false, false);
private final AbstractOptionPanel poe2OptionPanel = new AbstractOptionPanel(false, false);
private final Poe2OutgoingTradeHotkeyPanel poe2OutgoingTradeHotkeyPanel = new Poe2OutgoingTradeHotkeyPanel();

public PathOfExileOptionPanel() {
windowModeCombo.addItem(GameWindowMode.DETECT);
Expand All @@ -65,8 +63,6 @@ public PathOfExileOptionPanel() {
addComponent(poe2FolderPicker);
addFullWidthComponent(poe2OptionPanel);
addVerticalStrut();
addFullWidthComponent(poe2OutgoingTradeHotkeyPanel);
addVerticalStrut();

/// Explain Install Files
addHeader("More Info");
Expand Down Expand Up @@ -117,7 +113,6 @@ public void save() {
SaveManager.settingsSaveFile.data.settingsPoe2.installFolder = poe2FolderPicker.getPathString();
SaveManager.settingsSaveFile.data.settingsPoe1.usingStashFolder = usingStashFoldersPoe1Checkbox.isSelected();
SaveManager.settingsSaveFile.data.settingsPoe2.usingStashFolder = usingStashFoldersPoe2Checkbox.isSelected();
SaveManager.settingsSaveFile.data.poe2OutgoingTradeHotkey = poe2OutgoingTradeHotkeyPanel.hotkeyButton.getData();
FrameManager.stashHelperContainerPoe1.updateLocation();
FrameManager.stashHelperContainerPoe2.updateLocation();
// FIXME : Need to reinit parsers if paths have changed.
Expand All @@ -140,7 +135,6 @@ public void load() {
poe2FolderPicker.setSelectedPath(SaveManager.settingsSaveFile.data.settingsPoe2.installFolder);
usingStashFoldersPoe1Checkbox.setSelected(SaveManager.settingsSaveFile.data.settingsPoe1.usingStashFolder);
usingStashFoldersPoe2Checkbox.setSelected(SaveManager.settingsSaveFile.data.settingsPoe2.usingStashFolder);
poe2OutgoingTradeHotkeyPanel.hotkeyButton.setData(SaveManager.settingsSaveFile.data.poe2OutgoingTradeHotkey);
refreshPanelVisibility();
detectionButton.reset();
}
Expand Down

This file was deleted.

4 changes: 0 additions & 4 deletions src/main/java/github/zmilla93/gui/setup/SetupWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public class SetupWindow extends JFrame implements IDefaultSizeAndLocation {
private final InstallFolderSetupPanel installFolderPanel = new InstallFolderSetupPanel();
private final GameWindowSetupPanel gameDetectionPanel = new GameWindowSetupPanel();
private final StashFolderSetupPanel stashFolderPanel = new StashFolderSetupPanel();
private final Poe2OutgoingTradeFixSetupPanel poe2OutgoingTradeFixPanel = new Poe2OutgoingTradeFixSetupPanel();

public SetupWindow() {
setDefaultCloseOperation(EXIT_ON_CLOSE);
Expand Down Expand Up @@ -106,9 +105,6 @@ public void buildSetupCardPanel() {
case USING_STASH_FOLDERS:
addSetupPanel(stashFolderPanel);
break;
case POE_2_OUTGOING_TRADE_FIX:
addSetupPanel(poe2OutgoingTradeFixPanel);
break;
}
}
cardPanel.add(finishPanel);
Expand Down
37 changes: 37 additions & 0 deletions src/main/resources/patch_notes/v0.5.0-pre6.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
**Save file is not backwards compatible. Backup "settings.json" if you want to be cautious. (Options > Information > Settings Folder)**

## Known Issues
- Theme & UI improvements incomplete
- History window hasn't been properly updated
- "Zone" text replacement doesn't work

## pre6
- Fixed poe2 outgoing whisper detection, removed temporary hotkey

## Path of Exile 2
- SlimTrade now works seamlessly with Path of Exile 1 & 2
- Added currency icons & translations for PoE2 (updated for PoE1)
- **PoE2 broke incoming/outgoing whisper detection, so PoE2 outgoing trades require an extra hotkey until fixed by GGG**

## Game Window
- Added a new window detection system for UI alignment, replacing the old stash alignment window
- Unpinned windows are now centered relative to the game window on launch

## Additional Changes
- Many small UI improvements
- Adjusted the way windows are displayed on top of the game window
- Fixed a crash on systems that don't support a system tray
- Fixed preferred font changed the first time you saved after installing
- Possible improvements for Mac & Linux (untested)

## Cloud Gaming
- Added partial support for GeForce Now (other platforms upon request)
- Features that require access to game files DO NOT work (trade popups, chat scanner, history)
- All other features should work (game macros, cheat sheets, stash/npc searching)
- Things might be buggy

## How to Install
- Make sure you have [Java](https://www.java.com) installed
- Download and run 'SlimTrade.jar' from 'Assets' below

*Having issues? Check the [troubleshooting guide](https://github.com/zmilla93/SlimTrade/wiki/Troubleshooting).*

0 comments on commit 3894777

Please # to comment.