fix gonzo executing same fscript, remove incomplete korean and chinese translations from being processed by suggs, 'fix' fscript XML new-line processing, add new xml create-at that inserts before index
This commit is contained in:
parent
a91ba62bf8
commit
6e292212fd
|
@ -17,7 +17,7 @@ configurations {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation group: 'net.lingala.zip4j', name: 'zip4j', version: '2.11.5'
|
implementation group: 'net.lingala.zip4j', name: 'zip4j', version: '2.11.5'
|
||||||
implementation group: 'org.json', name: 'json', version: '20240303'
|
implementation group: 'org.json', name: 'json', version: '20240303'
|
||||||
implementation "io.github.java-diff-utils:java-diff-utils:4.12"
|
implementation group: 'io.github.java-diff-utils', name: 'java-diff-utils', version: '4.12'
|
||||||
|
|
||||||
implementation 'com.jetbrains.intellij.java:java-gui-forms-rt:203.7148.30'
|
implementation 'com.jetbrains.intellij.java:java-gui-forms-rt:203.7148.30'
|
||||||
antTask 'com.jetbrains.intellij.java:java-compiler-ant-tasks:203.7148.30'
|
antTask 'com.jetbrains.intellij.java:java-compiler-ant-tasks:203.7148.30'
|
||||||
|
|
|
@ -171,6 +171,7 @@ public class Gonzo {
|
||||||
File fscript = new File(Main.inpath + "temp/fscript");
|
File fscript = new File(Main.inpath + "temp/fscript");
|
||||||
if (fscript.exists()) {
|
if (fscript.exists()) {
|
||||||
new Rizzo(new FileInputStream(fscript), Main.inpath + "temp/"); // Lets rizz this mod up
|
new Rizzo(new FileInputStream(fscript), Main.inpath + "temp/"); // Lets rizz this mod up
|
||||||
|
fscript.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (new File(System.getProperty("user.home") + "/.firestar/temp/delete.txt").isFile()) {
|
if (new File(System.getProperty("user.home") + "/.firestar/temp/delete.txt").isFile()) {
|
||||||
|
|
|
@ -31,6 +31,7 @@ import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -76,9 +77,9 @@ public class Rizzo {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean parseArgs(String[] args, Object context) throws FirescriptFormatException {
|
private boolean parseArgs(String[] args, Object context) throws FirescriptFormatException {
|
||||||
|
System.out.println("Parsing Command: " + Arrays.toString(args));
|
||||||
if (args.length > 0) {
|
if (args.length > 0) {
|
||||||
if (context == null) {
|
if (context == null) {
|
||||||
System.out.println("Parsing Command: " + Arrays.toString(args));
|
|
||||||
if (args[0].equalsIgnoreCase("fscript")) {
|
if (args[0].equalsIgnoreCase("fscript")) {
|
||||||
ver = Integer.parseInt(args[1]); // We'll do shit with this later
|
ver = Integer.parseInt(args[1]); // We'll do shit with this later
|
||||||
if (ver > maxVer) throw new FirescriptFormatException(args[0], "script too new");
|
if (ver > maxVer) throw new FirescriptFormatException(args[0], "script too new");
|
||||||
|
@ -88,121 +89,121 @@ public class Rizzo {
|
||||||
parseArgs(Arrays.copyOfRange(args, 2, args.length), newCtx);
|
parseArgs(Arrays.copyOfRange(args, 2, args.length), newCtx);
|
||||||
} else throw new FirescriptFormatException("fscript", "unknown command '" + args[0] + "'");
|
} else throw new FirescriptFormatException("fscript", "unknown command '" + args[0] + "'");
|
||||||
} else {
|
} else {
|
||||||
System.out.println("Parsing Command: " + Arrays.toString(args) + " with context: " + context.getClass().getName() + "@" + context.hashCode());
|
System.out.println("Using context: " + context.getClass().getName() + "@" + context.hashCode());
|
||||||
if (args[0].equals("{")) {
|
if (args[0].equals("{")) {
|
||||||
System.out.println("New context parse: " + context.getClass().getName() + "@" + context.hashCode());
|
System.out.println("New context block: " + context.getClass().getName() + "@" + context.hashCode());
|
||||||
parseScript(context);
|
parseScript(context);
|
||||||
} else if (args[0].equals("}")) {
|
} else if (args[0].equals("}")) {
|
||||||
System.out.println("Ending context block: " + context.getClass().getName() + "@" + context.hashCode());
|
System.out.println("Ending context block: " + context.getClass().getName() + "@" + context.hashCode());
|
||||||
return false;
|
return false;
|
||||||
} else if (context instanceof File file) {
|
} else if (context instanceof File file) {
|
||||||
if (!file.exists()) return true;
|
if (file.exists()) {
|
||||||
if (args[0].equalsIgnoreCase("delete")) {
|
if (args[0].equalsIgnoreCase("delete")) {
|
||||||
System.out.println("Deleting: " + file.getPath());
|
System.out.println("Deleting: " + file.getPath());
|
||||||
if (file.getAbsolutePath().startsWith(workingDir)) {
|
if (file.getAbsolutePath().startsWith(workingDir)) {
|
||||||
if (file.isDirectory()) Main.deleteDir(file);
|
if (file.isDirectory()) Main.deleteDir(file);
|
||||||
else file.delete();
|
else file.delete();
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("xml")) {
|
} else if (args[0].equalsIgnoreCase("xml")) {
|
||||||
try {
|
|
||||||
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
|
|
||||||
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
|
|
||||||
// Mmmm, love me some INVALID XML corrections
|
|
||||||
ReplacingInputStream ris = new ReplacingInputStream(new ReplacingInputStream(new FileInputStream(file), "&", "&"), "\n", " ");
|
|
||||||
Document doc = docBuilder.parse(ris);
|
|
||||||
Node n = doc.createProcessingInstruction(StreamResult.PI_DISABLE_OUTPUT_ESCAPING, "\n");
|
|
||||||
parseArgs(Arrays.copyOfRange(args, 1, args.length), doc);
|
|
||||||
try {
|
try {
|
||||||
FileOutputStream output = new FileOutputStream(file);
|
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
|
||||||
Transformer transformer = TransformerFactory.newInstance().newTransformer();
|
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
|
||||||
|
// Mmmm, love me some INVALID XML corrections.
|
||||||
|
ReplacingInputStream ris = new ReplacingInputStream(new ReplacingInputStream(new ReplacingInputStream(new FileInputStream(file), "\r\n", ""), "&", "&"), "\n", " ");
|
||||||
|
Document doc = docBuilder.parse(ris);
|
||||||
|
parseArgs(Arrays.copyOfRange(args, 1, args.length), doc);
|
||||||
|
try {
|
||||||
|
FileOutputStream output = new FileOutputStream(file);
|
||||||
|
Transformer transformer = TransformerFactory.newInstance().newTransformer();
|
||||||
|
|
||||||
StreamResult result = new StreamResult(new StringWriter());
|
StreamResult result = new StreamResult(new StringWriter());
|
||||||
DOMSource source = new DOMSource(doc);
|
DOMSource source = new DOMSource(doc);
|
||||||
|
|
||||||
transformer.transform(source, result);
|
transformer.transform(source, result);
|
||||||
// Look ma, I'm breaking XML standards!
|
// Look ma, I'm breaking XML standards!
|
||||||
String xmlString = result.getWriter().toString()
|
String xmlString = result.getWriter().toString()
|
||||||
.replace("&", "&")
|
.replace("&", "&")
|
||||||
.replace("	", "\t")
|
.replace("	", "\t")
|
||||||
.replace("", "\b")
|
.replace("", "\b")
|
||||||
.replace(" ", "\n")
|
.replace(" ", "\n")
|
||||||
.replace(" ", "\r")
|
.replace(" ", "\r")
|
||||||
.replace("", "\f");
|
.replace("", "\f");
|
||||||
try (PrintStream ps = new PrintStream(output)) {
|
try (PrintStream ps = new PrintStream(output)) {
|
||||||
ps.print(xmlString);
|
ps.print(xmlString);
|
||||||
|
}
|
||||||
|
} catch (TransformerException ex) {
|
||||||
|
Logger.getLogger(Rizzo.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
} catch (TransformerException ex) {
|
} catch (SAXException | IOException | ParserConfigurationException ex) {
|
||||||
Logger.getLogger(Rizzo.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(Rizzo.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
} catch (SAXException | IOException | ParserConfigurationException ex) {
|
} else if (args[0].equalsIgnoreCase("str") || args[0].equalsIgnoreCase("xstr")) {
|
||||||
Logger.getLogger(Rizzo.class.getName()).log(Level.SEVERE, null, ex);
|
try {
|
||||||
}
|
FileInputStream fis = new FileInputStream(file);
|
||||||
} else if (args[0].equalsIgnoreCase("str") || args[0].equalsIgnoreCase("xstr")) {
|
ByteArrayInputStream bais = new ByteArrayInputStream(fis.readAllBytes());
|
||||||
try {
|
fis.close();
|
||||||
FileInputStream fis = new FileInputStream(file);
|
FileOutputStream fos = new FileOutputStream(file);
|
||||||
ByteArrayInputStream bais = new ByteArrayInputStream(fis.readAllBytes());
|
if (args[1].equalsIgnoreCase("append")) {
|
||||||
fis.close();
|
bais.transferTo(fos);
|
||||||
FileOutputStream fos = new FileOutputStream(file);
|
for (int s = 0; s < args[2].length(); s++) {
|
||||||
if (args[1].equalsIgnoreCase("append")) {
|
char c = args[2].charAt(s);
|
||||||
bais.transferTo(fos);
|
fos.write(c);
|
||||||
for (int s = 0; s < args[2].length(); s++) {
|
}
|
||||||
char c = args[2].charAt(s);
|
} else if (args[1].equalsIgnoreCase("replace") || args[1].equalsIgnoreCase("delete")) {
|
||||||
fos.write(c);
|
String replacement = "";
|
||||||
|
if (args[1].equalsIgnoreCase("replace")) replacement = args[3];
|
||||||
|
ReplacingInputStream ris;
|
||||||
|
if (args[0].equalsIgnoreCase("xstr")) ris = new ReplacingInputStream(bais, args[2], replacement, false);
|
||||||
|
else ris = new ReplacingInputStream(bais, args[2], replacement);
|
||||||
|
ris.transferTo(fos);
|
||||||
|
ris.close();
|
||||||
}
|
}
|
||||||
} else if (args[1].equalsIgnoreCase("replace") || args[1].equalsIgnoreCase("delete")) {
|
fos.flush();
|
||||||
String replacement = "";
|
fos.close();
|
||||||
if (args[1].equalsIgnoreCase("replace")) replacement = args[3];
|
} catch (IOException ex) {
|
||||||
ReplacingInputStream ris;
|
Logger.getLogger(Rizzo.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
if (args[0].equalsIgnoreCase("xstr")) ris = new ReplacingInputStream(bais, args[2], replacement, false);
|
|
||||||
else ris = new ReplacingInputStream(bais, args[2], replacement);
|
|
||||||
ris.transferTo(fos);
|
|
||||||
ris.close();
|
|
||||||
}
|
}
|
||||||
fos.flush();
|
} else if (args[0].equalsIgnoreCase("binedit")) {
|
||||||
fos.close();
|
int offset = Integer.parseInt(args[1]);
|
||||||
} catch (IOException ex) {
|
String bytes = args[2];
|
||||||
Logger.getLogger(Rizzo.class.getName()).log(Level.SEVERE, null, ex);
|
if (bytes.length() % 2 != 0) throw new FirescriptFormatException(args[0], "invalid length of bytes");
|
||||||
}
|
try {
|
||||||
} else if (args[0].equalsIgnoreCase("binedit")) {
|
byte[] ba;
|
||||||
int offset = Integer.parseInt(args[1]);
|
try (FileInputStream fis = new FileInputStream(file)) {
|
||||||
String bytes = args[2];
|
ba = fis.readAllBytes();
|
||||||
if (bytes.length() % 2 != 0) throw new FirescriptFormatException(args[0], "invalid length of bytes");
|
|
||||||
try {
|
|
||||||
byte[] ba;
|
|
||||||
try (FileInputStream fis = new FileInputStream(file)) {
|
|
||||||
ba = fis.readAllBytes();
|
|
||||||
}
|
|
||||||
if (offset >= ba.length) throw new FirescriptFormatException(args[0], "offset is larger than file size");
|
|
||||||
else {
|
|
||||||
byte[] in = HexFormat.of().parseHex(bytes);
|
|
||||||
System.arraycopy(in, 0, ba, offset, in.length);
|
|
||||||
try (FileOutputStream fos = new FileOutputStream(file)) {
|
|
||||||
fos.write(ba);
|
|
||||||
fos.flush();
|
|
||||||
}
|
}
|
||||||
|
if (offset >= ba.length) throw new FirescriptFormatException(args[0], "offset is larger than file size");
|
||||||
|
else {
|
||||||
|
byte[] in = HexFormat.of().parseHex(bytes);
|
||||||
|
System.arraycopy(in, 0, ba, offset, in.length);
|
||||||
|
try (FileOutputStream fos = new FileOutputStream(file)) {
|
||||||
|
fos.write(ba);
|
||||||
|
fos.flush();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (IOException ex) {
|
||||||
|
Logger.getLogger(Rizzo.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
} catch (IOException ex) {
|
} else if (args[0].equalsIgnoreCase("patch")) {
|
||||||
Logger.getLogger(Rizzo.class.getName()).log(Level.SEVERE, null, ex);
|
try {
|
||||||
}
|
List<String> original = Files.readAllLines(file.toPath());
|
||||||
} else if (args[0].equalsIgnoreCase("patch")) {
|
File patchFile = new File(workingDir + args[1]);
|
||||||
try {
|
if (!patchFile.exists()) throw new FirescriptFormatException(args[0], "patch file doesn't exist");
|
||||||
List<String> original = Files.readAllLines(file.toPath());
|
List<String> patched = Files.readAllLines(patchFile.toPath());
|
||||||
File patchFile = new File(workingDir + args[1]);
|
|
||||||
if (!patchFile.exists()) throw new FirescriptFormatException(args[0], "patch file doesn't exist");
|
|
||||||
List<String> patched = Files.readAllLines(patchFile.toPath());
|
|
||||||
|
|
||||||
Patch<String> patch = UnifiedDiffUtils.parseUnifiedDiff(patched);
|
Patch<String> patch = UnifiedDiffUtils.parseUnifiedDiff(patched);
|
||||||
List<String> result = DiffUtils.patch(original, patch);
|
List<String> result = DiffUtils.patch(original, patch);
|
||||||
|
|
||||||
try (FileWriter fileWriter = new FileWriter(file)) {
|
try (FileWriter fileWriter = new FileWriter(file)) {
|
||||||
for (String str : result) {
|
for (String str : result) {
|
||||||
fileWriter.write(str + "\r\n");
|
fileWriter.write(str + "\r\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (FirescriptFormatException | PatchFailedException | IOException ex) {
|
||||||
|
Logger.getLogger(Rizzo.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
} catch (FirescriptFormatException | PatchFailedException | IOException ex) {
|
} else throw new FirescriptFormatException("file", "unknown command '" + args[0] + "'");
|
||||||
Logger.getLogger(Rizzo.class.getName()).log(Level.SEVERE, null, ex);
|
} else System.out.println("fscript: file context not found, skipping.");
|
||||||
}
|
|
||||||
} else throw new FirescriptFormatException("file", "unknown command '" + args[0] + "'");
|
|
||||||
} else if (context instanceof Document document) {
|
} else if (context instanceof Document document) {
|
||||||
if (args[0].equalsIgnoreCase("modify")) {
|
if (args[0].equalsIgnoreCase("modify")) {
|
||||||
Element elem = (Element)traverse(document, args[1]);
|
Element elem = (Element)traverse(document, args[1]);
|
||||||
|
@ -226,8 +227,7 @@ public class Rizzo {
|
||||||
try {
|
try {
|
||||||
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
|
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
|
||||||
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
|
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
|
||||||
|
ReplacingInputStream ris = new ReplacingInputStream(new ReplacingInputStream(new ReplacingInputStream(new FileInputStream(new File(workingDir + args[1])), "\r\n", ""), "&", "&"), "\n", " ");
|
||||||
ReplacingInputStream ris = new ReplacingInputStream(new FileInputStream(new File(workingDir + args[1])), "&", "&");
|
|
||||||
Document outDoc = docBuilder.parse(ris);
|
Document outDoc = docBuilder.parse(ris);
|
||||||
|
|
||||||
NamedNodeMap nnm = outDoc.getDocumentElement().getAttributes();
|
NamedNodeMap nnm = outDoc.getDocumentElement().getAttributes();
|
||||||
|
@ -253,17 +253,44 @@ public class Rizzo {
|
||||||
else if (args[1].equalsIgnoreCase("value"))
|
else if (args[1].equalsIgnoreCase("value"))
|
||||||
element.setNodeValue(args[2]);
|
element.setNodeValue(args[2]);
|
||||||
} else if (args[0].equalsIgnoreCase("create")) {
|
} else if (args[0].equalsIgnoreCase("create")) {
|
||||||
String newTag = args[1].substring(args[1].lastIndexOf(".")+1);
|
String finalTag = args[1];
|
||||||
String newID = "";
|
String path = "";
|
||||||
if (newTag.contains("#")) {
|
if (finalTag.lastIndexOf(".") > 0) {
|
||||||
newID = newTag.substring(newTag.indexOf("#")+1);
|
path = args[1].substring(0, finalTag.lastIndexOf("."));
|
||||||
newTag = newTag.substring(0, newTag.indexOf("#"));
|
finalTag = args[1].substring(finalTag.lastIndexOf(".")+1);
|
||||||
}
|
}
|
||||||
Element newElem = element.getOwnerDocument().createElement(newTag);
|
String id = "";
|
||||||
if (newID != null && newID.length() > 0) newElem.setAttribute("id", newID);
|
String name = "";
|
||||||
traverse(element, args[1].substring(0, args[1].lastIndexOf("."))).appendChild(newElem);
|
if (finalTag.contains("#")) {
|
||||||
parseArgs(Arrays.copyOfRange(args, 2, args.length), newElem);
|
id = finalTag.substring(finalTag.indexOf("#")+1);
|
||||||
} else throw new FirescriptFormatException("");
|
finalTag = finalTag.substring(0, finalTag.indexOf("#"));
|
||||||
|
} else if (finalTag.contains("$")) {
|
||||||
|
name = finalTag.substring(finalTag.indexOf("$")+1);
|
||||||
|
finalTag = finalTag.substring(0, finalTag.indexOf("$"));
|
||||||
|
}
|
||||||
|
Element finalElem = element.getOwnerDocument().createElement(finalTag);
|
||||||
|
if (id != null && id.length() > 0) finalElem.setAttribute("id", id);
|
||||||
|
if (name != null && name.length() > 0) finalElem.setAttribute("name", name);
|
||||||
|
traverse(element, path).appendChild(finalElem);
|
||||||
|
parseArgs(Arrays.copyOfRange(args, 2, args.length), finalElem);
|
||||||
|
} else if (args[0].equalsIgnoreCase("create-at")) {
|
||||||
|
int index = Integer.parseInt(args[1]);
|
||||||
|
String finalTag = args[2];
|
||||||
|
String id = "";
|
||||||
|
String name = "";
|
||||||
|
if (finalTag.contains("#")) {
|
||||||
|
id = finalTag.substring(finalTag.indexOf("#")+1);
|
||||||
|
finalTag = finalTag.substring(0, finalTag.indexOf("#"));
|
||||||
|
} else if (finalTag.contains("$")) {
|
||||||
|
name = finalTag.substring(finalTag.indexOf("$")+1);
|
||||||
|
finalTag = finalTag.substring(0, finalTag.indexOf("$"));
|
||||||
|
}
|
||||||
|
Element finalElem = element.getOwnerDocument().createElement(finalTag);
|
||||||
|
if (id != null && id.length() > 0) finalElem.setAttribute("id", id);
|
||||||
|
if (name != null && name.length() > 0) finalElem.setAttribute("name", name);
|
||||||
|
element.insertBefore(finalElem, element.getChildNodes().item(index));
|
||||||
|
parseArgs(Arrays.copyOfRange(args, 3, args.length), finalElem);
|
||||||
|
} else throw new FirescriptFormatException("xml", "unknown element command '" + args[0] + "'");
|
||||||
} else throw new FirescriptFormatException("context is unknown");
|
} else throw new FirescriptFormatException("context is unknown");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -272,7 +299,7 @@ public class Rizzo {
|
||||||
|
|
||||||
private Node traverse(Node owner, String selector) throws FirescriptFormatException {
|
private Node traverse(Node owner, String selector) throws FirescriptFormatException {
|
||||||
if (selector == null || selector.length() == 0 || owner == null) {
|
if (selector == null || selector.length() == 0 || owner == null) {
|
||||||
return null;
|
return owner;
|
||||||
}
|
}
|
||||||
String[] elems = selector.split("\\.");
|
String[] elems = selector.split("\\.");
|
||||||
Node parent = owner;
|
Node parent = owner;
|
||||||
|
@ -302,6 +329,7 @@ public class Rizzo {
|
||||||
ns = ((Element)parent).getElementsByTagName(tag);
|
ns = ((Element)parent).getElementsByTagName(tag);
|
||||||
for (int i = 0; i < ns.getLength(); i++) {
|
for (int i = 0; i < ns.getLength(); i++) {
|
||||||
Node n = ns.item(i);
|
Node n = ns.item(i);
|
||||||
|
if (n.getNodeName().equals("#text")) continue;
|
||||||
if (((Element)n).getAttribute("id").equals(id)) {
|
if (((Element)n).getAttribute("id").equals(id)) {
|
||||||
newParent = (Element)n;
|
newParent = (Element)n;
|
||||||
break;
|
break;
|
||||||
|
@ -315,6 +343,7 @@ public class Rizzo {
|
||||||
ns = ((Element)parent).getChildNodes();
|
ns = ((Element)parent).getChildNodes();
|
||||||
for (int i = 0; i < ns.getLength(); i++) {
|
for (int i = 0; i < ns.getLength(); i++) {
|
||||||
Node n = ns.item(i);
|
Node n = ns.item(i);
|
||||||
|
if (n.getNodeName().equals("#text")) continue;
|
||||||
if (((Element)n).getAttribute("name").equals(name)) {
|
if (((Element)n).getAttribute("name").equals(name)) {
|
||||||
newParent = (Element)n;
|
newParent = (Element)n;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -453,31 +453,31 @@ public class Suggs implements ActionListener, ListSelectionListener {
|
||||||
oArtistLine = "";
|
oArtistLine = "";
|
||||||
}
|
}
|
||||||
int i2 = 0;
|
int i2 = 0;
|
||||||
while (i2 < 17 /*17 languages*/) {
|
while (i2 < 15 /*17 languages*/) {
|
||||||
String language = "INTERNAL_ERROR";
|
String language = "INTERNAL_ERROR";
|
||||||
switch (i2) {
|
switch (i2) {
|
||||||
case 0: language = "american"; break;
|
case 0 -> language = "american";
|
||||||
case 1: language = "danish"; break;
|
case 1 -> language = "danish";
|
||||||
case 2: language = "dutch"; break;
|
case 2 -> language = "dutch";
|
||||||
case 3: language = "english"; break;
|
case 3 -> language = "english";
|
||||||
case 4: language = "finnish"; break;
|
case 4 -> language = "finnish";
|
||||||
case 5: language = "french"; break;
|
case 5 -> language = "french";
|
||||||
case 6: language = "german"; break;
|
case 6 -> language = "german";
|
||||||
case 7: language = "italian"; break;
|
case 7 -> language = "italian";
|
||||||
case 8: language = "japanese"; break;
|
case 8 -> language = "japanese";
|
||||||
case 9: language = "korean"; break;
|
case 9 -> language = "norwegian";
|
||||||
case 10: language = "norwegian"; break;
|
case 10 -> language = "polish";
|
||||||
case 11: language = "polish"; break;
|
case 11 -> language = "portuguese";
|
||||||
case 12: language = "portuguese"; break;
|
case 12 -> language = "russian";
|
||||||
case 13: language = "russian"; break;
|
case 13 -> language = "spanish";
|
||||||
case 14: language = "spanish"; break;
|
case 14 -> language = "swedish";
|
||||||
case 15: language = "swedish"; break;
|
default -> {
|
||||||
case 16: language = "traditionalchinese"; break;
|
int result = JOptionPane.showConfirmDialog(frame, "Firestar encountered an internal error.\nString 'language' exported to FSCRIPT was blank.", "Fatal Error", JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);
|
||||||
default:
|
if (result == JOptionPane.OK_OPTION) {System.exit(1);} //user safety
|
||||||
int result = JOptionPane.showConfirmDialog(frame, "Firestar encountered an internal error.\nString 'language' exported to FSCRIPT was blank.", "Fatal Error", JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);
|
}
|
||||||
if (result == JOptionPane.OK_OPTION) {System.exit(1);} //user safety
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
//case 9: language = "korean"; break;
|
||||||
|
//case 16: language = "traditionalchinese"; break;
|
||||||
ps.println("file \"data/plugins/languages/"+language+"/entries.xml\" xml "+ocmd+" StringTable.entry#MT_"+trackno+" set attribute \"string\" \""+oArtistLine+oTitle.replace("\"", "\\\"")+"\"");
|
ps.println("file \"data/plugins/languages/"+language+"/entries.xml\" xml "+ocmd+" StringTable.entry#MT_"+trackno+" set attribute \"string\" \""+oArtistLine+oTitle.replace("\"", "\\\"")+"\"");
|
||||||
i2++;
|
i2++;
|
||||||
}
|
}
|
||||||
|
@ -596,7 +596,7 @@ public class Suggs implements ActionListener, ListSelectionListener {
|
||||||
|
|
||||||
progressDialog.destroyDialog();
|
progressDialog.destroyDialog();
|
||||||
frame.dispose();
|
frame.dispose();
|
||||||
//Main.deleteDir(new File(Main.inpath + "temp/ffmpeg/"));
|
Main.deleteDir(new File(Main.inpath + "temp/ffmpeg/"));
|
||||||
Clifford saveDialog = new Clifford();
|
Clifford saveDialog = new Clifford();
|
||||||
saveDialog.isSoundtrack = true;
|
saveDialog.isSoundtrack = true;
|
||||||
saveDialog.Action(frame, new File(Main.inpath + "temp/"));
|
saveDialog.Action(frame, new File(Main.inpath + "temp/"));
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user