Guest User

Untitled

a guest
Sep 12th, 2025
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.73 KB | None | 0 0
  1. diff --git a/.gitignore b/.gitignore
  2. index 5cb9637..db91911 100644
  3. --- a/.gitignore
  4. +++ b/.gitignore
  5. @@ -1,2 +1,4 @@
  6. /bin
  7. /lib
  8. +/target
  9. +/.idea
  10. diff --git a/pom.xml b/pom.xml
  11. new file mode 100644
  12. index 0000000..c908825
  13. --- /dev/null
  14. +++ b/pom.xml
  15. @@ -0,0 +1,22 @@
  16. +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  17. + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  18. + <modelVersion>4.0.0</modelVersion>
  19. + <!-- The Basics -->
  20. + <groupId>IsaacG</groupId>
  21. + <artifactId>PortraitPackEditor</artifactId>
  22. + <version>2.24</version>
  23. + <dependencies>
  24. + <dependency>
  25. + <groupId>com.github</groupId>
  26. + <artifactId>webp-imageio-core</artifactId>
  27. + <version>0.1.3</version>
  28. + <scope>system</scope>
  29. + <systemPath>${project.basedir}/lib/webp-imageio-core-0.1.3.jar</systemPath>
  30. + </dependency>
  31. + <dependency>
  32. + <groupId>org.json</groupId>
  33. + <artifactId>json</artifactId>
  34. + <version>20200518</version>
  35. + </dependency>
  36. + </dependencies>
  37. +</project>
  38. \ No newline at end of file
  39. diff --git a/src/com/CyanCorn/portrait/GUI/GUIFactory.java b/src/com/CyanCorn/portrait/GUI/GUIFactory.java
  40. index d33fe52..6ed96f8 100644
  41. --- a/src/com/CyanCorn/portrait/GUI/GUIFactory.java
  42. +++ b/src/com/CyanCorn/portrait/GUI/GUIFactory.java
  43. @@ -928,19 +928,19 @@ public class GUIFactory {
  44. if (OS.contains("WIN")) {
  45. // it is simply the location of the "AppData" folder
  46. workingDirectory = System.getenv("AppData");
  47. - }
  48. - // Otherwise, we assume Linux or Mac
  49. + } else if (OS.contains("LINUX")) {
  50. + workingDirectory = System.getProperty("user.home") + "/.local/share";
  51. + }
  52. + // Otherwise, we assume Mac
  53. else {
  54. // in either case, we would start in the user's home directory
  55. workingDirectory = System.getProperty("user.home");
  56. // if we are on a Mac, we are not done, we look for "Application Support"
  57. - workingDirectory += File.separator + "Library" + File.separator + "Application Support";
  58. + workingDirectory += "/Library/Application Support";
  59. }
  60. // we are now free to set the workingDirectory to the subdirectory that is our
  61. // folder.
  62. - String output = (workingDirectory + suffix);
  63. - // m_PackDirectory = new File(workingDirectory + "/Strive/bodies");
  64. - return output;
  65. + return workingDirectory + suffix;
  66. }
  67.  
  68. private SettingsObject loadDefaultSettings() {
  69. @@ -981,7 +981,7 @@ public class GUIFactory {
  70. for (String str : getCategories(fileNameTemplate)) {
  71. fileTagTemplate.add(str);
  72. for (char c : fileNameTemplate.substring(fileNameTemplate.indexOf(str)).toCharArray()) {
  73. - if (c == File.separatorChar) {
  74. + if (c == '\\') { // settings.json uses a backslash for directory separators
  75. fileTagTemplate.add(File.separator);
  76. } else if (c == '{') {
  77. break;
  78. diff --git a/src/com/CyanCorn/portrait/main/Pair.java b/src/com/CyanCorn/portrait/main/Pair.java
  79. index ffd3979..0ec1e18 100644
  80. --- a/src/com/CyanCorn/portrait/main/Pair.java
  81. +++ b/src/com/CyanCorn/portrait/main/Pair.java
  82. @@ -1,24 +1,20 @@
  83. package com.CyanCorn.portrait.main;
  84.  
  85. public class Pair<K, V> {
  86. - private static int hash = 0;
  87. - private int myHash;
  88. - public Pair(K k, V v){
  89. - this.key = k;
  90. - this.value = v;
  91. - myHash = ++hash;
  92. - }
  93. - private K key;
  94. - private V value;
  95. - boolean equals​(Object o) {if(o instanceof Pair<?, ?>) {
  96. - return ((Pair<?, ?>) o).getKey​().equals(this.getKey​()) && ((Pair<?, ?>) o).getValue​().equals(this.getValue​());
  97. - }// Test this Pair for equality with another Object.
  98. - else {
  99. - return false;
  100. - }
  101. - }
  102. - public K getKey​() {return key;}// Gets the key for this pair.
  103. - public V getValue​() {return value;}// Gets the value for this pair.
  104. - int hashCode​() {return myHash;}// Generate a hash code for this Pair.
  105. - String toString​() {return "";}// String representation of this Pair.
  106. +
  107. + public Pair(K k, V v) {
  108. + this.key = k;
  109. + this.value = v;
  110. + }
  111. +
  112. + private K key;
  113. + private V value;
  114. +
  115. + public K getKey​() {
  116. + return key;
  117. + }// Gets the key for this pair.
  118. +
  119. + public V getValue​() {
  120. + return value;
  121. + }// Gets the value for this pair.
  122. }
  123. \ No newline at end of file
  124. diff --git a/src/com/CyanCorn/test/InitialTests.java b/src/com/CyanCorn/test/InitialTests.java
  125. deleted file mode 100644
  126. index d35ea35..0000000
  127. --- a/src/com/CyanCorn/test/InitialTests.java
  128. +++ /dev/null
  129. @@ -1,7 +0,0 @@
  130. -package com.CyanCorn.test;
  131. -
  132. -import static org.junit.jupiter.api.Assertions.assertEquals;
  133. -
  134. -public class InitialTests {
  135. -
  136. -}
Advertisement
Add Comment
Please, Sign In to add comment