···4455## Next Release
6677+### Changed
88+- Main config and logs moved to system user directory (%AppData% on Windows, etc)
99+- Added nix compatibility
1010+711### Fixed
812- (Map Editor) Fixed crash when fusing vertices
1313+- (Map Editor) (MacOS) Fixed mouse capture when accessibility permissions are not enabled
914- (Sprite Editor) Copy animation works properly
+1-5
build.gradle.kts
···166166 description = "Create zip file for Star Rod release"
167167168168 from(shadowJar.get().outputs.files)
169169-170170- from(file("database")) {
171171- into("database")
172172- }
173169174170 from(file(licenseBuildDir)) {
175175- into("database/licenses")
171171+ into("licenses")
176172 }
177173178174 from(file("exec")) {
···1313 //=======================================================================================
1414 // Directories not related to any specific project
15151616- SEED_DATABASE (Root.NONE, "/database/"), // Read-only database that comes with the jar
1717- DATABASE (Root.CONFIG, "/database/"),
1616+ DATABASE (Root.CONFIG, "/database/"),
1817 DATABASE_EDITOR (Root.CONFIG, DATABASE, "/editor/"),
1918 DATABASE_THEMES (Root.CONFIG, DATABASE, "/themes/"),
20192121- TEMP (Root.STATE, "/temp/"),
2220 LOGS (Root.STATE, "/logs/"),
2121+ TEMP (Root.STATE, "/temp/"),
23222423 //=======================================================================================
2524 // Directories contain dumped content needed for Star Rod to function
+18-28
src/main/java/app/Environment.java
···23232424import javax.imageio.ImageIO;
2525import javax.swing.ImageIcon;
2626-import javax.swing.JOptionPane;
2726import javax.swing.SwingUtilities;
28272928import org.apache.commons.io.FileExistsException;
···176175 try {
177176 Manifest manifest = new Manifest(cl.getResourceAsStream("META-INF/MANIFEST.MF"));
178177 Attributes attr = manifest.getMainAttributes();
179179-178178+180179 versionString = attr.getValue("App-Version");
181180 gitBuildBranch = attr.getValue("Build-Branch");
182181 gitBuildCommit = attr.getValue("Build-Commit");
183182 gitBuildTag = attr.getValue("Build-Tag");
184183185184 // Git info not available when built with Nix; normalise empty strings to null
186186- if (gitBuildBranch != null && gitBuildBranch.isEmpty()) gitBuildBranch = null;
187187- if (gitBuildCommit != null && gitBuildCommit.isEmpty()) gitBuildCommit = null;
188188- if (gitBuildTag != null && gitBuildTag.isEmpty()) gitBuildTag = null;
189189-185185+ if (gitBuildBranch != null && gitBuildBranch.isEmpty())
186186+ gitBuildBranch = null;
187187+ if (gitBuildCommit != null && gitBuildCommit.isEmpty())
188188+ gitBuildCommit = null;
189189+ if (gitBuildTag != null && gitBuildTag.isEmpty())
190190+ gitBuildTag = null;
191191+190192 Logger.logf("Detected version %s (%s-%s)", versionString, gitBuildBranch, gitBuildCommit);
191193 }
192194 catch (IOException | IndexOutOfBoundsException e) {
···213215 getUserStateDir().mkdirs();
214216215217 try {
216216- checkForDependencies();
218218+ unpackDatabase();
217219 File projDir = readMainConfig();
218220219221 if (projDir == null) {
···321323 }
322324 }
323325324324- private static final void checkForDependencies() throws IOException
326326+ private static final void unpackDatabase() throws IOException
325327 {
326326- File db = Directories.SEED_DATABASE.toFile();
327327-328328- if (!db.exists() || !db.isDirectory()) {
329329- SwingUtils.getErrorDialog()
330330- .setTitle("Missing Directory")
331331- .setMessage("Could not find required directory: " + db.getName(),
332332- "It should be in the same directory as the jar.")
333333- .show();
334334-335335- exit();
336336- }
328328+ File dbDir = Directories.DATABASE.toFile();
329329+ if (!dbDir.exists())
330330+ dbDir.mkdirs();
337331338338- // Copy SEED_DATABASE to DATABASE if DATABASE does not exist
339339- // TODO: handle upgrades
340340- File writeDb = Directories.DATABASE.toFile();
341341- if (!writeDb.exists()) {
342342- writeDb.mkdirs();
343343- FileUtils.copyDirectory(db, writeDb);
344344- }
332332+ Resource.copyMissing(ResourceType.ProtoDatabase, dbDir);
345333 }
346334347335 public static final File getUserConfigDir()
348336 {
349337 String userHome = System.getProperty("user.home");
350338351351- if (isWindows()) return new File(userHome, "/AppData/Local/StarRod/");
339339+ if (isWindows())
340340+ return new File(userHome, "/AppData/Local/StarRod/");
352341353342 String xdgConfigHome = System.getenv("XDG_CONFIG_HOME");
354343 String dotConfig = (xdgConfigHome != null && !xdgConfigHome.isEmpty())
···361350 {
362351 String userHome = System.getProperty("user.home");
363352364364- if (isWindows()) return new File(userHome, "/AppData/Local/StarRod/");
353353+ if (isWindows())
354354+ return new File(userHome, "/AppData/Local/StarRod/");
365355366356 String xdgStateHome = System.getenv("XDG_STATE_HOME");
367357 String dotState = (xdgStateHome != null && !xdgStateHome.isEmpty())