|
8 | 8 | import com.nyrds.pixeldungeon.ml.R;
|
9 | 9 | import com.nyrds.platform.app.RemixedDungeonApp;
|
10 | 10 | import com.nyrds.platform.game.Game;
|
| 11 | +import com.nyrds.util.ModError; |
11 | 12 | import com.nyrds.util.ModdingMode;
|
12 | 13 | import com.nyrds.util.Util;
|
13 | 14 | import com.watabou.pixeldungeon.utils.GLog;
|
|
18 | 19 | import org.json.JSONException;
|
19 | 20 |
|
20 | 21 | import java.io.BufferedReader;
|
21 |
| -import java.io.File; |
22 |
| -import java.io.FileInputStream; |
23 | 22 | import java.io.InputStream;
|
24 | 23 | import java.io.InputStreamReader;
|
25 | 24 | import java.lang.reflect.Field;
|
@@ -92,15 +91,10 @@ private static void clearModStrings() {
|
92 | 91 |
|
93 | 92 | @SneakyThrows
|
94 | 93 | private static void parseStrings(String resource) {
|
95 |
| - File jsonFile = ModdingMode.getFile(resource); |
96 |
| - if (jsonFile == null || !jsonFile.exists()) { |
97 |
| - return; |
98 |
| - } |
99 |
| - |
100 | 94 | String line = Utils.EMPTY_STRING;
|
101 | 95 |
|
102 | 96 | try {
|
103 |
| - InputStream fis = new FileInputStream(jsonFile); |
| 97 | + InputStream fis = ModdingMode.getInputStream(resource); |
104 | 98 | InputStreamReader isr = new InputStreamReader(fis, StandardCharsets.UTF_8);
|
105 | 99 | BufferedReader br = new BufferedReader(isr);
|
106 | 100 |
|
@@ -136,7 +130,8 @@ private static void parseStrings(String resource) {
|
136 | 130 | br.close();
|
137 | 131 | } catch (JSONException e) {
|
138 | 132 | Game.toast("malformed json: [%s] in [%s] ignored ", line, resource);
|
139 |
| - } |
| 133 | + } catch (ModError ignored) { |
| 134 | + } |
140 | 135 | }
|
141 | 136 |
|
142 | 137 | private static Locale userSelectedLocale;
|
|
0 commit comments