diff --git a/src/main/java/net/rptools/maptool/client/AppUtil.java b/src/main/java/net/rptools/maptool/client/AppUtil.java index d5c18fda29..e89e94caae 100644 --- a/src/main/java/net/rptools/maptool/client/AppUtil.java +++ b/src/main/java/net/rptools/maptool/client/AppUtil.java @@ -213,18 +213,17 @@ public static Path getInstallDirectory() { var path = Path.of(getAppInstallLocation()); if (MapTool.isDevelopment()) { // remove build/classes/java - path = path.getParent().getParent().getParent().getParent(); - } else { + path = path.getParent().getParent().getParent(); + } else { // First try to find MapTool* directory in path while (path != null) { if (path.getFileName().toString().matches("(?i).*maptool.*")) { - path = path.getParent(); break; } path = path.getParent(); } } - if (path == null) { - return Path.of(getAppInstallLocation()); + if (path == null) { // if not found then just return the parent of the app subdir + return Path.of(getAppInstallLocation()).resolve("..").toAbsolutePath(); } else { return path; } diff --git a/src/main/java/net/rptools/maptool/client/ui/preferencesdialog/PreferencesDialog.java b/src/main/java/net/rptools/maptool/client/ui/preferencesdialog/PreferencesDialog.java index 87607ebdc4..f30e655e91 100644 --- a/src/main/java/net/rptools/maptool/client/ui/preferencesdialog/PreferencesDialog.java +++ b/src/main/java/net/rptools/maptool/client/ui/preferencesdialog/PreferencesDialog.java @@ -390,6 +390,9 @@ public PreferencesDialog() { fileSyncPath = panel.getTextField("fileSyncPath"); fileSyncPathButton = (JButton) panel.getButton("fileSyncPathButton"); + final var installDirTextField = (JTextField) panel.getComponent("InstallDirTextField"); + installDirTextField.setText(AppUtil.getInstallDirectory().toString()); + publicKeyTextArea = (JTextArea) panel.getTextComponent("publicKeyTextArea"); regeneratePublicKey = (JButton) panel.getButton("regeneratePublicKey"); copyPublicKey = (JButton) panel.getButton("copyKey"); diff --git a/src/main/java/net/rptools/maptool/client/ui/preferencesdialog/PreferencesDialogView.form b/src/main/java/net/rptools/maptool/client/ui/preferencesdialog/PreferencesDialogView.form index c31facaba3..b5f9adfecd 100644 --- a/src/main/java/net/rptools/maptool/client/ui/preferencesdialog/PreferencesDialogView.form +++ b/src/main/java/net/rptools/maptool/client/ui/preferencesdialog/PreferencesDialogView.form @@ -3,7 +3,7 @@ - + @@ -970,7 +970,7 @@ - + @@ -981,7 +981,7 @@ - + @@ -1050,7 +1050,7 @@ - + @@ -1140,7 +1140,7 @@ - + @@ -1193,7 +1193,7 @@ - + @@ -1226,7 +1226,7 @@ - + @@ -1259,7 +1259,7 @@ - + @@ -1288,16 +1288,31 @@ - - - - - - + + - + - + + + + + + + + + + + + + + + + + + + + @@ -2004,7 +2019,7 @@ - + @@ -2017,7 +2032,7 @@ - + @@ -2103,7 +2118,7 @@ - + @@ -2171,7 +2186,7 @@ - + @@ -2207,7 +2222,7 @@ - + @@ -2243,7 +2258,7 @@ - + @@ -2265,12 +2280,12 @@ - + - + @@ -2304,7 +2319,7 @@ - + @@ -2315,7 +2330,7 @@ - + diff --git a/src/main/java/net/rptools/maptool/client/ui/preferencesdialog/PreferencesDialogView.java b/src/main/java/net/rptools/maptool/client/ui/preferencesdialog/PreferencesDialogView.java index 5aceef4a80..9939a1b641 100644 --- a/src/main/java/net/rptools/maptool/client/ui/preferencesdialog/PreferencesDialogView.java +++ b/src/main/java/net/rptools/maptool/client/ui/preferencesdialog/PreferencesDialogView.java @@ -14,7 +14,6 @@ */ package net.rptools.maptool.client.ui.preferencesdialog; -import java.awt.*; import javax.swing.*; public class PreferencesDialogView { diff --git a/src/main/resources/net/rptools/maptool/language/i18n.properties b/src/main/resources/net/rptools/maptool/language/i18n.properties index c8ba1b1c1e..c02409b4b7 100644 --- a/src/main/resources/net/rptools/maptool/language/i18n.properties +++ b/src/main/resources/net/rptools/maptool/language/i18n.properties @@ -691,6 +691,7 @@ Preferences.label.client.fitview = Fit GM view Preferences.label.client.fitview.tooltip = When forcing players to the GM's view, should the player's map be zoomed such that their screen shows at least the same content as the GM's screen? Preferences.label.client.default.username = Default Username Preferences.label.client.default.username.tooltip = The default username that appears in the MapTool toolbar. +Preferences.label.installDir = Installation Directory Preferences.client.webEndPoint.port = Internal Web Server End Point Port Preferences.client.webEndPoint.port.tooltip = Web Server End Point Port (Internal MapTool Only) Preferences.client.default.username.value = Anonymous User