Skip to content

Commit

Permalink
added folder offset option, fixed titlebar
Browse files Browse the repository at this point in the history
  • Loading branch information
zmilla93 committed Jan 15, 2021
1 parent 7dbbf90 commit 0c72e62
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.slimtrade</groupId>
<artifactId>slim-trade</artifactId>
<version>0.3.0</version>
<version>0.3.1</version>
<packaging>jar</packaging>

<name>slimtrade</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class SettingsSaveFile {
// Basics
public String characterName = "";
public boolean showGuildName = false;
public boolean folderOffset = true;
public boolean colorBlindMode = false;
public ColorTheme colorTheme = ColorTheme.SOLARIZED_LIGHT;
public QuickPasteSetting quickPasteSetting = QuickPasteSetting.DISABLED;
Expand Down
10 changes: 1 addition & 9 deletions src/main/java/com/slimtrade/core/update/UpdateManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,6 @@ public String getVersionTag() {
return patcher.getLatestVersion();
}

// public void setLatestVersion(String version) {
// latestVersion = version;
// }

// public String getLatestVersion() {
// return latestVersion;
// }

public ArrayList<ReleaseData> getReleaseData() {
if (releases == null) {
releases = fetchReleaseData();
Expand Down Expand Up @@ -181,8 +173,8 @@ public void runProcess(String... args) {

public void runDelayedUpdateCheck() {
scheduler.schedule(() -> {
System.out.println("Running daily update check...");
App.update = App.updateManager.isUpdateAvailable(true);
System.out.println("CHECKING UPDATE!!");
System.out.println("Latest Version : " + App.updateManager.patcher.getLatestVersion());
if (App.update) {
FrameManager.optionsWindow.showUpdateButton();
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/slimtrade/gui/basic/AbstractWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public AbstractWindow(String title, boolean makeCloseButton) {
}

public AbstractWindow(String title, boolean makeCloseButton, boolean makePinButton) {
super(false);
String fullTitle = "SlimTrade - " + title;
this.setTitle(fullTitle);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public BasicMovableDialog() {

public BasicMovableDialog(boolean createListeners) {
if (createListeners) {
createListeners((JPanel) this.getContentPane());
createListeners((JPanel) getContentPane());
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/slimtrade/gui/menubar/MenubarDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ public void click(MouseEvent evt) {
FrameManager.messageManager.addMessage(t3, false);

FrameManager.messageManager.addMessage(new TradeOffer(MessageType.NOTIFICATION, "Update Available!", "Check the options menu to install."));
// FrameManager.messageManager.addMessage(t5, false);
// FrameManager.messageManager.setPlayerJoinedArea("HighlightTrader123");
}
});

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/slimtrade/gui/options/OptionsWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ public OptionsWindow() {
// Set menubar visibility
FrameManager.menubarToggle.setShow(App.saveManager.settingsSaveFile.enableMenubar);

// Update Stash Helper Container
FrameManager.stashHelperContainer.updateLocation();

if (reloadHistory) {
new Thread(() -> {
// Restart file monitor
Expand Down
21 changes: 20 additions & 1 deletion src/main/java/com/slimtrade/gui/options/general/BasicsPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class BasicsPanel extends ContainerPanel implements ISaveable, IColorable

private JTextField characterInput = new LimitTextField(32);
private JCheckBox guildCheckbox = new CustomCheckbox();
private JCheckBox folderOffsetCheckbox = new CustomCheckbox();
private JCheckBox colorBlindCheckbox = new CustomCheckbox();
private CustomCombo<ColorTheme> colorThemeCombo = new CustomCombo<>();
private CustomCombo<QuickPasteSetting> quickPasteCombo = new CustomCombo<>();
Expand All @@ -35,6 +36,7 @@ public class BasicsPanel extends ContainerPanel implements ISaveable, IColorable
//Labels
private JLabel characterLabel;
private JLabel guildLabel;
private JLabel folderOffsetLabel;
private JLabel colorBlindLabel;
private JLabel colorThemeLabel;
private JLabel quickPasteLabel;
Expand All @@ -46,8 +48,11 @@ public BasicsPanel() {
colorBlindLabel = new CustomLabel("Color Blind Mode");
colorThemeLabel = new CustomLabel("Color Theme");
quickPasteLabel = new CustomLabel("Quick Paste");
folderOffsetLabel = new CustomLabel("Folder Offset");
quickPasteHotkeyLabel = new CustomLabel("Quick Paste Hotkey");

folderOffsetLabel.setToolTipText("Increases the stash helper offset to account for tabs inside folders");

JPanel showGuildContainer = new JPanel(new BorderLayout());
guildCheckbox.setOpaque(false);
showGuildContainer.setOpaque(false);
Expand All @@ -70,6 +75,10 @@ public BasicsPanel() {
quickPasteHotkeyContainer.setOpaque(false);
quickPasteHotkeyContainer.add(quickPasteHotkeyInput, BorderLayout.EAST);

JPanel folderOffsetContainer = new JPanel(new BorderLayout());
folderOffsetContainer.setOpaque(false);
folderOffsetContainer.add(folderOffsetCheckbox, BorderLayout.EAST);

editOverlayButton.setText("Edit Overlay Size & Location");

for (ColorTheme theme : ColorTheme.values()) {
Expand Down Expand Up @@ -104,7 +113,7 @@ public BasicsPanel() {
gc.gridx = 0;
gc.gridy++;

// show Guild
// Show Guild
gc.insets.bottom = 0;
container.add(guildLabel, gc);
gc.gridx = 2;
Expand All @@ -113,6 +122,14 @@ public BasicsPanel() {
gc.gridx = 0;
gc.gridy++;

// Folder Offset
container.add(folderOffsetLabel, gc);
gc.gridx = 2;

container.add(folderOffsetContainer, gc);
gc.gridx = 0;
gc.gridy++;

// Colorblind Mode
container.add(colorBlindLabel, gc);
gc.gridx = 2;
Expand Down Expand Up @@ -198,6 +215,7 @@ public void save() {
ColorTheme colorTheme = (ColorTheme) colorThemeCombo.getSelectedItem();
App.saveManager.settingsSaveFile.characterName = characterName;
App.saveManager.settingsSaveFile.showGuildName = guildCheckbox.isSelected();
App.saveManager.settingsSaveFile.folderOffset = folderOffsetCheckbox.isSelected();
App.saveManager.settingsSaveFile.colorBlindMode = colorBlindCheckbox.isSelected();
App.saveManager.settingsSaveFile.colorTheme = colorTheme;
App.saveManager.settingsSaveFile.quickPasteSetting = (QuickPasteSetting) quickPasteCombo.getSelectedItem();
Expand All @@ -209,6 +227,7 @@ public void load() {
String characterName = App.saveManager.settingsSaveFile.characterName;
characterInput.setText(characterName);
guildCheckbox.setSelected(App.saveManager.settingsSaveFile.showGuildName);
folderOffsetCheckbox.setSelected(App.saveManager.settingsSaveFile.folderOffset);
colorBlindCheckbox.setSelected(App.saveManager.settingsSaveFile.colorBlindMode);
ColorManager.setColorBlindMode(App.saveManager.settingsSaveFile.colorBlindMode);
colorThemeCombo.setSelectedItem(App.saveManager.settingsSaveFile.colorTheme);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class SearchTermsPanel extends JPanel implements IColorable {

private JLabel searchTermsLabel = new CustomLabel("Search Terms");
private JLabel ignoreTermsLabel = new CustomLabel("Ignore Terms");
private JLabel info1 = new CustomLabel("Separate terms using commas, semicolons, or new lines.");
private JLabel info1 = new CustomLabel("Separate phrases using commas, semicolons, or new lines.");
private JLabel info2 = new CustomLabel("Scanning is case insensitive. Irregular spacing is ignored.");

public JTextArea searchTermsInput = new CustomTextArea(2, 45);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ public class StashHelperContainer extends BasicDialog {
//TODO : Should probably get spacing X directly from stash overlay left buffer
private static final long serialVersionUID = 1L;
public static int height = StashHelper.height;
private int spacingX = 5;
private int SPACING_X = 5;
private final int SMALL_OFFSET_Y = 20;
private final int LARGE_OFFSET_Y = 55;

//TODO : Recheck all resizing
public StashHelperContainer() {
this.setBackground(ColorManager.CLEAR);
this.setBounds(0, 0, 0, 0);
this.setLayout(new FlowLayout(FlowLayout.LEFT, spacingX, 0));
this.setLayout(new FlowLayout(FlowLayout.LEFT, SPACING_X, 0));
this.pack();
this.addMouseListener(new MouseAdapter() {
public void mouseEntered(MouseEvent e) {
Expand All @@ -29,7 +31,8 @@ public void mouseEntered(MouseEvent e) {
}

public void updateLocation() {
this.setLocation(App.saveManager.stashSaveFile.windowX, App.saveManager.stashSaveFile.windowY - 15);
int offset = App.saveManager.settingsSaveFile.folderOffset ? LARGE_OFFSET_Y : SMALL_OFFSET_Y;
this.setLocation(App.saveManager.stashSaveFile.windowX, App.saveManager.stashSaveFile.windowY - offset);
this.pack();
}

Expand Down

0 comments on commit 0c72e62

Please sign in to comment.