Currency + Fossil Gen

This commit is contained in:
mikx 2020-01-18 20:54:29 -05:00
parent e44913ecb8
commit 8751fd185a
7 changed files with 18 additions and 31 deletions

Binary file not shown.

View File

@ -12,11 +12,9 @@ namespace PoE_MxFilterGen.json
{
public string git { get; set; }
public string api { get; set; }
public int confidence { get; set; }
public int minimumValue { get; set; }
public int chancingMinValue { get; set; }
public bool verbose { get; set; }
public bool strict { get; set; }
public bool ssf { get; set; }
public string section { get; set; }
}
@ -34,24 +32,12 @@ namespace PoE_MxFilterGen.json
return j.api;
}
public static int GetConfidence()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.confidence;
}
public static int GetMinimumValue()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.minimumValue;
}
public static int GetChancingMinValue()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.chancingMinValue;
}
public static bool GetVerbose()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
@ -64,10 +50,10 @@ namespace PoE_MxFilterGen.json
return j.section;
}
public static bool GetStrict()
public static bool GetSSF()
{
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
return j.strict;
return j.ssf;
}
public static void WriteSection(string section)
@ -77,11 +63,9 @@ namespace PoE_MxFilterGen.json
{
git = js.git,
api = js.api,
confidence = js.confidence,
minimumValue = js.minimumValue,
chancingMinValue = js.chancingMinValue,
verbose = js.verbose,
strict = js.strict,
ssf = js.ssf,
section = section
};
var raw = JsonConvert.SerializeObject(se, Formatting.Indented);

View File

@ -17,7 +17,7 @@ namespace PoE_MxFilterGen
{
private static DateTime dt = DateTime.Now;
public static string version = "6.2.0";
public static string version = "7.1.0";
public static string fDate = string.Format("{0}-{1}-{2}", dt.Day, dt.Month, dt.Year);
public static string section = "";
@ -79,11 +79,9 @@ namespace PoE_MxFilterGen
msg.CMW(string.Format("GIT: {0}", json.settings.GetGIT()), true, 1);
msg.CMW(string.Format("API: {0}", json.settings.GetAPI()), true, 1);
msg.CMW(string.Format("League: {0}", league), true, 1);
msg.CMW(string.Format("Confidence: {0}", json.settings.GetConfidence().ToString()), true, 1);
msg.CMW(string.Format("Minimum Value: {0}c", json.settings.GetMinimumValue().ToString()), true, 1);
msg.CMW(string.Format("Chancing Min. Value: {0}c", json.settings.GetChancingMinValue().ToString()), true, 1);
msg.CMW(string.Format("Verbose: {0}", json.settings.GetVerbose().ToString()), true, 1);
msg.CMW(string.Format("Strict: {0}", json.settings.GetStrict().ToString()), true, 1);
msg.CMW(string.Format("SSF: {0}", json.settings.GetSSF().ToString()), true, 1);
giturl = json.settings.GetGIT();
@ -121,19 +119,25 @@ namespace PoE_MxFilterGen
if (File.Exists($@"{path}\My Games\Path of Exile\MxFilter.filter")) { File.Delete($@"{path}\My Games\Path of Exile\MxFilter.filter"); }
// Get latest poe.ninja api
msg.CMW($"Downloading the latest API data from poe.ninja...", true, 1);
web.SaveString(json.settings.GetAPI() + "GetUniqueArmourOverview?league=" + league, "data/ninja.armour.json");
msg.CMW($"Downloading the latest API data from poe.watch...", true, 1);
/*web.SaveString(json.settings.GetAPI() + "GetUniqueArmourOverview?league=" + league, "data/ninja.armour.json");
web.SaveString(json.settings.GetAPI() + "GetUniqueWeaponOverview?league=" + league, "data/ninja.weapon.json");
web.SaveString(json.settings.GetAPI() + "GetUniqueAccessoryOverview?league=" + league, "data/ninja.accessory.json");
web.SaveString(json.settings.GetAPI() + "GetUniqueMapOverview?league=" + league, "data/ninja.map.json");
web.SaveString(json.settings.GetAPI() + "GetDivinationCardsOverview?league=" + league, "data/ninja.card.json");
web.SaveString(json.settings.GetAPI() + "GetDivinationCardsOverview?league=" + league, "data/ninja.card.json"); */
web.SaveString(json.settings.GetAPI() + $"get?league={league}&category=armour", "data/poew.armour.json");
web.SaveString(json.settings.GetAPI() + $"get?league={league}&category=weapon", "data/poew.weapon.json");
web.SaveString(json.settings.GetAPI() + $"get?league={league}&category=accessory", "data/poew.accessory.json");
web.SaveString(json.settings.GetAPI() + $"get?league={league}&category=card", "data/poew.card.json");
web.SaveString(json.settings.GetAPI() + $"get?league={league}&category=currency", "data/poew.currency.json");
// Get Theme File(s)
web.DownloadFile($@"{giturl}/PoE-MxFilter-Structure/master/Chancing.json", @"structure\Chancing.json");
// Generate Filter Array
string[] filters;
if (json.settings.GetStrict()) { filters = new string[] { "Normal", "Strict" }; } else { filters = new string[] { "Normal" }; }
if (json.settings.GetSSF()) { filters = new string[] { "SSF" }; } else { filters = new string[] { "Normal", "Strict" }; }
foreach(string f in filters)
{
@ -278,7 +282,7 @@ namespace PoE_MxFilterGen
Type type = AppDomain.CurrentDomain.GetAssemblies().SelectMany(t => t.GetTypes()).Where(t => String.Equals(t.Name, "Generator", StringComparison.Ordinal)).First();
object o = Activator.CreateInstance(type);
MethodInfo mi = o.GetType().GetMethod("Gen");
Object[] ob = { json.settings.GetSection(), json.settings.GetAPI(), main.league, json.settings.GetMinimumValue(), json.settings.GetChancingMinValue(), json.settings.GetConfidence() };
Object[] ob = { json.settings.GetSection(), json.settings.GetAPI(), main.league, json.settings.GetMinimumValue() };
mi.Invoke(o, ob);
}
}

View File

@ -201,7 +201,7 @@ namespace PoE_MxFilterGen
Console.WriteLine("#### MxFilterGen");
Console.WriteLine(string.Format("#### VERSION: {0}",main.version));
Console.WriteLine("#### DEV: mikx");
Console.WriteLine("#### POWERED BY: poe.ninja");
Console.WriteLine("#### POWERED BY: poe.watch");
Console.WriteLine("");
Console.ForegroundColor = ConsoleColor.White;
}

View File

@ -28,7 +28,6 @@ E:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.exe.config
E:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.exe
E:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.pdb
E:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\Newtonsoft.Json.xml
E:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csproj.CoreCompileInputs.cache
E:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csproj.CopyComplete
E:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\mxfiltergen.exe
E:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\mxfiltergen.pdb