Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/.gitignore b/.gitignore
- index 5cb9637..db91911 100644
- --- a/.gitignore
- +++ b/.gitignore
- @@ -1,2 +1,4 @@
- /bin
- /lib
- +/target
- +/.idea
- diff --git a/pom.xml b/pom.xml
- new file mode 100644
- index 0000000..c908825
- --- /dev/null
- +++ b/pom.xml
- @@ -0,0 +1,22 @@
- +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
- + <modelVersion>4.0.0</modelVersion>
- + <!-- The Basics -->
- + <groupId>IsaacG</groupId>
- + <artifactId>PortraitPackEditor</artifactId>
- + <version>2.24</version>
- + <dependencies>
- + <dependency>
- + <groupId>com.github</groupId>
- + <artifactId>webp-imageio-core</artifactId>
- + <version>0.1.3</version>
- + <scope>system</scope>
- + <systemPath>${project.basedir}/lib/webp-imageio-core-0.1.3.jar</systemPath>
- + </dependency>
- + <dependency>
- + <groupId>org.json</groupId>
- + <artifactId>json</artifactId>
- + <version>20200518</version>
- + </dependency>
- + </dependencies>
- +</project>
- \ No newline at end of file
- diff --git a/src/com/CyanCorn/portrait/GUI/GUIFactory.java b/src/com/CyanCorn/portrait/GUI/GUIFactory.java
- index d33fe52..6ed96f8 100644
- --- a/src/com/CyanCorn/portrait/GUI/GUIFactory.java
- +++ b/src/com/CyanCorn/portrait/GUI/GUIFactory.java
- @@ -928,19 +928,19 @@ public class GUIFactory {
- if (OS.contains("WIN")) {
- // it is simply the location of the "AppData" folder
- workingDirectory = System.getenv("AppData");
- - }
- - // Otherwise, we assume Linux or Mac
- + } else if (OS.contains("LINUX")) {
- + workingDirectory = System.getProperty("user.home") + "/.local/share";
- + }
- + // Otherwise, we assume Mac
- else {
- // in either case, we would start in the user's home directory
- workingDirectory = System.getProperty("user.home");
- // if we are on a Mac, we are not done, we look for "Application Support"
- - workingDirectory += File.separator + "Library" + File.separator + "Application Support";
- + workingDirectory += "/Library/Application Support";
- }
- // we are now free to set the workingDirectory to the subdirectory that is our
- // folder.
- - String output = (workingDirectory + suffix);
- - // m_PackDirectory = new File(workingDirectory + "/Strive/bodies");
- - return output;
- + return workingDirectory + suffix;
- }
- private SettingsObject loadDefaultSettings() {
- @@ -981,7 +981,7 @@ public class GUIFactory {
- for (String str : getCategories(fileNameTemplate)) {
- fileTagTemplate.add(str);
- for (char c : fileNameTemplate.substring(fileNameTemplate.indexOf(str)).toCharArray()) {
- - if (c == File.separatorChar) {
- + if (c == '\\') { // settings.json uses a backslash for directory separators
- fileTagTemplate.add(File.separator);
- } else if (c == '{') {
- break;
- diff --git a/src/com/CyanCorn/portrait/main/Pair.java b/src/com/CyanCorn/portrait/main/Pair.java
- index ffd3979..0ec1e18 100644
- --- a/src/com/CyanCorn/portrait/main/Pair.java
- +++ b/src/com/CyanCorn/portrait/main/Pair.java
- @@ -1,24 +1,20 @@
- package com.CyanCorn.portrait.main;
- public class Pair<K, V> {
- - private static int hash = 0;
- - private int myHash;
- - public Pair(K k, V v){
- - this.key = k;
- - this.value = v;
- - myHash = ++hash;
- - }
- - private K key;
- - private V value;
- - boolean equals(Object o) {if(o instanceof Pair<?, ?>) {
- - return ((Pair<?, ?>) o).getKey().equals(this.getKey()) && ((Pair<?, ?>) o).getValue().equals(this.getValue());
- - }// Test this Pair for equality with another Object.
- - else {
- - return false;
- - }
- - }
- - public K getKey() {return key;}// Gets the key for this pair.
- - public V getValue() {return value;}// Gets the value for this pair.
- - int hashCode() {return myHash;}// Generate a hash code for this Pair.
- - String toString() {return "";}// String representation of this Pair.
- +
- + public Pair(K k, V v) {
- + this.key = k;
- + this.value = v;
- + }
- +
- + private K key;
- + private V value;
- +
- + public K getKey() {
- + return key;
- + }// Gets the key for this pair.
- +
- + public V getValue() {
- + return value;
- + }// Gets the value for this pair.
- }
- \ No newline at end of file
- diff --git a/src/com/CyanCorn/test/InitialTests.java b/src/com/CyanCorn/test/InitialTests.java
- deleted file mode 100644
- index d35ea35..0000000
- --- a/src/com/CyanCorn/test/InitialTests.java
- +++ /dev/null
- @@ -1,7 +0,0 @@
- -package com.CyanCorn.test;
- -
- -import static org.junit.jupiter.api.Assertions.assertEquals;
- -
- -public class InitialTests {
- -
- -}
Advertisement
Add Comment
Please, Sign In to add comment