56 lines
2.6 KiB
C#
56 lines
2.6 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.IO;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace MxFilterGen2
|
|||
|
{
|
|||
|
internal class Program
|
|||
|
{
|
|||
|
public static string version = "1.0.0";
|
|||
|
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())
|
|||
|
{
|
|||
|
Message.CMW($"Section: {s}",true,2);
|
|||
|
foreach (string f in JSON.settings.GetType())
|
|||
|
{
|
|||
|
Compiler.section.Compile(s, f);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
foreach (string f in JSON.settings.GetType())
|
|||
|
{
|
|||
|
Message.CMW($"Creating the {f} filter...", true, 2);
|
|||
|
string outp = "out/" + fname + "_" + f + ".filter";
|
|||
|
////////// Splash //////////
|
|||
|
File.AppendAllText(outp, $"#### Filson - PoE2 Item Filter JSON Parsing - MxFilterGen2 v{Program.version}{Environment.NewLine}");
|
|||
|
File.AppendAllText(outp, $"#### Filson and MxFilterGen2 are developped by mikx.{Environment.NewLine}");
|
|||
|
File.AppendAllText(outp, $"#### MxGit: https://mxgit.ovh/mikx/PoE-MxFilterGen2{Environment.NewLine}");
|
|||
|
File.AppendAllText(outp, $"#### MxPoE: https://mxpoe.ovh/{Environment.NewLine}");
|
|||
|
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())
|
|||
|
{
|
|||
|
File.AppendAllText(outp, $"# {sspl}{Environment.NewLine}");
|
|||
|
}
|
|||
|
File.AppendAllText(outp, $"{Environment.NewLine}");
|
|||
|
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")));
|
|||
|
File.AppendAllText("out/" + fname + "_" + f + ".filter", Environment.NewLine ?? "");
|
|||
|
}
|
|||
|
}
|
|||
|
Console.ReadKey();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|