Skip to content

Commit

Permalink
mac paths
Browse files Browse the repository at this point in the history
  • Loading branch information
bigianb committed Apr 30, 2019
1 parent e68d9cc commit eb6cefa
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bgtools/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions bgtools/src/net/ijbrown/bgtools/lmp/Config.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package net.ijbrown.bgtools.lmp;

public class Config {
public String getRootDir()
{
String osName = System.getProperty("os.name").toLowerCase();
boolean isMacOs = osName.startsWith("mac os x");

String rootDir = "/emu/bgda//";
if (isMacOs){
String home = System.getProperty("user.home");
rootDir = home+"/DARK_ALLIANCE/";
}
return rootDir;
}
}
6 changes: 4 additions & 2 deletions bgtools/src/net/ijbrown/bgtools/lmp/GobExtractor.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ public class GobExtractor
{
public static void main(String[] args) throws IOException
{
String outDir = "/emu/bgda/BG/DATA_extracted/";
String inDir = "/emu/bgda/BG/DATA/";
String root = "/Users/ian/DARK_ALLIANCE/";

String outDir = root+"BG/DATA_extracted/";
String inDir = root+"BG/DATA/";

File outDirFile = new File(outDir);
outDirFile.mkdirs();
Expand Down
16 changes: 11 additions & 5 deletions bgtools/src/net/ijbrown/bgtools/lmp/ScriptDecode.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,24 @@ public class ScriptDecode
{
public static void main(String[] args) throws IOException
{
ScriptDecode obj = new ScriptDecode();
obj.decode("tavern");
// obj.decode("cellar1");
ScriptDecode obj = new ScriptDecode(new Config().getRootDir());
obj.decode("tavern");
obj.decode("cellar1");
obj.decode("cuttown");
}

private final String rootDir;

public ScriptDecode(String rootDir) {
this.rootDir = rootDir;
}

private void decode(String levelName) throws IOException
{
String rootDir = "/emu/bgda/BG/DATA_extracted/";

String lmpName = levelName;

String outDir = rootDir + lmpName + "/" + lmpName + "_lmp/";
String outDir = rootDir + "/BG/DATA_extracted/" + lmpName + "/" + lmpName + "_lmp/";

File outDirFile = new File(outDir);
outDirFile.mkdirs();
Expand Down

0 comments on commit eb6cefa

Please sign in to comment.