Skip to content

Commit 3878501

Browse files
committed
set char edit url as constant
1 parent 7ce083e commit 3878501

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

illaclient/src/main/java/illarion/client/Servers.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ public enum Servers {
7272
*/
7373
private final int serverPort;
7474

75+
/**
76+
* The URL of character edit to launch.
77+
*/
78+
public static final String CHARACTER_EDIT_URL = "https://illarion.org/community/account/us_charlist.php";
79+
7580
/**
7681
* Default ENUM constructor for the enumeration entries. It creates a definition of a server and stores it to the
7782
* enumeration constants.

illaclient/src/main/java/illarion/client/gui/controller/CharScreenController.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import de.lessvoid.nifty.tools.SizeValue;
2929
import illarion.client.Game;
3030
import illarion.client.Login;
31+
import illarion.client.Servers;
3132
import illarion.client.util.Lang;
3233
import illarion.common.config.ConfigChangedEvent;
3334
import org.bushe.swing.event.annotation.AnnotationProcessor;
@@ -261,11 +262,9 @@ public void fillCharsListBox() {
261262
public void openEditor() {
262263
if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
263264
try {
264-
Desktop.getDesktop().browse(new URI("https://illarion.org/community/account/us_charlist.php"));
265-
} catch (IOException e) {
266-
throw new RuntimeException(e);
267-
} catch (URISyntaxException e) {
268-
throw new RuntimeException(e);
265+
Desktop.getDesktop().browse(new URI(Servers.CHARACTER_EDIT_URL));
266+
} catch (IOException | URISyntaxException e1) {
267+
log.warn("Can't launch browser: ", e1);
269268
}
270269
}
271270
}

0 commit comments

Comments
 (0)