4.3.0 (removed strict)
This commit is contained in:
parent
ba5b6c3f15
commit
5fb7a3436a
Binary file not shown.
|
@ -35,8 +35,8 @@
|
|||
<ApplicationIcon>Chaos_Orb.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
|
@ -48,19 +48,7 @@
|
|||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="json\accessories.cs" />
|
||||
<Compile Include="json\armours.cs" />
|
||||
<Compile Include="json\cards.cs" />
|
||||
<Compile Include="json\chanceBelt.cs" />
|
||||
<Compile Include="json\chanceShield.cs" />
|
||||
<Compile Include="json\chanceQuiver.cs" />
|
||||
<Compile Include="json\chanceHelmet.cs" />
|
||||
<Compile Include="json\chanceGloves.cs" />
|
||||
<Compile Include="json\chanceBoots.cs" />
|
||||
<Compile Include="json\maps.cs" />
|
||||
<Compile Include="json\settings.cs" />
|
||||
<Compile Include="json\chanceBody.cs" />
|
||||
<Compile Include="json\weapons.cs" />
|
||||
<Compile Include="main.cs" />
|
||||
<Compile Include="msg.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
|
|
@ -1,95 +0,0 @@
|
|||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PoE_MxFilterGen.json
|
||||
{
|
||||
public class SparklineAccessory
|
||||
{
|
||||
public List<double?> data { get; set; }
|
||||
public double? totalChange { get; set; }
|
||||
}
|
||||
|
||||
public class ExplicitModifierAccessory
|
||||
{
|
||||
public string text { get; set; }
|
||||
public bool optional { get; set; }
|
||||
}
|
||||
|
||||
public class LineAccessory
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string name { get; set; }
|
||||
public string icon { get; set; }
|
||||
public int mapTier { get; set; }
|
||||
public int levelRequired { get; set; }
|
||||
public string baseType { get; set; }
|
||||
public int stackSize { get; set; }
|
||||
public object variant { get; set; }
|
||||
public object prophecyText { get; set; }
|
||||
public object artFilename { get; set; }
|
||||
public int links { get; set; }
|
||||
public int itemClass { get; set; }
|
||||
public SparklineAccessory sparkline { get; set; }
|
||||
public List<object> implicitModifiers { get; set; }
|
||||
public List<ExplicitModifierAccessory> explicitModifiers { get; set; }
|
||||
public string flavourText { get; set; }
|
||||
public string itemType { get; set; }
|
||||
public double chaosValue { get; set; }
|
||||
public double exaltedValue { get; set; }
|
||||
public int count { get; set; }
|
||||
}
|
||||
|
||||
public class RootAccessory
|
||||
{
|
||||
public List<LineAccessory> lines { get; set; }
|
||||
}
|
||||
|
||||
class accessories
|
||||
{
|
||||
private static string iB;
|
||||
|
||||
public static void GenAccessories(string section)
|
||||
{
|
||||
List<string> itemBase = new List<string>();
|
||||
RootAccessory j = JsonConvert.DeserializeObject<RootAccessory>(File.ReadAllText("data/ninja.accessory.json", Encoding.UTF8));
|
||||
|
||||
foreach (var ln in j.lines)
|
||||
{
|
||||
// Check if the item count is at least equal to the desired confidence level
|
||||
if (ln.count >= json.settings.GetConfidence())
|
||||
{
|
||||
// Check if the item value is equal or superior to the minimum value
|
||||
if (ln.chaosValue >= json.settings.GetMinimumValue())
|
||||
{
|
||||
if (json.settings.GetVerbose())
|
||||
{
|
||||
msg.CMW(string.Format("[{0}][{1}c] Added to the list.", ln.name, ln.chaosValue), true, 1);
|
||||
}
|
||||
if (!itemBase.Contains(ln.baseType))
|
||||
{
|
||||
itemBase.Add(ln.baseType);
|
||||
iB = iB + string.Format(@" ""{0}""", ln.baseType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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, " BaseType" + iB + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " Rarity = Unique" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetTextColor 222 95 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBackgroundColor 255 255 255" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBorderColor 180 96 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetFontSize 45" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " PlayAlertSound 8 300", Encoding.UTF8);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,95 +0,0 @@
|
|||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PoE_MxFilterGen.json
|
||||
{
|
||||
public class SparklineArmour
|
||||
{
|
||||
public List<double?> data { get; set; }
|
||||
public double? totalChange { get; set; }
|
||||
}
|
||||
|
||||
public class ExplicitModifierArmour
|
||||
{
|
||||
public string text { get; set; }
|
||||
public bool optional { get; set; }
|
||||
}
|
||||
|
||||
public class LineArmour
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string name { get; set; }
|
||||
public string icon { get; set; }
|
||||
public int mapTier { get; set; }
|
||||
public int levelRequired { get; set; }
|
||||
public string baseType { get; set; }
|
||||
public int stackSize { get; set; }
|
||||
public object variant { get; set; }
|
||||
public object prophecyText { get; set; }
|
||||
public object artFilename { get; set; }
|
||||
public int links { get; set; }
|
||||
public int itemClass { get; set; }
|
||||
public SparklineArmour sparkline { get; set; }
|
||||
public List<object> implicitModifiers { get; set; }
|
||||
public List<ExplicitModifierArmour> explicitModifiers { get; set; }
|
||||
public string flavourText { get; set; }
|
||||
public string itemType { get; set; }
|
||||
public double chaosValue { get; set; }
|
||||
public double exaltedValue { get; set; }
|
||||
public int count { get; set; }
|
||||
}
|
||||
|
||||
public class RootArmour
|
||||
{
|
||||
public List<LineArmour> lines { get; set; }
|
||||
}
|
||||
|
||||
class armours
|
||||
{
|
||||
private static string iB;
|
||||
|
||||
public static void GenArmours(string section)
|
||||
{
|
||||
List<string> itemBase = new List<string>();
|
||||
RootArmour j = JsonConvert.DeserializeObject<RootArmour>(File.ReadAllText("data/ninja.armour.json", Encoding.UTF8));
|
||||
|
||||
foreach (var ln in j.lines)
|
||||
{
|
||||
// Check if the item count is at least equal to the desired confidence level
|
||||
if (ln.count >= json.settings.GetConfidence() && ln.links <= 4)
|
||||
{
|
||||
// Check if the item value is equal or superior to the minimum value
|
||||
if (ln.chaosValue >= json.settings.GetMinimumValue())
|
||||
{
|
||||
if (json.settings.GetVerbose())
|
||||
{
|
||||
msg.CMW(string.Format("[{0}][{1}c] Added to the list.", ln.name, ln.chaosValue), true, 1);
|
||||
}
|
||||
if (!itemBase.Contains(ln.baseType))
|
||||
{
|
||||
itemBase.Add(ln.baseType);
|
||||
iB = iB + string.Format(@" ""{0}""", ln.baseType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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, " BaseType" + iB + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " Rarity = Unique" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetTextColor 222 95 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBackgroundColor 255 255 255" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBorderColor 180 96 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetFontSize 45" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " PlayAlertSound 8 300", Encoding.UTF8);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,95 +0,0 @@
|
|||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PoE_MxFilterGen.json
|
||||
{
|
||||
public class SparklineCard
|
||||
{
|
||||
public List<double?> data { get; set; }
|
||||
public double? totalChange { get; set; }
|
||||
}
|
||||
|
||||
public class ExplicitModifierCard
|
||||
{
|
||||
public string text { get; set; }
|
||||
public bool optional { get; set; }
|
||||
}
|
||||
|
||||
public class LineCard
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string name { get; set; }
|
||||
public string icon { get; set; }
|
||||
public int mapTier { get; set; }
|
||||
public int levelRequired { get; set; }
|
||||
public string baseType { get; set; }
|
||||
public int stackSize { get; set; }
|
||||
public object variant { get; set; }
|
||||
public object prophecyText { get; set; }
|
||||
public string artFilename { get; set; }
|
||||
public int links { get; set; }
|
||||
public int itemClass { get; set; }
|
||||
public SparklineCard sparkline { get; set; }
|
||||
public List<object> implicitModifiers { get; set; }
|
||||
public List<ExplicitModifierCard> explicitModifiers { get; set; }
|
||||
public string flavourText { get; set; }
|
||||
public string itemType { get; set; }
|
||||
public double chaosValue { get; set; }
|
||||
public double exaltedValue { get; set; }
|
||||
public int count { get; set; }
|
||||
}
|
||||
|
||||
public class RootCard
|
||||
{
|
||||
public List<LineCard> lines { get; set; }
|
||||
}
|
||||
|
||||
class cards
|
||||
{
|
||||
private static string iB;
|
||||
|
||||
public static void GenCards(string section)
|
||||
{
|
||||
List<string> itemBase = new List<string>();
|
||||
RootCard j = JsonConvert.DeserializeObject<RootCard>(File.ReadAllText("data/ninja.card.json", Encoding.UTF8));
|
||||
|
||||
foreach (var ln in j.lines)
|
||||
{
|
||||
// Check if the item count is at least equal to the desired confidence level
|
||||
if (ln.count >= json.settings.GetConfidence())
|
||||
{
|
||||
// Check if the item value is equal or superior to the minimum value
|
||||
if (ln.chaosValue >= json.settings.GetMinimumValue())
|
||||
{
|
||||
if (json.settings.GetVerbose())
|
||||
{
|
||||
msg.CMW(string.Format("[{0}][{1}c] Added to the list.", ln.name, ln.chaosValue), true, 1);
|
||||
}
|
||||
if (!itemBase.Contains(ln.name))
|
||||
{
|
||||
itemBase.Add(ln.name);
|
||||
iB = iB + string.Format(@" ""{0}""", ln.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 ""Divination Card""" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " BaseType" + iB + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetTextColor 20 65 110" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBackgroundColor 224 224 224" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBorderColor 57 97 145" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetFontSize 45" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " PlayAlertSound 5 300", Encoding.UTF8);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,93 +0,0 @@
|
|||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PoE_MxFilterGen.json
|
||||
{
|
||||
public class ChanceSparklineBelt
|
||||
{
|
||||
public List<double?> data { get; set; }
|
||||
public double? totalChange { get; set; }
|
||||
}
|
||||
|
||||
public class ChanceExplicitModifierBelt
|
||||
{
|
||||
public string text { get; set; }
|
||||
public bool optional { get; set; }
|
||||
}
|
||||
|
||||
public class ChanceLineBelt
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string name { get; set; }
|
||||
public string icon { get; set; }
|
||||
public int mapTier { get; set; }
|
||||
public int levelRequired { get; set; }
|
||||
public string baseType { get; set; }
|
||||
public int stackSize { get; set; }
|
||||
public object variant { get; set; }
|
||||
public object prophecyText { get; set; }
|
||||
public object artFilename { get; set; }
|
||||
public int links { get; set; }
|
||||
public int itemClass { get; set; }
|
||||
public ChanceSparklineQuiver sparkline { get; set; }
|
||||
public List<object> implicitModifiers { get; set; }
|
||||
public List<ChanceExplicitModifierQuiver> explicitModifiers { get; set; }
|
||||
public string flavourText { get; set; }
|
||||
public string itemType { get; set; }
|
||||
public double chaosValue { get; set; }
|
||||
public double exaltedValue { get; set; }
|
||||
public int count { get; set; }
|
||||
}
|
||||
|
||||
public class ChanceRootBelt
|
||||
{
|
||||
public List<LineWeapon> lines { get; set; }
|
||||
}
|
||||
|
||||
class chanceBelt
|
||||
{
|
||||
private static string iB;
|
||||
|
||||
public static void ChanceGenBelt(string section)
|
||||
{
|
||||
List<string> itemBase = new List<string>();
|
||||
ChanceRootBoots j = JsonConvert.DeserializeObject<ChanceRootBoots>(File.ReadAllText("data/ninja.accessory.json", Encoding.UTF8));
|
||||
|
||||
foreach (var ln in j.lines)
|
||||
{
|
||||
// Check if the item count is at least equal to the desired confidence level
|
||||
if (ln.count >= json.settings.GetConfidence() && ln.links <= 4 && ln.itemType == "Belt")
|
||||
{
|
||||
// Check if the item value is equal or superior to the minimum value
|
||||
if (ln.chaosValue >= json.settings.GetChancingMinValue())
|
||||
{
|
||||
if (json.settings.GetVerbose())
|
||||
{
|
||||
msg.CMW(string.Format("[{0}][{1}c] Added to the list.", ln.name, ln.chaosValue), true, 1);
|
||||
}
|
||||
if (!itemBase.Contains(ln.baseType))
|
||||
{
|
||||
itemBase.Add(ln.baseType);
|
||||
iB = iB + string.Format(@" ""{0}""", ln.baseType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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, " BaseType" + iB + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetTextColor 50 230 100" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBorderColor 50 230 100" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetFontSize 30", Encoding.UTF8);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PoE_MxFilterGen.json
|
||||
{
|
||||
public class ChanceSparklineBody
|
||||
{
|
||||
public List<double?> data { get; set; }
|
||||
public double? totalChange { get; set; }
|
||||
}
|
||||
|
||||
public class ChanceExplicitModifierBody
|
||||
{
|
||||
public string text { get; set; }
|
||||
public bool optional { get; set; }
|
||||
}
|
||||
|
||||
public class ChanceLineBody
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string name { get; set; }
|
||||
public string icon { get; set; }
|
||||
public int mapTier { get; set; }
|
||||
public int levelRequired { get; set; }
|
||||
public string baseType { get; set; }
|
||||
public int stackSize { get; set; }
|
||||
public object variant { get; set; }
|
||||
public object prophecyText { get; set; }
|
||||
public object artFilename { get; set; }
|
||||
public int links { get; set; }
|
||||
public int itemClass { get; set; }
|
||||
public ChanceSparklineBody sparkline { get; set; }
|
||||
public List<object> implicitModifiers { get; set; }
|
||||
public List<ChanceExplicitModifierBody> explicitModifiers { get; set; }
|
||||
public string flavourText { get; set; }
|
||||
public string itemType { get; set; }
|
||||
public double chaosValue { get; set; }
|
||||
public double exaltedValue { get; set; }
|
||||
public int count { get; set; }
|
||||
}
|
||||
|
||||
public class ChanceRootBody
|
||||
{
|
||||
public List<LineWeapon> lines { get; set; }
|
||||
}
|
||||
|
||||
class chanceBody
|
||||
{
|
||||
private static string iB;
|
||||
|
||||
public static void ChanceGenBody(string section)
|
||||
{
|
||||
List<string> itemBase = new List<string>();
|
||||
ChanceRootBody j = JsonConvert.DeserializeObject<ChanceRootBody>(File.ReadAllText("data/ninja.armour.json", Encoding.UTF8));
|
||||
|
||||
foreach (var ln in j.lines)
|
||||
{
|
||||
// Check if the item count is at least equal to the desired confidence level
|
||||
if (ln.count >= json.settings.GetConfidence() && ln.links <= 4 && ln.itemType == "Body Armour")
|
||||
{
|
||||
// Check if the item value is equal or superior to the minimum value
|
||||
if (ln.chaosValue >= json.settings.GetChancingMinValue())
|
||||
{
|
||||
if (json.settings.GetVerbose())
|
||||
{
|
||||
msg.CMW(string.Format("[{0}][{1}c] Added to the list.", ln.name, ln.chaosValue), true, 1);
|
||||
}
|
||||
if (!itemBase.Contains(ln.baseType))
|
||||
{
|
||||
itemBase.Add(ln.baseType);
|
||||
iB = iB + string.Format(@" ""{0}""", ln.baseType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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, " BaseType" + iB + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " ItemLevel >= 50" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetTextColor 50 230 100" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBorderColor 50 230 100" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetFontSize 40", Encoding.UTF8);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PoE_MxFilterGen.json
|
||||
{
|
||||
public class ChanceSparklineBoots
|
||||
{
|
||||
public List<double?> data { get; set; }
|
||||
public double? totalChange { get; set; }
|
||||
}
|
||||
|
||||
public class ChanceExplicitModifierBoots
|
||||
{
|
||||
public string text { get; set; }
|
||||
public bool optional { get; set; }
|
||||
}
|
||||
|
||||
public class ChanceLineBoots
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string name { get; set; }
|
||||
public string icon { get; set; }
|
||||
public int mapTier { get; set; }
|
||||
public int levelRequired { get; set; }
|
||||
public string baseType { get; set; }
|
||||
public int stackSize { get; set; }
|
||||
public object variant { get; set; }
|
||||
public object prophecyText { get; set; }
|
||||
public object artFilename { get; set; }
|
||||
public int links { get; set; }
|
||||
public int itemClass { get; set; }
|
||||
public ChanceSparklineBoots sparkline { get; set; }
|
||||
public List<object> implicitModifiers { get; set; }
|
||||
public List<ChanceExplicitModifierBoots> explicitModifiers { get; set; }
|
||||
public string flavourText { get; set; }
|
||||
public string itemType { get; set; }
|
||||
public double chaosValue { get; set; }
|
||||
public double exaltedValue { get; set; }
|
||||
public int count { get; set; }
|
||||
}
|
||||
|
||||
public class ChanceRootBoots
|
||||
{
|
||||
public List<LineWeapon> lines { get; set; }
|
||||
}
|
||||
|
||||
class chanceBoots
|
||||
{
|
||||
private static string iB;
|
||||
|
||||
public static void ChanceGenBoots(string section)
|
||||
{
|
||||
List<string> itemBase = new List<string>();
|
||||
ChanceRootBoots j = JsonConvert.DeserializeObject<ChanceRootBoots>(File.ReadAllText("data/ninja.armour.json", Encoding.UTF8));
|
||||
|
||||
foreach (var ln in j.lines)
|
||||
{
|
||||
// Check if the item count is at least equal to the desired confidence level
|
||||
if (ln.count >= json.settings.GetConfidence() && ln.links <= 4 && ln.itemType == "Boots")
|
||||
{
|
||||
// Check if the item value is equal or superior to the minimum value
|
||||
if (ln.chaosValue >= json.settings.GetChancingMinValue())
|
||||
{
|
||||
if (json.settings.GetVerbose())
|
||||
{
|
||||
msg.CMW(string.Format("[{0}][{1}c] Added to the list.", ln.name, ln.chaosValue), true, 1);
|
||||
}
|
||||
if (!itemBase.Contains(ln.baseType))
|
||||
{
|
||||
itemBase.Add(ln.baseType);
|
||||
iB = iB + string.Format(@" ""{0}""", ln.baseType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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, " BaseType" + iB + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " ItemLevel >= 25" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetTextColor 50 230 100" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBorderColor 50 230 100" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetFontSize 35", Encoding.UTF8);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PoE_MxFilterGen.json
|
||||
{
|
||||
public class ChanceSparklineGloves
|
||||
{
|
||||
public List<double?> data { get; set; }
|
||||
public double? totalChange { get; set; }
|
||||
}
|
||||
|
||||
public class ChanceExplicitModifierGloves
|
||||
{
|
||||
public string text { get; set; }
|
||||
public bool optional { get; set; }
|
||||
}
|
||||
|
||||
public class ChanceLineGloves
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string name { get; set; }
|
||||
public string icon { get; set; }
|
||||
public int mapTier { get; set; }
|
||||
public int levelRequired { get; set; }
|
||||
public string baseType { get; set; }
|
||||
public int stackSize { get; set; }
|
||||
public object variant { get; set; }
|
||||
public object prophecyText { get; set; }
|
||||
public object artFilename { get; set; }
|
||||
public int links { get; set; }
|
||||
public int itemClass { get; set; }
|
||||
public ChanceSparklineGloves sparkline { get; set; }
|
||||
public List<object> implicitModifiers { get; set; }
|
||||
public List<ChanceExplicitModifierGloves> explicitModifiers { get; set; }
|
||||
public string flavourText { get; set; }
|
||||
public string itemType { get; set; }
|
||||
public double chaosValue { get; set; }
|
||||
public double exaltedValue { get; set; }
|
||||
public int count { get; set; }
|
||||
}
|
||||
|
||||
public class ChanceRootGloves
|
||||
{
|
||||
public List<LineWeapon> lines { get; set; }
|
||||
}
|
||||
|
||||
class chanceGloves
|
||||
{
|
||||
private static string iB;
|
||||
|
||||
public static void ChanceGenGloves(string section)
|
||||
{
|
||||
List<string> itemBase = new List<string>();
|
||||
ChanceRootBoots j = JsonConvert.DeserializeObject<ChanceRootBoots>(File.ReadAllText("data/ninja.armour.json", Encoding.UTF8));
|
||||
|
||||
foreach (var ln in j.lines)
|
||||
{
|
||||
// Check if the item count is at least equal to the desired confidence level
|
||||
if (ln.count >= json.settings.GetConfidence() && ln.links <= 4 && ln.itemType == "Gloves")
|
||||
{
|
||||
// Check if the item value is equal or superior to the minimum value
|
||||
if (ln.chaosValue >= json.settings.GetChancingMinValue())
|
||||
{
|
||||
if (json.settings.GetVerbose())
|
||||
{
|
||||
msg.CMW(string.Format("[{0}][{1}c] Added to the list.", ln.name, ln.chaosValue), true, 1);
|
||||
}
|
||||
if (!itemBase.Contains(ln.baseType))
|
||||
{
|
||||
itemBase.Add(ln.baseType);
|
||||
iB = iB + string.Format(@" ""{0}""", ln.baseType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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, " BaseType" + iB + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " ItemLevel >= 25" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetTextColor 50 230 100" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBorderColor 50 230 100" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetFontSize 35", Encoding.UTF8);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PoE_MxFilterGen.json
|
||||
{
|
||||
public class ChanceSparklineHelmet
|
||||
{
|
||||
public List<double?> data { get; set; }
|
||||
public double? totalChange { get; set; }
|
||||
}
|
||||
|
||||
public class ChanceExplicitModifierHelmet
|
||||
{
|
||||
public string text { get; set; }
|
||||
public bool optional { get; set; }
|
||||
}
|
||||
|
||||
public class ChanceLineHelmet
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string name { get; set; }
|
||||
public string icon { get; set; }
|
||||
public int mapTier { get; set; }
|
||||
public int levelRequired { get; set; }
|
||||
public string baseType { get; set; }
|
||||
public int stackSize { get; set; }
|
||||
public object variant { get; set; }
|
||||
public object prophecyText { get; set; }
|
||||
public object artFilename { get; set; }
|
||||
public int links { get; set; }
|
||||
public int itemClass { get; set; }
|
||||
public ChanceSparklineHelmet sparkline { get; set; }
|
||||
public List<object> implicitModifiers { get; set; }
|
||||
public List<ChanceExplicitModifierHelmet> explicitModifiers { get; set; }
|
||||
public string flavourText { get; set; }
|
||||
public string itemType { get; set; }
|
||||
public double chaosValue { get; set; }
|
||||
public double exaltedValue { get; set; }
|
||||
public int count { get; set; }
|
||||
}
|
||||
|
||||
public class ChanceRootHelmet
|
||||
{
|
||||
public List<LineWeapon> lines { get; set; }
|
||||
}
|
||||
|
||||
class chanceHelmet
|
||||
{
|
||||
private static string iB;
|
||||
|
||||
public static void ChanceGenHelmet(string section)
|
||||
{
|
||||
List<string> itemBase = new List<string>();
|
||||
ChanceRootBoots j = JsonConvert.DeserializeObject<ChanceRootBoots>(File.ReadAllText("data/ninja.armour.json", Encoding.UTF8));
|
||||
|
||||
foreach (var ln in j.lines)
|
||||
{
|
||||
// Check if the item count is at least equal to the desired confidence level
|
||||
if (ln.count >= json.settings.GetConfidence() && ln.links <= 4 && ln.itemType == "Helmet")
|
||||
{
|
||||
// Check if the item value is equal or superior to the minimum value
|
||||
if (ln.chaosValue >= json.settings.GetChancingMinValue())
|
||||
{
|
||||
if (json.settings.GetVerbose())
|
||||
{
|
||||
msg.CMW(string.Format("[{0}][{1}c] Added to the list.", ln.name, ln.chaosValue), true, 1);
|
||||
}
|
||||
if (!itemBase.Contains(ln.baseType))
|
||||
{
|
||||
itemBase.Add(ln.baseType);
|
||||
iB = iB + string.Format(@" ""{0}""", ln.baseType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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, " BaseType" + iB + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " ItemLevel >= 25" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetTextColor 50 230 100" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBorderColor 50 230 100" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetFontSize 35", Encoding.UTF8);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PoE_MxFilterGen.json
|
||||
{
|
||||
public class ChanceSparklineQuiver
|
||||
{
|
||||
public List<double?> data { get; set; }
|
||||
public double? totalChange { get; set; }
|
||||
}
|
||||
|
||||
public class ChanceExplicitModifierQuiver
|
||||
{
|
||||
public string text { get; set; }
|
||||
public bool optional { get; set; }
|
||||
}
|
||||
|
||||
public class ChanceLineQuiver
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string name { get; set; }
|
||||
public string icon { get; set; }
|
||||
public int mapTier { get; set; }
|
||||
public int levelRequired { get; set; }
|
||||
public string baseType { get; set; }
|
||||
public int stackSize { get; set; }
|
||||
public object variant { get; set; }
|
||||
public object prophecyText { get; set; }
|
||||
public object artFilename { get; set; }
|
||||
public int links { get; set; }
|
||||
public int itemClass { get; set; }
|
||||
public ChanceSparklineQuiver sparkline { get; set; }
|
||||
public List<object> implicitModifiers { get; set; }
|
||||
public List<ChanceExplicitModifierQuiver> explicitModifiers { get; set; }
|
||||
public string flavourText { get; set; }
|
||||
public string itemType { get; set; }
|
||||
public double chaosValue { get; set; }
|
||||
public double exaltedValue { get; set; }
|
||||
public int count { get; set; }
|
||||
}
|
||||
|
||||
public class ChanceRootQuiver
|
||||
{
|
||||
public List<LineWeapon> lines { get; set; }
|
||||
}
|
||||
|
||||
class chanceQuiver
|
||||
{
|
||||
private static string iB;
|
||||
|
||||
public static void ChanceGenQuiver(string section)
|
||||
{
|
||||
List<string> itemBase = new List<string>();
|
||||
ChanceRootBoots j = JsonConvert.DeserializeObject<ChanceRootBoots>(File.ReadAllText("data/ninja.armour.json", Encoding.UTF8));
|
||||
|
||||
foreach (var ln in j.lines)
|
||||
{
|
||||
// Check if the item count is at least equal to the desired confidence level
|
||||
if (ln.count >= json.settings.GetConfidence() && ln.links <= 4 && ln.itemType == "Quiver")
|
||||
{
|
||||
// Check if the item value is equal or superior to the minimum value
|
||||
if (ln.chaosValue >= json.settings.GetChancingMinValue())
|
||||
{
|
||||
if (json.settings.GetVerbose())
|
||||
{
|
||||
msg.CMW(string.Format("[{0}][{1}c] Added to the list.", ln.name, ln.chaosValue), true, 1);
|
||||
}
|
||||
if (!itemBase.Contains(ln.baseType))
|
||||
{
|
||||
itemBase.Add(ln.baseType);
|
||||
iB = iB + string.Format(@" ""{0}""", ln.baseType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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, " BaseType" + iB + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " ItemLevel >= 2" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetTextColor 50 230 100" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBorderColor 50 230 100" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetFontSize 40", Encoding.UTF8);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PoE_MxFilterGen.json
|
||||
{
|
||||
public class ChanceSparklineShield
|
||||
{
|
||||
public List<double?> data { get; set; }
|
||||
public double? totalChange { get; set; }
|
||||
}
|
||||
|
||||
public class ChanceExplicitModifierShield
|
||||
{
|
||||
public string text { get; set; }
|
||||
public bool optional { get; set; }
|
||||
}
|
||||
|
||||
public class ChanceLineShield
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string name { get; set; }
|
||||
public string icon { get; set; }
|
||||
public int mapTier { get; set; }
|
||||
public int levelRequired { get; set; }
|
||||
public string baseType { get; set; }
|
||||
public int stackSize { get; set; }
|
||||
public object variant { get; set; }
|
||||
public object prophecyText { get; set; }
|
||||
public object artFilename { get; set; }
|
||||
public int links { get; set; }
|
||||
public int itemClass { get; set; }
|
||||
public ChanceSparklineQuiver sparkline { get; set; }
|
||||
public List<object> implicitModifiers { get; set; }
|
||||
public List<ChanceExplicitModifierQuiver> explicitModifiers { get; set; }
|
||||
public string flavourText { get; set; }
|
||||
public string itemType { get; set; }
|
||||
public double chaosValue { get; set; }
|
||||
public double exaltedValue { get; set; }
|
||||
public int count { get; set; }
|
||||
}
|
||||
|
||||
public class ChanceRootShield
|
||||
{
|
||||
public List<LineWeapon> lines { get; set; }
|
||||
}
|
||||
|
||||
class chanceShield
|
||||
{
|
||||
private static string iB;
|
||||
|
||||
public static void ChanceGenShield(string section)
|
||||
{
|
||||
List<string> itemBase = new List<string>();
|
||||
ChanceRootBoots j = JsonConvert.DeserializeObject<ChanceRootBoots>(File.ReadAllText("data/ninja.armour.json", Encoding.UTF8));
|
||||
|
||||
foreach (var ln in j.lines)
|
||||
{
|
||||
// Check if the item count is at least equal to the desired confidence level
|
||||
if (ln.count >= json.settings.GetConfidence() && ln.links <= 4 && ln.itemType == "Shield")
|
||||
{
|
||||
// Check if the item value is equal or superior to the minimum value
|
||||
if (ln.chaosValue >= json.settings.GetChancingMinValue())
|
||||
{
|
||||
if (json.settings.GetVerbose())
|
||||
{
|
||||
msg.CMW(string.Format("[{0}][{1}c] Added to the list.", ln.name, ln.chaosValue), true, 1);
|
||||
}
|
||||
if (!itemBase.Contains(ln.baseType))
|
||||
{
|
||||
itemBase.Add(ln.baseType);
|
||||
iB = iB + string.Format(@" ""{0}""", ln.baseType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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, " BaseType" + iB + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " ItemLevel >= 2" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetTextColor 50 230 100" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBorderColor 50 230 100" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetFontSize 45", Encoding.UTF8);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,89 +0,0 @@
|
|||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PoE_MxFilterGen.json
|
||||
{
|
||||
public class SparklineMap
|
||||
{
|
||||
public List<double?> data { get; set; }
|
||||
public double? totalChange { get; set; }
|
||||
}
|
||||
|
||||
public class LineMap
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string name { get; set; }
|
||||
public string icon { get; set; }
|
||||
public int mapTier { get; set; }
|
||||
public int levelRequired { get; set; }
|
||||
public string baseType { get; set; }
|
||||
public int stackSize { get; set; }
|
||||
public string variant { get; set; }
|
||||
public object prophecyText { get; set; }
|
||||
public object artFilename { get; set; }
|
||||
public int links { get; set; }
|
||||
public int itemClass { get; set; }
|
||||
public SparklineMap sparkline { get; set; }
|
||||
public List<object> implicitModifiers { get; set; }
|
||||
public List<object> explicitModifiers { get; set; }
|
||||
public string flavourText { get; set; }
|
||||
public string itemType { get; set; }
|
||||
public double chaosValue { get; set; }
|
||||
public double exaltedValue { get; set; }
|
||||
public int count { get; set; }
|
||||
}
|
||||
|
||||
public class RootMap
|
||||
{
|
||||
public List<LineMap> lines { get; set; }
|
||||
}
|
||||
|
||||
class maps
|
||||
{
|
||||
private static string iB;
|
||||
|
||||
public static void GenMaps(string section)
|
||||
{
|
||||
List<string> itemBase = new List<string>();
|
||||
RootMap j = JsonConvert.DeserializeObject<RootMap>(File.ReadAllText("data/ninja.map.json", Encoding.UTF8));
|
||||
|
||||
foreach (var ln in j.lines)
|
||||
{
|
||||
// Check if the item count is at least equal to the desired confidence level
|
||||
if (ln.count >= json.settings.GetConfidence())
|
||||
{
|
||||
// Check if the item value is equal or superior to the minimum value
|
||||
if (ln.chaosValue >= json.settings.GetMinimumValue())
|
||||
{
|
||||
if (json.settings.GetVerbose())
|
||||
{
|
||||
msg.CMW(string.Format("[{0}][{1}c] Added to the list.", ln.name, ln.chaosValue), true, 1);
|
||||
}
|
||||
if (!itemBase.Contains(ln.baseType))
|
||||
{
|
||||
itemBase.Add(ln.baseType);
|
||||
iB = iB + string.Format(@" ""{0}""", ln.baseType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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, " BaseType" + iB + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " Rarity = Unique" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetTextColor 222 95 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBackgroundColor 255 255 255" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBorderColor 180 96 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetFontSize 45" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " PlayAlertSound 8 300", Encoding.UTF8);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -10,16 +10,25 @@ namespace PoE_MxFilterGen.json
|
|||
{
|
||||
public class SETTINGS
|
||||
{
|
||||
public string git { get; set; }
|
||||
public string api { get; set; }
|
||||
public string league { 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 string section { get; set; }
|
||||
}
|
||||
|
||||
class settings
|
||||
{
|
||||
public static string GetGIT()
|
||||
{
|
||||
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
|
||||
return j.git;
|
||||
}
|
||||
|
||||
public static string GetAPI()
|
||||
{
|
||||
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
|
||||
|
@ -55,5 +64,35 @@ namespace PoE_MxFilterGen.json
|
|||
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
|
||||
return j.verbose;
|
||||
}
|
||||
|
||||
public static string GetSection()
|
||||
{
|
||||
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
|
||||
return j.section;
|
||||
}
|
||||
|
||||
public static bool GetStrict()
|
||||
{
|
||||
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
|
||||
return j.strict;
|
||||
}
|
||||
|
||||
public static void WriteSection(string section)
|
||||
{
|
||||
SETTINGS js = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText($@"settings.json"));
|
||||
SETTINGS se = new SETTINGS
|
||||
{
|
||||
git = js.git,
|
||||
api = js.api,
|
||||
league = js.league,
|
||||
confidence = js.confidence,
|
||||
minimumValue = js.minimumValue,
|
||||
chancingMinValue = js.chancingMinValue,
|
||||
verbose = js.verbose,
|
||||
section = section
|
||||
};
|
||||
var raw = JsonConvert.SerializeObject(se, Formatting.Indented);
|
||||
File.WriteAllText($@"settings.json", raw);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,95 +0,0 @@
|
|||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PoE_MxFilterGen.json
|
||||
{
|
||||
public class Sparkline
|
||||
{
|
||||
public List<double?> data { get; set; }
|
||||
public double? totalChange { get; set; }
|
||||
}
|
||||
|
||||
public class ExplicitModifier
|
||||
{
|
||||
public string text { get; set; }
|
||||
public bool optional { get; set; }
|
||||
}
|
||||
|
||||
public class LineWeapon
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string name { get; set; }
|
||||
public string icon { get; set; }
|
||||
public int mapTier { get; set; }
|
||||
public int levelRequired { get; set; }
|
||||
public string baseType { get; set; }
|
||||
public int stackSize { get; set; }
|
||||
public object variant { get; set; }
|
||||
public object prophecyText { get; set; }
|
||||
public object artFilename { get; set; }
|
||||
public int links { get; set; }
|
||||
public int itemClass { get; set; }
|
||||
public Sparkline sparkline { get; set; }
|
||||
public List<object> implicitModifiers { get; set; }
|
||||
public List<ExplicitModifier> explicitModifiers { get; set; }
|
||||
public string flavourText { get; set; }
|
||||
public string itemType { get; set; }
|
||||
public double chaosValue { get; set; }
|
||||
public double exaltedValue { get; set; }
|
||||
public int count { get; set; }
|
||||
}
|
||||
|
||||
public class RootWeapon
|
||||
{
|
||||
public List<LineWeapon> lines { get; set; }
|
||||
}
|
||||
|
||||
class weapons
|
||||
{
|
||||
private static string iB;
|
||||
|
||||
public static void GenWeapons(string section)
|
||||
{
|
||||
List<string> itemBase = new List<string>();
|
||||
RootWeapon j = JsonConvert.DeserializeObject<RootWeapon>(File.ReadAllText("data/ninja.weapon.json", Encoding.UTF8));
|
||||
|
||||
foreach (var ln in j.lines)
|
||||
{
|
||||
// Check if the item count is at least equal to the desired confidence level
|
||||
if (ln.count >= json.settings.GetConfidence() && ln.links <= 4)
|
||||
{
|
||||
// Check if the item value is equal or superior to the minimum value
|
||||
if (ln.chaosValue >= json.settings.GetMinimumValue())
|
||||
{
|
||||
if (json.settings.GetVerbose())
|
||||
{
|
||||
msg.CMW(string.Format("[{0}][{1}c] Added to the list.", ln.name, ln.chaosValue), true, 1);
|
||||
}
|
||||
if (!itemBase.Contains(ln.baseType))
|
||||
{
|
||||
itemBase.Add(ln.baseType);
|
||||
iB = iB + string.Format(@" ""{0}""", ln.baseType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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, " BaseType" + iB + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " Rarity = Unique" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetTextColor 222 95 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBackgroundColor 255 255 255" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBorderColor 180 96 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetFontSize 45" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " PlayAlertSound 8 300", Encoding.UTF8);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,7 +3,9 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Policy;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
@ -13,8 +15,12 @@ namespace PoE_MxFilterGen
|
|||
{
|
||||
private static DateTime dt = DateTime.Now;
|
||||
|
||||
public static string version = "2.0.0";
|
||||
public static string fDate = string.Format("{0}-{1}-{2}",dt.Day,dt.Month,dt.Year);
|
||||
public static string version = "4.3.0";
|
||||
public static string fDate = string.Format("{0}-{1}-{2}", dt.Day, dt.Month, dt.Year);
|
||||
|
||||
public static string section = "";
|
||||
|
||||
private static string giturl = json.settings.GetGIT();
|
||||
|
||||
public class STRUCTURE
|
||||
{
|
||||
|
@ -33,14 +39,16 @@ namespace PoE_MxFilterGen
|
|||
static void Main(string[] args)
|
||||
{
|
||||
msg.Splash();
|
||||
msg.CMW(string.Format("API: {0}", json.settings.GetAPI()),true,1);
|
||||
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}", json.settings.GetLeague()), 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);
|
||||
|
||||
// Check if data and gen exists
|
||||
// Check if all the required dir exists
|
||||
if (!Directory.Exists(@"data\"))
|
||||
{
|
||||
Directory.CreateDirectory(@"data\");
|
||||
|
@ -53,11 +61,16 @@ namespace PoE_MxFilterGen
|
|||
{
|
||||
Directory.CreateDirectory(@"filter\");
|
||||
}
|
||||
if (!Directory.Exists(@"structure\"))
|
||||
{
|
||||
Directory.CreateDirectory(@"structure\");
|
||||
}
|
||||
|
||||
// Clean all generated data
|
||||
DirectoryInfo dataDir = new DirectoryInfo(@"data\");
|
||||
DirectoryInfo genDir = new DirectoryInfo(@"gen\");
|
||||
DirectoryInfo filterDir = new DirectoryInfo(@"filter\");
|
||||
DirectoryInfo strucDir = new DirectoryInfo(@"structure\");
|
||||
foreach (FileInfo file in dataDir.GetFiles())
|
||||
{
|
||||
file.Delete();
|
||||
|
@ -70,6 +83,10 @@ namespace PoE_MxFilterGen
|
|||
{
|
||||
file.Delete();
|
||||
}
|
||||
foreach (FileInfo file in strucDir.GetFiles())
|
||||
{
|
||||
file.Delete();
|
||||
}
|
||||
|
||||
// Get latest poe.ninja api
|
||||
web.SaveString(json.settings.GetAPI() + "GetUniqueArmourOverview?league=" + json.settings.GetLeague(), "data/ninja.armour.json");
|
||||
|
@ -78,78 +95,42 @@ namespace PoE_MxFilterGen
|
|||
web.SaveString(json.settings.GetAPI() + "GetUniqueMapOverview?league=" + json.settings.GetLeague(), "data/ninja.map.json");
|
||||
web.SaveString(json.settings.GetAPI() + "GetDivinationCardsOverview?league=" + json.settings.GetLeague(), "data/ninja.card.json");
|
||||
|
||||
// Setup basic variable
|
||||
string structure_name = $"{json.settings.GetLeague()}";
|
||||
string filter_name = "MxFilter";
|
||||
|
||||
// Get the structure list
|
||||
RootStructure j = JsonConvert.DeserializeObject<RootStructure>(File.ReadAllText("structure.json", Encoding.UTF8));
|
||||
var js = web.ReadString($@"{giturl}/PoE-MxFilter-Structure/master/{structure_name}.json");
|
||||
RootStructure j = JsonConvert.DeserializeObject<RootStructure>(js);
|
||||
|
||||
// Read the structure one by one to process gen
|
||||
// You specify a gen here by his structure name with the corresponding method.
|
||||
// I might add external DLL support in the future...
|
||||
// Generator (dlls) are downloaded from the web and executed in a separate AppDomain before the AD is unloaded to execute a new generator.
|
||||
// As we CAN'T unload an assembly, using AppDomains is the only way we can load/unload multiple assembly in a row.
|
||||
foreach (var sec in j.structures)
|
||||
{
|
||||
if (sec.gen == true)
|
||||
{
|
||||
switch (sec.section)
|
||||
msg.CMW(string.Format("REMOTE_GEN {0}", sec.section), true, 1);
|
||||
web.DownloadFile($@"{giturl}/PoE-MxFilter-Structure/master/{structure_name}/{sec.section}.dll", $@"structure\{sec.section}.dll");
|
||||
json.settings.WriteSection(sec.section);
|
||||
var bytes = GenerateAssemblyAndGetRawBytes(sec.section);
|
||||
|
||||
var appDomain = AppDomain.CreateDomain(sec.section, null, new AppDomainSetup
|
||||
{
|
||||
case "EXPENSIVE UNIQUE (GEN) (Maps)":
|
||||
msg.CMW(string.Format("GEN: {0}", sec.section), true, 1);
|
||||
json.maps.GenMaps(sec.section);
|
||||
break;
|
||||
ShadowCopyFiles = "true",
|
||||
LoaderOptimization = LoaderOptimization.MultiDomainHost
|
||||
});
|
||||
|
||||
case "DIVINATION CARD (GEN)":
|
||||
msg.CMW(string.Format("GEN: {0}",sec.section), true, 1);
|
||||
json.cards.GenCards(sec.section);
|
||||
break;
|
||||
var assmblyLoaderType = typeof(AssmeblyLoader);
|
||||
var assemblyLoader = (IAssemblyLoader)appDomain.CreateInstanceFromAndUnwrap(assmblyLoaderType.Assembly.Location, assmblyLoaderType.FullName);
|
||||
assemblyLoader.Load(bytes);
|
||||
|
||||
case "EXPENSIVE UNIQUE (GEN) (Weapons)":
|
||||
msg.CMW(string.Format("GEN: {0}", sec.section), true, 1);
|
||||
json.weapons.GenWeapons(sec.section);
|
||||
break;
|
||||
|
||||
case "EXPENSIVE UNIQUE (GEN) (Armours)":
|
||||
msg.CMW(string.Format("GEN: {0}", sec.section), true, 1);
|
||||
json.armours.GenArmours(sec.section);
|
||||
break;
|
||||
|
||||
case "EXPENSIVE UNIQUE (GEN) (Accessories)":
|
||||
msg.CMW(string.Format("GEN: {0}", sec.section), true, 1);
|
||||
json.accessories.GenAccessories(sec.section);
|
||||
break;
|
||||
|
||||
case "CHANCING (Body)":
|
||||
msg.CMW(string.Format("GEN: {0}", sec.section), true, 1);
|
||||
json.chanceBody.ChanceGenBody(sec.section);
|
||||
break;
|
||||
|
||||
case "CHANCING (Boots)":
|
||||
msg.CMW(string.Format("GEN: {0}", sec.section), true, 1);
|
||||
json.chanceBoots.ChanceGenBoots(sec.section);
|
||||
break;
|
||||
|
||||
case "CHANCING (Gloves)":
|
||||
msg.CMW(string.Format("GEN: {0}", sec.section), true, 1);
|
||||
json.chanceGloves.ChanceGenGloves(sec.section);
|
||||
break;
|
||||
|
||||
case "CHANCING (Helmet)":
|
||||
msg.CMW(string.Format("GEN: {0}", sec.section), true, 1);
|
||||
json.chanceHelmet.ChanceGenHelmet(sec.section);
|
||||
break;
|
||||
|
||||
case "CHANCING (Quiver)":
|
||||
msg.CMW(string.Format("GEN: {0}", sec.section), true, 1);
|
||||
json.chanceQuiver.ChanceGenQuiver(sec.section);
|
||||
break;
|
||||
|
||||
case "CHANCING (Shield)":
|
||||
msg.CMW(string.Format("GEN: {0}", sec.section), true, 1);
|
||||
json.chanceShield.ChanceGenShield(sec.section);
|
||||
break;
|
||||
|
||||
case "CHANCING (Belt)":
|
||||
msg.CMW(string.Format("GEN: {0}", sec.section), true, 1);
|
||||
json.chanceBelt.ChanceGenBelt(sec.section);
|
||||
break;
|
||||
}
|
||||
AppDomain.Unload(appDomain);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg.CMW($@"REMOTE_GET {sec.section}", true, 1);
|
||||
web.SaveString($@"{giturl}/PoE-MxFilter-Structure/master/{structure_name}/{sec.section}.filter", $"structure/{sec.section}.filter");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -158,19 +139,55 @@ namespace PoE_MxFilterGen
|
|||
{
|
||||
if (sec.gen == true)
|
||||
{
|
||||
File.AppendAllText(@"filter\MxFilter.filter", File.ReadAllText(string.Format("gen\\{0}.filter", sec.section)));
|
||||
File.AppendAllText(@"filter\MxFilter.filter", "" + Environment.NewLine);
|
||||
File.AppendAllText(@"filter\MxFilter.filter", "" + Environment.NewLine);
|
||||
} else
|
||||
{
|
||||
File.AppendAllText(@"filter\MxFilter.filter", string.Format("# Section: {0}",sec.section) + Environment.NewLine);
|
||||
File.AppendAllText(@"filter\MxFilter.filter", "" + Environment.NewLine);
|
||||
File.AppendAllText(@"filter\MxFilter.filter", File.ReadAllText(string.Format("structure\\{0}.filter", sec.section)));
|
||||
File.AppendAllText(@"filter\MxFilter.filter", "" + Environment.NewLine);
|
||||
File.AppendAllText(@"filter\MxFilter.filter", "" + Environment.NewLine);
|
||||
File.AppendAllText($@"filter\{filter_name}.filter", File.ReadAllText(string.Format("gen\\{0}.filter", sec.section)));
|
||||
File.AppendAllText($@"filter\{filter_name}.filter", "" + Environment.NewLine);
|
||||
File.AppendAllText($@"filter\{filter_name}.filter", "" + Environment.NewLine);
|
||||
}
|
||||
else
|
||||
{
|
||||
File.AppendAllText($@"filter\{filter_name}.filter", string.Format("# Section: {0}", sec.section) + Environment.NewLine);
|
||||
File.AppendAllText($@"filter\{filter_name}.filter", "" + Environment.NewLine);
|
||||
File.AppendAllText($@"filter\{filter_name}.filter", File.ReadAllText(string.Format("structure\\{0}.filter", sec.section)));
|
||||
File.AppendAllText($@"filter\{filter_name}.filter", "" + Environment.NewLine);
|
||||
File.AppendAllText($@"filter\{filter_name}.filter", "" + Environment.NewLine);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Clean all generated data
|
||||
foreach (FileInfo file in genDir.GetFiles())
|
||||
{
|
||||
file.Delete();
|
||||
}
|
||||
foreach (FileInfo file in strucDir.GetFiles())
|
||||
{
|
||||
file.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
private static byte[] GenerateAssemblyAndGetRawBytes(string dll)
|
||||
{
|
||||
string lp = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
||||
var path = $@"{lp}\structure\{dll}.dll";
|
||||
return File.ReadAllBytes(path);
|
||||
}
|
||||
}
|
||||
|
||||
public interface IAssemblyLoader
|
||||
{
|
||||
void Load(byte[] bytes);
|
||||
}
|
||||
|
||||
public class AssmeblyLoader : MarshalByRefObject, IAssemblyLoader
|
||||
{
|
||||
public void Load(byte[] bytes)
|
||||
{
|
||||
string section = main.section;
|
||||
var assembly = AppDomain.CurrentDomain.Load(bytes);
|
||||
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(), json.settings.GetLeague(), json.settings.GetMinimumValue(), json.settings.GetChancingMinValue(), json.settings.GetConfidence() };
|
||||
mi.Invoke(o, ob);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,7 +78,37 @@ namespace PoE_MxFilterGen
|
|||
|
||||
public static void CMW(string msg, bool time, int color)
|
||||
{
|
||||
string date = String.Format("{0}:{1}:{2}", DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);
|
||||
string seconds = "";
|
||||
string minutes = "";
|
||||
string hours = "";
|
||||
if (DateTime.Now.Second < 10)
|
||||
{
|
||||
seconds = String.Format("0{0}", DateTime.Now.Second);
|
||||
}
|
||||
else
|
||||
{
|
||||
seconds = DateTime.Now.Second.ToString();
|
||||
}
|
||||
|
||||
if (DateTime.Now.Minute < 10)
|
||||
{
|
||||
minutes = String.Format("0{0}", DateTime.Now.Minute);
|
||||
}
|
||||
else
|
||||
{
|
||||
minutes = DateTime.Now.Minute.ToString();
|
||||
}
|
||||
|
||||
if (DateTime.Now.Hour < 10)
|
||||
{
|
||||
hours = String.Format("0{0}", DateTime.Now.Hour);
|
||||
}
|
||||
else
|
||||
{
|
||||
hours = DateTime.Now.Hour.ToString();
|
||||
}
|
||||
|
||||
string date = String.Format("{0}:{1}:{2}", hours, minutes, seconds);
|
||||
|
||||
File.AppendAllText("mxfiltergen.logs", String.Format("[{0}] {1}", date, msg) + Environment.NewLine);
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
ecaecd07e551f42ed08ba90718c4222d96a3a595
|
||||
710ffc5d9eff805a0b215f1fa96d491e0bdd21cf
|
||||
|
|
Binary file not shown.
|
@ -14,3 +14,13 @@ D:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\Newtonsoft.Json.xml
|
|||
D:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csprojResolveAssemblyReference.cache
|
||||
D:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\mxfiltergen.exe
|
||||
D:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\mxfiltergen.pdb
|
||||
E:\_MxGit\PoE\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.exe.config
|
||||
E:\_MxGit\PoE\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.exe
|
||||
E:\_MxGit\PoE\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.pdb
|
||||
E:\_MxGit\PoE\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\Newtonsoft.Json.dll
|
||||
E:\_MxGit\PoE\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\Newtonsoft.Json.xml
|
||||
E:\_MxGit\PoE\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csprojResolveAssemblyReference.cache
|
||||
E:\_MxGit\PoE\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csproj.CoreCompileInputs.cache
|
||||
E:\_MxGit\PoE\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csproj.CopyComplete
|
||||
E:\_MxGit\PoE\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\mxfiltergen.exe
|
||||
E:\_MxGit\PoE\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\mxfiltergen.pdb
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net452" />
|
||||
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net452" />
|
||||
</packages>
|
|
@ -14,6 +14,9 @@ namespace PoE_MxFilterGen
|
|||
{
|
||||
WebClient wb = new WebClient();
|
||||
wb.Encoding = Encoding.UTF8;
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
|
||||
| SecurityProtocolType.Tls11
|
||||
| SecurityProtocolType.Tls12;
|
||||
try
|
||||
{
|
||||
Uri uri = new Uri(url);
|
||||
|
@ -30,5 +33,54 @@ namespace PoE_MxFilterGen
|
|||
msg.CMW(ex.Message, true, 3);
|
||||
}
|
||||
}
|
||||
|
||||
public static string ReadString(string url)
|
||||
{
|
||||
WebClient wb = new WebClient();
|
||||
wb.Encoding = Encoding.UTF8;
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
|
||||
| SecurityProtocolType.Tls11
|
||||
| SecurityProtocolType.Tls12;
|
||||
var str = "";
|
||||
try
|
||||
{
|
||||
Uri uri = new Uri(url);
|
||||
str = wb.DownloadString(uri);
|
||||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
msg.CMW(ex.Message, true, 3);
|
||||
msg.CMW("URL: " + url, true, 3);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
msg.CMW(ex.Message, true, 3);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
public static void DownloadFile(string url, string path)
|
||||
{
|
||||
WebClient wb = new WebClient();
|
||||
wb.Encoding = Encoding.UTF8;
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
|
||||
| SecurityProtocolType.Tls11
|
||||
| SecurityProtocolType.Tls12;
|
||||
var str = "";
|
||||
try
|
||||
{
|
||||
Uri uri = new Uri(url);
|
||||
wb.DownloadFile(uri,path);
|
||||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
msg.CMW(ex.Message, true, 3);
|
||||
msg.CMW("URL: " + url, true, 3);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
msg.CMW(ex.Message, true, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2007 James Newton-King
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -1,116 +0,0 @@
|
|||
param($installPath, $toolsPath, $package, $project)
|
||||
|
||||
# open json.net splash page on package install
|
||||
# don't open if json.net is installed as a dependency
|
||||
|
||||
try
|
||||
{
|
||||
$url = "http://www.newtonsoft.com/json/install?version=" + $package.Version
|
||||
$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
|
||||
|
||||
if ($dte2.ActiveWindow.Caption -eq "Package Manager Console")
|
||||
{
|
||||
# user is installing from VS NuGet console
|
||||
# get reference to the window, the console host and the input history
|
||||
# show webpage if "install-package newtonsoft.json" was last input
|
||||
|
||||
$consoleWindow = $(Get-VSComponentModel).GetService([NuGetConsole.IPowerConsoleWindow])
|
||||
|
||||
$props = $consoleWindow.GetType().GetProperties([System.Reflection.BindingFlags]::Instance -bor `
|
||||
[System.Reflection.BindingFlags]::NonPublic)
|
||||
|
||||
$prop = $props | ? { $_.Name -eq "ActiveHostInfo" } | select -first 1
|
||||
if ($prop -eq $null) { return }
|
||||
|
||||
$hostInfo = $prop.GetValue($consoleWindow)
|
||||
if ($hostInfo -eq $null) { return }
|
||||
|
||||
$history = $hostInfo.WpfConsole.InputHistory.History
|
||||
|
||||
$lastCommand = $history | select -last 1
|
||||
|
||||
if ($lastCommand)
|
||||
{
|
||||
$lastCommand = $lastCommand.Trim().ToLower()
|
||||
if ($lastCommand.StartsWith("install-package") -and $lastCommand.Contains("newtonsoft.json"))
|
||||
{
|
||||
$dte2.ItemOperations.Navigate($url) | Out-Null
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# user is installing from VS NuGet dialog
|
||||
# get reference to the window, then smart output console provider
|
||||
# show webpage if messages in buffered console contains "installing...newtonsoft.json" in last operation
|
||||
|
||||
$instanceField = [NuGet.Dialog.PackageManagerWindow].GetField("CurrentInstance", [System.Reflection.BindingFlags]::Static -bor `
|
||||
[System.Reflection.BindingFlags]::NonPublic)
|
||||
|
||||
$consoleField = [NuGet.Dialog.PackageManagerWindow].GetField("_smartOutputConsoleProvider", [System.Reflection.BindingFlags]::Instance -bor `
|
||||
[System.Reflection.BindingFlags]::NonPublic)
|
||||
|
||||
if ($instanceField -eq $null -or $consoleField -eq $null) { return }
|
||||
|
||||
$instance = $instanceField.GetValue($null)
|
||||
|
||||
if ($instance -eq $null) { return }
|
||||
|
||||
$consoleProvider = $consoleField.GetValue($instance)
|
||||
if ($consoleProvider -eq $null) { return }
|
||||
|
||||
$console = $consoleProvider.CreateOutputConsole($false)
|
||||
|
||||
$messagesField = $console.GetType().GetField("_messages", [System.Reflection.BindingFlags]::Instance -bor `
|
||||
[System.Reflection.BindingFlags]::NonPublic)
|
||||
if ($messagesField -eq $null) { return }
|
||||
|
||||
$messages = $messagesField.GetValue($console)
|
||||
if ($messages -eq $null) { return }
|
||||
|
||||
$operations = $messages -split "=============================="
|
||||
|
||||
$lastOperation = $operations | select -last 1
|
||||
|
||||
if ($lastOperation)
|
||||
{
|
||||
$lastOperation = $lastOperation.ToLower()
|
||||
|
||||
$lines = $lastOperation -split "`r`n"
|
||||
|
||||
$installMatch = $lines | ? { $_.StartsWith("------- installing...newtonsoft.json ") } | select -first 1
|
||||
|
||||
if ($installMatch)
|
||||
{
|
||||
$dte2.ItemOperations.Navigate($url) | Out-Null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
try
|
||||
{
|
||||
$pmPane = $dte2.ToolWindows.OutputWindow.OutputWindowPanes.Item("Package Manager")
|
||||
|
||||
$selection = $pmPane.TextDocument.Selection
|
||||
$selection.StartOfDocument($false)
|
||||
$selection.EndOfDocument($true)
|
||||
|
||||
if ($selection.Text.StartsWith("Attempting to gather dependencies information for package 'Newtonsoft.Json." + $package.Version + "'"))
|
||||
{
|
||||
# don't show on upgrade
|
||||
if (!$selection.Text.Contains("Removed package"))
|
||||
{
|
||||
$dte2.ItemOperations.Navigate($url) | Out-Null
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
# stop potential errors from bubbling up
|
||||
# worst case the splash page won't open
|
||||
}
|
||||
}
|
||||
|
||||
# still yolo
|
Loading…
Reference in New Issue