Compare commits
11 Commits
1.0.4
...
release-8.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0aa483cb1b | ||
|
|
b729413646 | ||
|
|
8751fd185a | ||
|
|
e44913ecb8 | ||
|
|
a4e5dc0476 | ||
|
|
aa76d9f9b0 | ||
|
|
b069e48fab | ||
|
|
672b2133f6 | ||
|
|
55fe83c714 | ||
|
|
5fb7a3436a | ||
|
|
ba5b6c3f15 |
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
[January 1, 2018][2.0.0]
|
||||
+ Structure release. Will now generate from method or static data.
|
||||
|
||||
[October 26, 2017][1.0.4]
|
||||
F Fixed 3 crashes due to "not nullable variables".
|
||||
F Will now verify if \data and \gen exists and create them if they don't.
|
||||
|
||||
|
||||
|
||||
F Will now verify if \data and \gen exists and create them if they don't.
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
|
||||
</startup>
|
||||
</configuration>
|
||||
</configuration>
|
||||
|
||||
BIN
PoE-MxFilterGen/Chaos_Orb.ico
Normal file
BIN
PoE-MxFilterGen/Chaos_Orb.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
4
PoE-MxFilterGen/FodyWeavers.xml
Normal file
4
PoE-MxFilterGen/FodyWeavers.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
|
||||
<Costura />
|
||||
</Weavers>
|
||||
111
PoE-MxFilterGen/FodyWeavers.xsd
Normal file
111
PoE-MxFilterGen/FodyWeavers.xsd
Normal file
@@ -0,0 +1,111 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
|
||||
<xs:element name="Weavers">
|
||||
<xs:complexType>
|
||||
<xs:all>
|
||||
<xs:element name="Costura" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:all>
|
||||
<xs:element minOccurs="0" maxOccurs="1" name="ExcludeAssemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element minOccurs="0" maxOccurs="1" name="IncludeAssemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged32Assemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with line breaks.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged64Assemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with line breaks.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element minOccurs="0" maxOccurs="1" name="PreloadOrder" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>The order of preloaded assemblies, delimited with line breaks.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
</xs:all>
|
||||
<xs:attribute name="CreateTemporaryAssemblies" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="IncludeDebugSymbols" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Controls if .pdbs for reference assemblies are also embedded.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="DisableCompression" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="DisableCleanup" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="LoadAtModuleInit" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="IgnoreSatelliteAssemblies" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="ExcludeAssemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with |</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="IncludeAssemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="Unmanaged32Assemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with |.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="Unmanaged64Assemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with |.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="PreloadOrder" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>The order of preloaded assemblies, delimited with |.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:all>
|
||||
<xs:attribute name="VerifyAssembly" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="GenerateXsd" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\Costura.Fody.3.2.1\build\Costura.Fody.props" Condition="Exists('..\packages\Costura.Fody.3.2.1\build\Costura.Fody.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -8,9 +9,12 @@
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>PoE_MxFilterGen</RootNamespace>
|
||||
<AssemblyName>mxfiltergen</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
@@ -31,9 +35,15 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<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="Costura, Version=3.2.1.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Costura.Fody.3.2.1\lib\net40\Costura.dll</HintPath>
|
||||
</Reference>
|
||||
<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" />
|
||||
@@ -45,20 +55,28 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="json\accessories.cs" />
|
||||
<Compile Include="json\armours.cs" />
|
||||
<Compile Include="json\cards.cs" />
|
||||
<Compile Include="json\maps.cs" />
|
||||
<Compile Include="generator\fossil.cs" />
|
||||
<Compile Include="json\settings.cs" />
|
||||
<Compile Include="json\weapons.cs" />
|
||||
<Compile Include="main.cs" />
|
||||
<Compile Include="msg.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="TierGen.cs" />
|
||||
<Compile Include="web.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Chaos_Orb.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\packages\Fody.3.3.3\build\Fody.targets" Condition="Exists('..\packages\Fody.3.3.3\build\Fody.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>Ce projet fait référence à des packages NuGet qui sont manquants sur cet ordinateur. Utilisez l'option de restauration des packages NuGet pour les télécharger. Pour plus d'informations, consultez http://go.microsoft.com/fwlink/?LinkID=322105. Le fichier manquant est : {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\Fody.3.3.3\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.3.3.3\build\Fody.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Costura.Fody.3.2.1\build\Costura.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.3.2.1\build\Costura.Fody.props'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
122
PoE-MxFilterGen/TierGen.cs
Normal file
122
PoE-MxFilterGen/TierGen.cs
Normal file
@@ -0,0 +1,122 @@
|
||||
using PoE_MxFilterGen.json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PoE_MxFilterGen
|
||||
{
|
||||
class TierGen
|
||||
{
|
||||
private static string iB;
|
||||
|
||||
public static void Gen(string section, string api, string league, int minValue)
|
||||
{
|
||||
string giturl = settings.GetGIT();
|
||||
var js = web.ReadString($@"{giturl}/PoE-MxFilter-Structure/master/Tiers.txt");
|
||||
|
||||
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, $" BaseType {js}" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, @" HasExplicitMod ""Veiled""" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBorderColor 112 255 112 255" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " MinimapIcon 1 Green Star" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " PlayEffect Green" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, @" CustomAlertSound ""mx_tier.mp3""" + Environment.NewLine, Encoding.UTF8);
|
||||
|
||||
File.AppendAllText(fn, "" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, "Show" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, $" BaseType {js}" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " FracturedItem True" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBorderColor 112 255 112 255" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " MinimapIcon 1 Green Star" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " PlayEffect Green" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, @" CustomAlertSound ""mx_tier.mp3""" + Environment.NewLine, Encoding.UTF8);
|
||||
|
||||
File.AppendAllText(fn, "" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, "Show" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, $" BaseType {js}" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SynthesisedItem True" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBorderColor 112 255 112 255" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " MinimapIcon 1 Green Star" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " PlayEffect Green" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, @" CustomAlertSound ""mx_tier.mp3""" + Environment.NewLine, Encoding.UTF8);
|
||||
|
||||
File.AppendAllText(fn, "" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, "Show" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, $" BaseType {js}" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " Identified True" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBorderColor 0 0 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, @" CustomAlertSound ""mx_tier.mp3""" + Environment.NewLine, Encoding.UTF8);
|
||||
|
||||
File.AppendAllText(fn, "" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, "Show" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, $" BaseType {js}" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " Corrupted True" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBorderColor 210 0 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetFontSize 35" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, @" CustomAlertSound ""mx_tier.mp3""" + Environment.NewLine, Encoding.UTF8);
|
||||
|
||||
File.AppendAllText(fn, "" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, "Show" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, $" BaseType {js}" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " ItemLevel >= 75" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " ItemLevel <= 100" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBorderColor 184 218 242" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, @" CustomAlertSound ""mx_tier.mp3""" + Environment.NewLine, Encoding.UTF8);
|
||||
|
||||
File.AppendAllText(fn, "" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, "Show" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, $" BaseType {js}" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " ItemLevel >= 60" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " ItemLevel <= 74" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBorderColor 222 118 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, @" CustomAlertSound ""mx_tier.mp3""" + Environment.NewLine, Encoding.UTF8);
|
||||
|
||||
File.AppendAllText(fn, "" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, "Show" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, $" BaseType {js}" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " ItemLevel >= 60" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " ItemLevel <= 74" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " Rarity = Rare" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetTextColor 255 215 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBackgroundColor 54 54 54" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBorderColor 222 118 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetFontSize 40" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, @" CustomAlertSound ""mx_tier.mp3""" + Environment.NewLine, Encoding.UTF8);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
122
PoE-MxFilterGen/generator/fossil.cs
Normal file
122
PoE-MxFilterGen/generator/fossil.cs
Normal file
@@ -0,0 +1,122 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FOSSIL__GEN_
|
||||
{
|
||||
public class Sparkline
|
||||
{
|
||||
public List<double> data { get; set; }
|
||||
public double totalChange { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class LowConfidenceSparkline
|
||||
{
|
||||
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 Line
|
||||
{
|
||||
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 object 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 LowConfidenceSparkline lowConfidenceSparkline { get; set; }
|
||||
public List<object> implicitModifiers { get; set; }
|
||||
public List<ExplicitModifier> explicitModifiers { get; set; }
|
||||
public string flavourText { get; set; }
|
||||
public bool corrupted { get; set; }
|
||||
public int gemLevel { get; set; }
|
||||
public int gemQuality { get; set; }
|
||||
public string itemType { get; set; }
|
||||
public double chaosValue { get; set; }
|
||||
public double exaltedValue { get; set; }
|
||||
public int count { get; set; }
|
||||
public string detailsId { get; set; }
|
||||
public object tradeInfo { get; set; }
|
||||
public object mapRegion { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class Translations
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class Language
|
||||
{
|
||||
public string name { get; set; }
|
||||
public Translations translations { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class RootFossil
|
||||
{
|
||||
public List<Line> lines { get; set; }
|
||||
public Language language { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class fossil
|
||||
{
|
||||
private static string iB;
|
||||
|
||||
public static void Gen(string section, string api, string league, int minValue)
|
||||
{
|
||||
List<string> itemBase = new List<string>();
|
||||
|
||||
var RootFossil = JsonConvert.DeserializeObject<List<RootFossil>>(File.ReadAllText("data/ninja.fossil.json", Encoding.UTF8));
|
||||
|
||||
foreach (var ln in RootFossil)
|
||||
{
|
||||
// Check if the item value is equal or superior to the minimum value
|
||||
|
||||
foreach (var r in ln.lines)
|
||||
{
|
||||
if (r.chaosValue >= 10)
|
||||
{
|
||||
if (!itemBase.Contains(r.name))
|
||||
{
|
||||
itemBase.Add(r.name);
|
||||
iB = iB + string.Format(@" ""{0}""", r.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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,91 +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()
|
||||
{
|
||||
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())
|
||||
{
|
||||
msg.CMW(string.Format("[{0}][{1}c] Added to the list.", ln.baseType, ln.chaosValue), true, 1);
|
||||
if (!itemBase.Contains(ln.baseType))
|
||||
{
|
||||
itemBase.Add(ln.baseType);
|
||||
iB = iB + string.Format(@" ""{0}""", ln.baseType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", "## Accessories Gen" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", "Show" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " BaseType" + iB + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " Rarity = Unique" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " SetTextColor 222 95 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " SetBackgroundColor 255 255 255" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " SetBorderColor 180 96 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " SetFontSize 45" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " PlayAlertSound 8 300" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", "## END #######" + Environment.NewLine + Environment.NewLine, Encoding.UTF8);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,91 +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()
|
||||
{
|
||||
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())
|
||||
{
|
||||
msg.CMW(string.Format("[{0}][{1}c] Added to the list.", ln.baseType, ln.chaosValue), true, 1);
|
||||
if (!itemBase.Contains(ln.baseType))
|
||||
{
|
||||
itemBase.Add(ln.baseType);
|
||||
iB = iB + string.Format(@" ""{0}""", ln.baseType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", "## Armours Gen" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", "Show" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " BaseType" + iB + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " Rarity = Unique" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " SetTextColor 222 95 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " SetBackgroundColor 255 255 255" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " SetBorderColor 180 96 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " SetFontSize 45" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " PlayAlertSound 8 300" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", "## END #######" + Environment.NewLine + Environment.NewLine, Encoding.UTF8);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,91 +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()
|
||||
{
|
||||
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())
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", "## Cards Gen" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", "Show" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", @" Class ""Divination Card""" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " BaseType" + iB + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " SetTextColor 20 65 110" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " SetBackgroundColor 224 224 224" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " SetBorderColor 57 97 145" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " SetFontSize 45" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " PlayAlertSound 5 300" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", "## END #######" + Environment.NewLine + Environment.NewLine, Encoding.UTF8);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,85 +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()
|
||||
{
|
||||
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())
|
||||
{
|
||||
msg.CMW(string.Format("[{0}][{1}c] Added to the list.", ln.baseType, ln.chaosValue), true, 1);
|
||||
if (!itemBase.Contains(ln.baseType))
|
||||
{
|
||||
itemBase.Add(ln.baseType);
|
||||
iB = iB + string.Format(@" ""{0}""", ln.baseType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", "## Maps Gen" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", "Show" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " BaseType" + iB + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " Rarity = Unique" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " SetTextColor 222 95 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " SetBackgroundColor 255 255 255" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " SetBorderColor 180 96 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " SetFontSize 45" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " PlayAlertSound 8 300" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", "## END #######" + Environment.NewLine + Environment.NewLine, Encoding.UTF8);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,36 +10,66 @@ 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 bool verbose { get; set; }
|
||||
public bool ssf { 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"));
|
||||
return j.api;
|
||||
}
|
||||
|
||||
public static string GetLeague()
|
||||
{
|
||||
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
|
||||
return j.league;
|
||||
}
|
||||
|
||||
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 bool GetVerbose()
|
||||
{
|
||||
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 GetSSF()
|
||||
{
|
||||
SETTINGS j = JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json"));
|
||||
return j.ssf;
|
||||
}
|
||||
|
||||
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,
|
||||
minimumValue = js.minimumValue,
|
||||
verbose = js.verbose,
|
||||
ssf = js.ssf,
|
||||
section = section
|
||||
};
|
||||
var raw = JsonConvert.SerializeObject(se, Formatting.Indented);
|
||||
File.WriteAllText($@"settings.json", raw);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,91 +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()
|
||||
{
|
||||
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())
|
||||
{
|
||||
msg.CMW(string.Format("[{0}][{1}c] Added to the list.",ln.baseType,ln.chaosValue), true, 1);
|
||||
if (!itemBase.Contains(ln.baseType))
|
||||
{
|
||||
itemBase.Add(ln.baseType);
|
||||
iB = iB + string.Format(@" ""{0}""", ln.baseType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", "## Weapons Gen" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", "Show" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " BaseType" + iB + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " Rarity = Unique" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " SetTextColor 222 95 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " SetBackgroundColor 255 255 255" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " SetBorderColor 180 96 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " SetFontSize 45" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", " PlayAlertSound 8 300" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(@"gen\" + main.fDate + "_gen.txt", "## END #######" + Environment.NewLine + Environment.NewLine, Encoding.UTF8);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,15 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Policy;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
namespace PoE_MxFilterGen
|
||||
{
|
||||
@@ -12,31 +17,226 @@ namespace PoE_MxFilterGen
|
||||
{
|
||||
private static DateTime dt = DateTime.Now;
|
||||
|
||||
public static string version = "1.0.4";
|
||||
public static string release = "stable";
|
||||
public static string fDate = string.Format("{0}-{1}-{2}",dt.Day,dt.Month,dt.Year);
|
||||
public static string version = "8.0.0";
|
||||
public static string fDate = string.Format("{0}-{1}-{2}", dt.Day, dt.Month, dt.Year);
|
||||
|
||||
public static string api = "";
|
||||
public static string giturl = "https://raw.githubusercontent.com/mikxqc";
|
||||
|
||||
public static string section = "";
|
||||
public static string league = "";
|
||||
public static string path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
|
||||
|
||||
public static int fprog = 0;
|
||||
public static int ftotal = 0;
|
||||
|
||||
public static int sprog = 0;
|
||||
public static int stotal = 0;
|
||||
|
||||
public static bool deb = true;
|
||||
|
||||
public class REMVAR
|
||||
{
|
||||
public string league { get; set; }
|
||||
}
|
||||
|
||||
public class REMSND
|
||||
{
|
||||
public List<string> sound { get; set; }
|
||||
}
|
||||
|
||||
public class STRUCTURE
|
||||
{
|
||||
public string section { get; set; }
|
||||
public bool gen { get; set; }
|
||||
public bool @static { get; set; }
|
||||
public bool remote { get; set; }
|
||||
public string url { get; set; }
|
||||
}
|
||||
|
||||
public class RootStructure
|
||||
{
|
||||
public List<STRUCTURE> structures { get; set; }
|
||||
}
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
// Check for the settings json
|
||||
if (!File.Exists("settings.json"))
|
||||
{
|
||||
msg.CMW("ERROR: settings.json not found! Downloading a template...", true, 3);
|
||||
web.DownloadFile("https://raw.githubusercontent.com/mikxqc/PoE-MxFilter-Data/master/json/mxfiltergen_temp_settings.json", "settings.json");
|
||||
}
|
||||
|
||||
//web.DownloadFile("https://raw.githubusercontent.com/mikxqc/PoE-MxFilter-Data/master/bin/mxfiltergen_updater.exe", "PoE-MxFilterGen-Updater.exe");
|
||||
|
||||
msg.Splash();
|
||||
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);
|
||||
|
||||
// Get current league from MxD
|
||||
var ls = web.ReadString("https://raw.githubusercontent.com/mikxqc/PoE-MxFilter-Data/master/json/mxfiltergen_var.json");
|
||||
REMVAR lj = JsonConvert.DeserializeObject<REMVAR>(ls);
|
||||
league = lj.league;
|
||||
|
||||
api = $"https://poe.ninja/api/data/";
|
||||
|
||||
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("Minimum Value: {0}c", json.settings.GetMinimumValue().ToString()), true, 1);
|
||||
msg.CMW(string.Format("Verbose: {0}", json.settings.GetVerbose().ToString()), true, 1);
|
||||
msg.CMW(string.Format("SSF: {0}", json.settings.GetSSF().ToString()), true, 1);
|
||||
|
||||
// Check if data and gen exists
|
||||
if (!Directory.Exists(@"data\"))
|
||||
{
|
||||
Directory.CreateDirectory(@"data\");
|
||||
}
|
||||
if (!Directory.Exists(@"gen\"))
|
||||
{
|
||||
Directory.CreateDirectory(@"gen\");
|
||||
}
|
||||
// Check for updates
|
||||
string remote_version = web.ReadString(@"https://raw.githubusercontent.com/mikxqc/PoE-MxFilter-Data/master/txt/mxfiltergen_version.txt");
|
||||
//msg.CMW(remote_version,true,3);
|
||||
if (deb == false)
|
||||
{
|
||||
//Process.Start("PoE-MxFilterGen-Updater.exe");
|
||||
//Process.GetCurrentProcess().Kill();
|
||||
} else
|
||||
{
|
||||
// Check if all the required dir exists
|
||||
msg.CMW($"Checking for required dirs...",true,1);
|
||||
if (!Directory.Exists(@"data\"))
|
||||
{
|
||||
Directory.CreateDirectory(@"data\");
|
||||
}
|
||||
if (!Directory.Exists(@"gen\"))
|
||||
{
|
||||
Directory.CreateDirectory(@"gen\");
|
||||
}
|
||||
if (!Directory.Exists(@"structure\"))
|
||||
{
|
||||
Directory.CreateDirectory(@"structure\");
|
||||
}
|
||||
|
||||
// Clean all generated data
|
||||
// Clean all generated data
|
||||
msg.CMW($"Cleaning the base dirs...", true, 1);
|
||||
CleanDirData();
|
||||
|
||||
// Clean the latest generated filter from settings path
|
||||
msg.CMW($"Cleaning the last filter from path...", true, 1);
|
||||
File.Delete($@"{path}\My Games\Path of Exile\MxFilter_Normal.filter");
|
||||
File.Delete($@"{path}\My Games\Path of Exile\MxFilter_Strict.filter");
|
||||
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(api + $"itemoverview?league={league}&type=UniqueArmour&language=en", "data/ninja.armour.json");
|
||||
web.SaveString(api + $"itemoverview?league={league}&type=UniqueWeapon&language=en", "data/ninja.weapon.json");
|
||||
web.SaveString(api + $"itemoverview?league={league}&type=UniqueAccessory&language=en", "data/ninja.accessory.json");
|
||||
web.SaveString(api + $"itemoverview?league={league}&type=DivinationCard&language=en", "data/ninja.card.json");
|
||||
web.SaveString(api + $"currencyoverview?league={league}&type=Currency&language=en", "data/ninja.currency.json");
|
||||
web.SaveString(api + $"itemoverview?league={league}&type=Fossil&language=en", "data/ninja.fossil.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.GetSSF()) { filters = new string[] { "SSF" }; } else { filters = new string[] { "Normal", "Strict" }; }
|
||||
|
||||
foreach(string f in filters)
|
||||
{
|
||||
// Setup basic variable
|
||||
string filter_name = "MxFilter";
|
||||
|
||||
// Get the structure list
|
||||
var js = web.ReadString($@"{giturl}/PoE-MxFilter-Structure/master/{f}.json");
|
||||
RootStructure j = JsonConvert.DeserializeObject<RootStructure>(js);
|
||||
|
||||
// Read the structure one by one to process gen
|
||||
// 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.
|
||||
msg.CMW($@"Generating the {f} filter using {j.structures.Count} source(s)...", true, 1);
|
||||
ftotal = j.structures.Count;
|
||||
foreach (var sec in j.structures)
|
||||
{
|
||||
if (sec.gen == true)
|
||||
{
|
||||
fprog = fprog + 1;
|
||||
msg.drawProgress(fprog, ftotal);
|
||||
//msg.CMW(string.Format("REMOTE_GEN {0}", sec.section), true, 1);
|
||||
web.DownloadFile($@"{giturl}/PoE-MxFilter-Structure/master/{f}/{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
|
||||
{
|
||||
ShadowCopyFiles = "true",
|
||||
LoaderOptimization = LoaderOptimization.MultiDomainHost
|
||||
});
|
||||
|
||||
var assmblyLoaderType = typeof(AssmeblyLoader);
|
||||
var assemblyLoader = (IAssemblyLoader)appDomain.CreateInstanceFromAndUnwrap(assmblyLoaderType.Assembly.Location, assmblyLoaderType.FullName);
|
||||
assemblyLoader.Load(bytes);
|
||||
|
||||
AppDomain.Unload(appDomain);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprog = fprog + 1;
|
||||
msg.drawProgress(fprog, ftotal);
|
||||
//msg.CMW($@"REMOTE_GET {sec.section}", true, 1);
|
||||
web.SaveString($@"{giturl}/PoE-MxFilter-Structure/master/{f}/{sec.section}.filter", $"structure/{sec.section}.filter");
|
||||
}
|
||||
}
|
||||
|
||||
// Create the final filter.
|
||||
msg.CMW($@"Creating the final filter...", true, 1);
|
||||
foreach (var sec in j.structures)
|
||||
{
|
||||
if (sec.gen == true)
|
||||
{
|
||||
File.AppendAllText($@"{path}\My Games\Path of Exile\{filter_name}_{f}.filter", File.ReadAllText(string.Format("gen\\{0}.filter", sec.section)));
|
||||
File.AppendAllText($@"{path}\My Games\Path of Exile\{filter_name}_{f}.filter", "" + Environment.NewLine);
|
||||
File.AppendAllText($@"{path}\My Games\Path of Exile\{filter_name}_{f}.filter", "" + Environment.NewLine);
|
||||
}
|
||||
else
|
||||
{
|
||||
File.AppendAllText($@"{path}\My Games\Path of Exile\{filter_name}_{f}.filter", string.Format("# Section: {0}", sec.section) + Environment.NewLine);
|
||||
File.AppendAllText($@"{path}\My Games\Path of Exile\{filter_name}_{f}.filter", "" + Environment.NewLine);
|
||||
File.AppendAllText($@"{path}\My Games\Path of Exile\{filter_name}_{f}.filter", File.ReadAllText(string.Format("structure\\{0}.filter", sec.section)));
|
||||
File.AppendAllText($@"{path}\My Games\Path of Exile\{filter_name}_{f}.filter", "" + Environment.NewLine);
|
||||
File.AppendAllText($@"{path}\My Games\Path of Exile\{filter_name}_{f}.filter", "" + Environment.NewLine);
|
||||
}
|
||||
}
|
||||
ftotal = 0;
|
||||
fprog = 0;
|
||||
CleanDir();
|
||||
}
|
||||
|
||||
// Download the sounds from the remote list
|
||||
msg.CMW($@"Downloading the latest sound...", true, 1);
|
||||
var sl = web.ReadString("https://raw.githubusercontent.com/mikxqc/PoE-MxFilter-Data/master/json/mxfiltergen_sound.json");
|
||||
REMSND slj = JsonConvert.DeserializeObject<REMSND>(sl);
|
||||
stotal = slj.sound.Count;
|
||||
foreach (string s in slj.sound)
|
||||
{
|
||||
sprog = sprog + 1;
|
||||
msg.drawProgress(sprog, stotal);
|
||||
if (File.Exists($@"{path}\My Games\Path of Exile\{s}")) { File.Delete($@"{path}\My Games\Path of Exile\{s}"); }
|
||||
web.DownloadFile($"https://raw.githubusercontent.com/mikxqc/PoE-MxFilter-Data/master/mp3/{s}",$@"{path}\My Games\Path of Exile\{s}");
|
||||
}
|
||||
|
||||
// Clean all generated data
|
||||
CleanDirData();
|
||||
}
|
||||
}
|
||||
|
||||
private static byte[] GenerateAssemblyAndGetRawBytes(string dll)
|
||||
{
|
||||
string lp = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
||||
var path = $@"{lp}\structure\{dll}.dll";
|
||||
return File.ReadAllBytes(path);
|
||||
}
|
||||
|
||||
public static void CleanDirData()
|
||||
{
|
||||
DirectoryInfo dataDir = new DirectoryInfo(@"data\");
|
||||
DirectoryInfo genDir = new DirectoryInfo(@"gen\");
|
||||
DirectoryInfo strucDir = new DirectoryInfo(@"structure\");
|
||||
foreach (FileInfo file in dataDir.GetFiles())
|
||||
{
|
||||
file.Delete();
|
||||
@@ -45,24 +245,43 @@ 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");
|
||||
web.SaveString(json.settings.GetAPI() + "GetUniqueWeaponOverview?league=" + json.settings.GetLeague(), "data/ninja.weapon.json");
|
||||
web.SaveString(json.settings.GetAPI() + "GetUniqueAccessoryOverview?league=" + json.settings.GetLeague(), "data/ninja.accessory.json");
|
||||
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");
|
||||
public static void CleanDir()
|
||||
{
|
||||
DirectoryInfo genDir = new DirectoryInfo(@"gen\");
|
||||
DirectoryInfo strucDir = new DirectoryInfo(@"structure\");
|
||||
foreach (FileInfo file in genDir.GetFiles())
|
||||
{
|
||||
file.Delete();
|
||||
}
|
||||
foreach (FileInfo file in strucDir.GetFiles())
|
||||
{
|
||||
file.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
msg.CMW("########## Generating Weapons ##########",true,1);
|
||||
json.weapons.GenWeapons();
|
||||
msg.CMW("########## Generating Armours ##########", true, 1);
|
||||
json.armours.GenArmours();
|
||||
msg.CMW("########## Generating Accessories ##########", true, 1);
|
||||
json.accessories.GenAccessories();
|
||||
msg.CMW("########## Generating Maps ##########", true, 1);
|
||||
json.maps.GenMaps();
|
||||
msg.CMW("########## Generating Cards ##########", true, 1);
|
||||
json.cards.GenCards();
|
||||
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 = new object[] { json.settings.GetSection(), json.settings.GetAPI(), main.league, json.settings.GetMinimumValue() };
|
||||
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);
|
||||
|
||||
@@ -114,19 +144,64 @@ namespace PoE_MxFilterGen
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
}
|
||||
|
||||
public static void drawProgress(int progress, int total)
|
||||
{
|
||||
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);
|
||||
string beg = String.Format("[{0}] [", date);
|
||||
Console.ForegroundColor = ConsoleColor.Cyan;
|
||||
if (progress == 1)
|
||||
{
|
||||
Console.Write(beg);
|
||||
Console.CursorLeft = total+beg.Length;
|
||||
Console.Write("]");
|
||||
}
|
||||
Console.CursorLeft = (progress + beg.Length)-1;
|
||||
Console.Write($"#");
|
||||
Console.CursorLeft = beg.Length + total + 2;
|
||||
Console.Write($"{progress}/{total}");
|
||||
if (progress == total)
|
||||
{
|
||||
Console.WriteLine();
|
||||
}
|
||||
}
|
||||
|
||||
public static void Splash()
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Cyan;
|
||||
Console.WriteLine("");
|
||||
Console.WriteLine(@"############################");
|
||||
Console.WriteLine(@"# #");
|
||||
Console.WriteLine(@"# MxFilterGen #");
|
||||
Console.WriteLine(@"# by mikx #");
|
||||
Console.WriteLine(@"# poe.mikx.xyz #");
|
||||
Console.WriteLine(@"# #");
|
||||
Console.WriteLine(@"#--------------------------#");
|
||||
Console.WriteLine(String.Format("# MxFilterGen {0}-{1} #", main.version, main.release));
|
||||
Console.WriteLine(@"############################");
|
||||
Console.WriteLine("#### MxFilterGen");
|
||||
Console.WriteLine(string.Format("#### VERSION: {0}",main.version));
|
||||
Console.WriteLine("#### DEV: mikx");
|
||||
Console.WriteLine("#### POWERED BY: poe.ninja");
|
||||
Console.WriteLine("");
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
bfff0fcf98b7df58adeb8698423149e393b63067
|
||||
710ffc5d9eff805a0b215f1fa96d491e0bdd21cf
|
||||
|
||||
Binary file not shown.
@@ -6,3 +6,47 @@ D:\_MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\mxfiltergen.exe
|
||||
D:\_MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\mxfiltergen.pdb
|
||||
D:\_MxGit\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\Newtonsoft.Json.dll
|
||||
D:\_MxGit\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\Newtonsoft.Json.xml
|
||||
D:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.exe.config
|
||||
D:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.exe
|
||||
D:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.pdb
|
||||
D:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\Newtonsoft.Json.dll
|
||||
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
|
||||
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.CopyComplete
|
||||
E:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\mxfiltergen.exe
|
||||
E:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\mxfiltergen.pdb
|
||||
E:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csprojAssemblyReference.cache
|
||||
I:\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csprojAssemblyReference.cache
|
||||
I:\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csproj.CoreCompileInputs.cache
|
||||
I:\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\mxfiltergen.exe
|
||||
I:\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\mxfiltergen.pdb
|
||||
I:\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.exe.config
|
||||
I:\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.exe
|
||||
I:\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.pdb
|
||||
I:\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\Newtonsoft.Json.xml
|
||||
I:\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csproj.CopyComplete
|
||||
I:\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.exe.config
|
||||
I:\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.exe
|
||||
I:\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.pdb
|
||||
I:\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\Newtonsoft.Json.xml
|
||||
I:\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csprojAssemblyReference.cache
|
||||
I:\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csproj.CoreCompileInputs.cache
|
||||
I:\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csproj.CopyComplete
|
||||
I:\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\mxfiltergen.exe
|
||||
I:\MxGit\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\mxfiltergen.pdb
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net452" />
|
||||
<package id="Costura.Fody" version="3.2.1" targetFramework="net452" />
|
||||
<package id="Fody" version="3.3.3" targetFramework="net452" developmentDependency="true" />
|
||||
<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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
20
packages/Newtonsoft.Json.10.0.3/LICENSE.md
vendored
20
packages/Newtonsoft.Json.10.0.3/LICENSE.md
vendored
@@ -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
116
packages/Newtonsoft.Json.10.0.3/tools/install.ps1
vendored
116
packages/Newtonsoft.Json.10.0.3/tools/install.ps1
vendored
@@ -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
|
||||
Reference in New Issue
Block a user