using System.Text; using System; using System.IO; using System.Threading; using System.Threading.Tasks; using UndertaleModLib.Util;
EnsureDataLoaded();
string exportFolder = PromptChooseDirectory(); if (exportFolder is null) throw new ScriptException("The export folder was not set.");
string stringsPath = Path.Combine(exportFolder, "strings.txt"); //Overwrite Check One if (File.Exists(stringsPath)) { bool overwriteCheckOne = ScriptQuestion(@"A 'strings.txt' file already exists. Would you like to overwrite it?"); if (!overwriteCheckOne) { ScriptError("A 'strings.txt' file already exists. Please remove it and try again.", "Error: Export already exists."); return; } File.Delete(stringsPath); }
using (StreamWriter writer = new StreamWriter(stringsPath)) { foreach (var str in Data.Strings) { if (str.Content.Contains("\n") || str.Content.Contains("\r")) continue; if (str.Content.StartsWith("* ")) writer.WriteLine(str.Content); } }
using System.Text; using System; using System.IO; using System.Threading; using System.Threading.Tasks; using UndertaleModLib.Util;
EnsureDataLoaded();
if (Data.ToolInfo.ProfileMode) { ScriptMessage("This script will not modify your existing edited GML code registered in your profile. Please use GML editing for text editing, or a script like FindAndReplace, for editing strings within these code entries."); } else { if (!(ScriptQuestion("This script will recompile all code entries in your profile (if they exist) to the default decompiled output. Continue?"))) return; foreach (UndertaleCode c in Data.Code) NukeProfileGML(c.Name.Content); }
string importFolder = PromptChooseDirectory(); if (importFolder is null) throw new ScriptException("The import folder was not set.");
// Overwrite Check One string stringsPath = Path.Combine(importFolder, "strings.txt"); if (!File.Exists(stringsPath)) { ScriptError("No 'strings.txt' file exists!", "Error"); return; }
using (StreamReader reader = new StreamReader(stringsPath)) { var a=0; foreach (var str in Data.Strings) { if (str.Content.Contains("\n") || str.Content.Contains("\r")) continue; if (str.Content.StartsWith("* ")) str.Content=reader.ReadLine(); a+=1; } }