Browse Source

parsing multi worded names

feature-config-parsing
FatBoy-DOTC 5 months ago
parent
commit
887db109c1
  1. 12
      src/engine/ConfigParsing/EffectsParser.java

12
src/engine/ConfigParsing/EffectsParser.java

@ -61,7 +61,17 @@ public class EffectsParser { @@ -61,7 +61,17 @@ public class EffectsParser {
effectData.conditions = new ArrayList<>();
try {
effectData.name = compiledLines.get(1).replace(" ", "").replace("\"", "").split(" ")[1];
String rawData = compiledLines.get(1).replace(" ", "");
if(compiledLines.get(1).contains("\"")){
int startIndex = rawData.indexOf('"');
int endIndex = rawData.lastIndexOf('"');
char[] nameValue = rawData.toCharArray();
String name = "";
for(int i = startIndex; i < endIndex; i++){
name += nameValue[i];
}
effectData.name = name;
}
int iconID;
try {
iconID = Integer.parseInt(compiledLines.get(1).replace(" ", "").split(" ")[2]);

Loading…
Cancel
Save