1.1.2 - Renamed JSON.settings to JSON.Settings + Minor tweaks

This commit is contained in:
mikx
2024-12-29 12:45:09 -05:00
parent 8038d18d23
commit 807fb8d06c
5 changed files with 21 additions and 17 deletions

View File

@@ -3,26 +3,27 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace MxFilterGen2
{
internal class Program
{
public static string version = "1.1.1";
public static string version = "1.1.2";
public static string docpath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
static void Main(string[] args)
{
Message.Splash("MxFilterGen2", "mikx");
IO.Cleaner.CleanOut();
IO.Creator.CreateBaseDir();
string fname = JSON.settings.GetName();
foreach (string s in JSON.settings.GetStructure())
string fname = JSON.Settings.GetName();
foreach (string s in JSON.Settings.GetStructure())
{
if (s != "GEN")
{
Message.CMW($"Section: {s}", true, 2);
foreach (string f in JSON.settings.GetType())
foreach (string f in JSON.Settings.GetType())
{
Compiler.section.Compile(s, f);
}
@@ -47,13 +48,13 @@ namespace MxFilterGen2
string genstring = "";
foreach (var g in gens)
{
foreach (string f in JSON.settings.GetType())
foreach (string f in JSON.Settings.GetType())
{
File.AppendAllText($"out/{f}/GEN.filter",File.ReadAllText(g));
}
}
foreach (string f in JSON.settings.GetType())
foreach (string f in JSON.Settings.GetType())
{
Message.CMW($"Creating the {f} filter...", true, 2);
string outp = "out/" + fname + "_" + f + ".filter";
@@ -65,12 +66,12 @@ namespace MxFilterGen2
File.AppendAllText(outp, $"#### Contact: mikx@mxpoe.ovh / http://discord.mxg.ovh{Environment.NewLine}");
File.AppendAllText(outp, $"{Environment.NewLine}");
File.AppendAllText(outp, $"#### SECTIONS{Environment.NewLine}");
foreach (var sspl in JSON.settings.GetStructure())
foreach (var sspl in JSON.Settings.GetStructure())
{
File.AppendAllText(outp, $"# {sspl}{Environment.NewLine}");
}
File.AppendAllText(outp, $"{Environment.NewLine}");
foreach (var structure in JSON.settings.GetStructure())
foreach (var structure in JSON.Settings.GetStructure())
{
File.AppendAllText("out/" + fname + "_" + f + ".filter", string.Format("#### SECTION: {0}", (object)structure) + Environment.NewLine);
File.AppendAllText("out/" + fname + "_" + f + ".filter", File.ReadAllText(string.Format("out/" + f + "/" + structure + ".filter")));
@@ -78,12 +79,12 @@ namespace MxFilterGen2
}
}
if (JSON.settings.GetInstall())
if (JSON.Settings.GetInstall())
{
Message.CMW($"Install is \"True\". Installing to the game directory...", true, 1);
foreach (string f in JSON.settings.GetType())
foreach (string f in JSON.Settings.GetType())
{
File.Copy($"out/{JSON.settings.GetName()}_{f}.filter", $@"{docpath}\My Games\Path of Exile 2\{JSON.settings.GetName()}_{f}.filter", true);
File.Copy($"out/{JSON.Settings.GetName()}_{f}.filter", $@"{docpath}\My Games\Path of Exile 2\{JSON.Settings.GetName()}_{f}.filter", true);
}
foreach (var s in Directory.EnumerateFiles("sound"))
{
@@ -92,9 +93,11 @@ namespace MxFilterGen2
}
} else
{
int fc = JSON.settings.GetType().Count;
int fc = JSON.Settings.GetType().Count;
Message.CMW($"Install is \"False\". Use the {fc} Filter(s) from the \"out\" directory.", true, 1);
}
Message.CMW($"Waiting 5 seconds before exiting...", true, 1);
Thread.Sleep(5000);
}
}
}