Skip to content

Commit 9ddba4a

Browse files
committed
auto-detect obb files
1 parent 5ff959a commit 9ddba4a

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

src/org/ancurio/mkxp/MKXPActivity.java

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
import org.ancurio.button_mapping.VirtualButton;
1212
import org.libsdl.app.SDLActivity;
1313

14+
import java.io.File;
1415
import java.io.FileOutputStream;
1516
import java.io.IOException;
1617
import java.io.InputStream;
1718
import java.io.OutputStream;
19+
import java.util.ArrayList;
1820

1921
public class MKXPActivity extends SDLActivity
2022
{
@@ -25,21 +27,31 @@ protected String getGameDirectory() {
2527

2628
/** Configure for RTP assets */
2729
protected String[] getRTPPaths() {
28-
return new String[] {
29-
getObbDir() + "/obb_type_main.2000028.obb",
30-
getObbDir() + "/obb_type_patch.2000028.obb",
31-
};
30+
ArrayList<String> rtps = new ArrayList();
31+
32+
// Add all OBB files for this app
33+
File obbDirFile = getObbDir();
34+
File[] obbFiles = obbDirFile.listFiles();
35+
if (obbFiles != null) {
36+
for (File obbFile : obbFiles) {
37+
if (obbFile.isFile() && obbFile.getName().toLowerCase().endsWith(".obb")) {
38+
rtps.add(obbFile.getAbsolutePath());
39+
}
40+
}
41+
}
42+
43+
return rtps.toArray(new String[0]);
3244
}
3345

3446
/** Configure for Scripts.rxdata */
3547
protected String getScriptsRelativePath() {
36-
return "ScriptsNew.rxdata";
48+
return "GameScripts.rxdata";
3749
}
3850

3951
/** Android assets to copy to the game folder */
4052
protected String[] getAssetsToCopy() {
4153
return new String[] {
42-
"ScriptsNew.rxdata",
54+
"GameScripts.rxdata",
4355
};
4456
}
4557

@@ -48,8 +60,8 @@ protected String[] getAssetsToCopy() {
4860
@Override
4961
protected String[] getLibraries() {
5062
return new String[] {
51-
"openal",
52-
"mkxp",
63+
"openal",
64+
"mkxp",
5365
};
5466
}
5567

0 commit comments

Comments
 (0)