Browse Source

More PowerEntry work.

feature-config-parsing2
MagicBot 3 months ago
parent
commit
c6ab1b5468
  1. 11
      src/engine/wpak/PowersParser.java

11
src/engine/wpak/PowersParser.java

@ -55,10 +55,6 @@ public class PowersParser {
try { try {
// Remove all lines that contain a # and leading/trailing blank lines
powerData = powerData.replaceAll("(?m)^.*#.*\r?\n?", "");
StringBuilder conditionString = new StringBuilder(); StringBuilder conditionString = new StringBuilder();
StringBuilder powerString = new StringBuilder(); StringBuilder powerString = new StringBuilder();
@ -74,6 +70,13 @@ public class PowersParser {
powerString.append(powerData.substring(endPos)); powerString.append(powerData.substring(endPos));
// Cleanup dangling tags and lines that contain a # and leading/trailing blank lines
powerString = new StringBuilder(powerString.toString().replaceAll("CONDITIONBEGINCONDITIONEND", "")
.replaceAll("(?m)^.*#.*\r?\n?", ""));
conditionString = new StringBuilder(conditionString.toString().replaceAll("(?m)^.*#.*\r?\n?", ""));
String[] lineData = powerString.toString().trim().split("\n"); String[] lineData = powerString.toString().trim().split("\n");
ArrayList<String> powerHeader = new ArrayList<>(); ArrayList<String> powerHeader = new ArrayList<>();

Loading…
Cancel
Save