Allow configurable wz directory path with launch property
Example: "java -Dwz-path=<my-custom-path> -jar Cosmic.jar "
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
@echo off
|
@echo off
|
||||||
@title Cosmic
|
@title Cosmic
|
||||||
java -Xmx2048m -jar target\Cosmic.jar
|
java -Xmx2048m -Dwz-path= -jar target\Cosmic.jar
|
||||||
pause
|
pause
|
||||||
@@ -17,7 +17,7 @@ public enum WZFiles {
|
|||||||
SOUND("Sound"),
|
SOUND("Sound"),
|
||||||
UI("UI");
|
UI("UI");
|
||||||
|
|
||||||
public static final String DIRECTORY = "wz";
|
public static final String DIRECTORY = getWzDirectory();
|
||||||
|
|
||||||
private final String fileName;
|
private final String fileName;
|
||||||
|
|
||||||
@@ -32,4 +32,15 @@ public enum WZFiles {
|
|||||||
public String getFilePath() {
|
public String getFilePath() {
|
||||||
return getFile().getPath();
|
return getFile().getPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String getWzDirectory() {
|
||||||
|
// Either provide a custom directory path through the "wz-path" property when launching the .jar,
|
||||||
|
// or don't provide one to use the default "wz" directory
|
||||||
|
String propertyPath = System.getProperty("wz-path");
|
||||||
|
if (propertyPath != null && new File(propertyPath).isDirectory()) {
|
||||||
|
return propertyPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "wz";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user