From f1c142af760f013b6344518672a63730a3ba2c65 Mon Sep 17 00:00:00 2001 From: mikx Date: Sat, 18 Jan 2020 20:54:50 -0500 Subject: [PATCH] Fossil Gen --- FOSSIL (GEN)/FOSSIL (GEN).csproj | 55 +++++++++++++++++++ FOSSIL (GEN)/Generator.cs | 71 +++++++++++++++++++++++++ FOSSIL (GEN)/Properties/AssemblyInfo.cs | 36 +++++++++++++ FOSSIL (GEN)/packages.config | 4 ++ PoE-MxFilter-Generator.sln | 6 +++ 5 files changed, 172 insertions(+) create mode 100644 FOSSIL (GEN)/FOSSIL (GEN).csproj create mode 100644 FOSSIL (GEN)/Generator.cs create mode 100644 FOSSIL (GEN)/Properties/AssemblyInfo.cs create mode 100644 FOSSIL (GEN)/packages.config diff --git a/FOSSIL (GEN)/FOSSIL (GEN).csproj b/FOSSIL (GEN)/FOSSIL (GEN).csproj new file mode 100644 index 0000000..aea8783 --- /dev/null +++ b/FOSSIL (GEN)/FOSSIL (GEN).csproj @@ -0,0 +1,55 @@ + + + + + Debug + AnyCPU + {CE0E31E0-BE67-4CDB-8873-B959EDAD733C} + Library + Properties + FOSSIL__GEN_ + FOSSIL %28GEN%29 + v4.6.1 + 512 + true + + + + true + full + false + ..\Builds\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/FOSSIL (GEN)/Generator.cs b/FOSSIL (GEN)/Generator.cs new file mode 100644 index 0000000..05a53be --- /dev/null +++ b/FOSSIL (GEN)/Generator.cs @@ -0,0 +1,71 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace FOSSIL__GEN_ +{ + public class RootFossil + { + public int id { get; set; } + public string name { get; set; } + public string category { get; set; } + public string group { get; set; } + public int frame { get; set; } + public List influences { get; set; } + public int stackSize { get; set; } + public string icon { get; set; } + public double mean { get; set; } + public double median { get; set; } + public double mode { get; set; } + public double min { get; set; } + public double max { get; set; } + public double exalted { get; set; } + public int total { get; set; } + public int daily { get; set; } + public int current { get; set; } + public int accepted { get; set; } + public double change { get; set; } + public List history { get; set; } + public string type { get; set; } + } + + public class Generator + { + private static string iB; + + public static void Gen(string section, string api, string league, int minValue) + { + List itemBase = new List(); + + var RootFossil = JsonConvert.DeserializeObject>(File.ReadAllText("data/poew.currency.json", Encoding.UTF8)); + + foreach (var ln in RootFossil) + { + // Check if the item value is equal or superior to the minimum value + if (ln.min >= 10 && ln.group == "fossil") + { + if (!itemBase.Contains(ln.name)) + { + itemBase.Add(ln.name); + iB = iB + string.Format(@" ""{0}""", ln.name); + } + } + } + + if (iB == null) { iB = @""""""; } + string fn = @"gen\" + section + ".filter"; + File.AppendAllText(fn, string.Format("# Section: {0}", section) + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(fn, "" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(fn, "Show" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(fn, @" Class ""Stackable Currency""" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(fn, " BaseType" + iB + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(fn, " SetTextColor 255 165 0 255" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(fn, " SetBackgroundColor 255 255 255" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(fn, " SetBorderColor 255 165 0 255" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(fn, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8); + File.AppendAllText(fn, @" CustomAlertSound ""mx_fossil.mp3""", Encoding.UTF8); + } + } +} diff --git a/FOSSIL (GEN)/Properties/AssemblyInfo.cs b/FOSSIL (GEN)/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..f94ea08 --- /dev/null +++ b/FOSSIL (GEN)/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Les informations générales relatives à un assembly dépendent de +// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations +// associées à un assembly. +[assembly: AssemblyTitle("FOSSIL (GEN)")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("FOSSIL (GEN)")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly +// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de +// COM, affectez la valeur true à l'attribut ComVisible sur ce type. +[assembly: ComVisible(false)] + +// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM +[assembly: Guid("ce0e31e0-be67-4cdb-8873-b959edad733c")] + +// Les informations de version pour un assembly se composent des quatre valeurs suivantes : +// +// Version principale +// Version secondaire +// Numéro de build +// Révision +// +// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut +// en utilisant '*', comme indiqué ci-dessous : +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/FOSSIL (GEN)/packages.config b/FOSSIL (GEN)/packages.config new file mode 100644 index 0000000..a9de8b5 --- /dev/null +++ b/FOSSIL (GEN)/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/PoE-MxFilter-Generator.sln b/PoE-MxFilter-Generator.sln index dbb679c..49f70a1 100644 --- a/PoE-MxFilter-Generator.sln +++ b/PoE-MxFilter-Generator.sln @@ -13,6 +13,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EXPENSIVE UNIQUE (GEN) (Acc EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tiers (DATA)", "Tiers (DATA)\Tiers (DATA).csproj", "{428B5A68-922A-4651-88FC-A6C194C10BD8}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FOSSIL (GEN)", "FOSSIL (GEN)\FOSSIL (GEN).csproj", "{CE0E31E0-BE67-4CDB-8873-B959EDAD733C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -39,6 +41,10 @@ Global {428B5A68-922A-4651-88FC-A6C194C10BD8}.Debug|Any CPU.Build.0 = Debug|Any CPU {428B5A68-922A-4651-88FC-A6C194C10BD8}.Release|Any CPU.ActiveCfg = Release|Any CPU {428B5A68-922A-4651-88FC-A6C194C10BD8}.Release|Any CPU.Build.0 = Release|Any CPU + {CE0E31E0-BE67-4CDB-8873-B959EDAD733C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CE0E31E0-BE67-4CDB-8873-B959EDAD733C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CE0E31E0-BE67-4CDB-8873-B959EDAD733C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CE0E31E0-BE67-4CDB-8873-B959EDAD733C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE