Skip to content

Commit

Permalink
Merge pull request #215 from architdate/dlc
Browse files Browse the repository at this point in the history
SV update 2.1.0 - Teal Mask support
  • Loading branch information
architdate authored Sep 25, 2023
2 parents 58b5bb5 + dc3a9eb commit b385ecb
Show file tree
Hide file tree
Showing 88 changed files with 6,053 additions and 2,816 deletions.
69 changes: 69 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
[*.cs]
csharp_style_var_for_built_in_types=true:silent
csharp_style_var_when_type_is_apparent=true:silent
csharp_style_var_elsewhere=true:silent

dotnet_diagnostic.IDE0055.severity = none

##
## StyleCop.Analyzers
##

dotnet_diagnostic.SA1000.severity = none
dotnet_diagnostic.SA1009.severity = none
dotnet_diagnostic.SA1111.severity = none
dotnet_diagnostic.SA1118.severity = none
dotnet_diagnostic.SA1137.severity = none
dotnet_diagnostic.SA1500.severity = none
dotnet_diagnostic.SA1501.severity = none
dotnet_diagnostic.SA1502.severity = none
dotnet_diagnostic.SA1504.severity = none
dotnet_diagnostic.SA1516.severity = none
dotnet_diagnostic.SA1001.severity = none
dotnet_diagnostic.SA1002.severity = none
dotnet_diagnostic.SA1003.severity = none
dotnet_diagnostic.SA1007.severity = none
dotnet_diagnostic.SA1008.severity = none
dotnet_diagnostic.SA1010.severity = none
dotnet_diagnostic.SA1011.severity = none
dotnet_diagnostic.SA1012.severity = none
dotnet_diagnostic.SA1013.severity = none
dotnet_diagnostic.SA1014.severity = none
dotnet_diagnostic.SA1015.severity = none
dotnet_diagnostic.SA1016.severity = none
dotnet_diagnostic.SA1017.severity = none
dotnet_diagnostic.SA1018.severity = none
dotnet_diagnostic.SA1019.severity = none
dotnet_diagnostic.SA1020.severity = none
dotnet_diagnostic.SA1021.severity = none
dotnet_diagnostic.SA1022.severity = none
dotnet_diagnostic.SA1023.severity = none
dotnet_diagnostic.SA1024.severity = none
dotnet_diagnostic.SA1025.severity = none
dotnet_diagnostic.SA1026.severity = none
dotnet_diagnostic.SA1027.severity = none
dotnet_diagnostic.SA1028.severity = none
dotnet_diagnostic.SA1102.severity = none
dotnet_diagnostic.SA1103.severity = none
dotnet_diagnostic.SA1104.severity = none
dotnet_diagnostic.SA1105.severity = none
dotnet_diagnostic.SA1107.severity = none
dotnet_diagnostic.SA1110.severity = none
dotnet_diagnostic.SA1112.severity = none
dotnet_diagnostic.SA1113.severity = none
dotnet_diagnostic.SA1114.severity = none
dotnet_diagnostic.SA1115.severity = none
dotnet_diagnostic.SA1116.severity = none
dotnet_diagnostic.SA1117.severity = none
dotnet_diagnostic.SA1127.severity = none
dotnet_diagnostic.SA1128.severity = none
dotnet_diagnostic.SA1136.severity = none
dotnet_diagnostic.SA1505.severity = none
dotnet_diagnostic.SA1506.severity = none
dotnet_diagnostic.SA1507.severity = none
dotnet_diagnostic.SA1508.severity = none
dotnet_diagnostic.SA1509.severity = none
dotnet_diagnostic.SA1510.severity = none
dotnet_diagnostic.SA1511.severity = none
dotnet_diagnostic.SA1517.severity = none
dotnet_diagnostic.SA1518.severity = none
2 changes: 1 addition & 1 deletion AutoLegalityMod/AutoModPlugins.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<ItemGroup>
<PackageReference Include="Costura.Fody" Version="5.8.0-alpha0098" PrivateAssets="all" />
<PackageReference Include="Fody" Version="6.8.0" PrivateAssets="all" />
<PackageReference Include="PKHeX.Core" Version="23.8.24" ExcludeAssets="runtime" />
<PackageReference Include="PKHeX.Core" Version="23.9.25" ExcludeAssets="runtime" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
<PackageReference Include="System.Resources.Extensions" Version="7.0.0" />
<ProjectReference Include="..\PKHeX.Core.AutoMod\PKHeX.Core.AutoMod.csproj" />
Expand Down
18 changes: 13 additions & 5 deletions AutoLegalityMod/GUI/ALMSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace AutoModPlugins.GUI
public partial class ALMSettings : Form
{
private PluginSettings pluginSettings;

public ALMSettings(PluginSettings obj)
{
pluginSettings = obj;
Expand Down Expand Up @@ -39,13 +40,16 @@ private static void EditSettingsProperties(object _settings)
{
var lang = WinFormsTranslator.CurrentLanguage;
var translation = WinFormsTranslator.GetContext(lang);
var type_descriptor = TypeDescriptor.GetProvider(_settings).GetTypeDescriptor(_settings);
var type_descriptor = TypeDescriptor
.GetProvider(_settings)
.GetTypeDescriptor(_settings);
if (type_descriptor == null)
return;
var ctd = new PropertyOverridingTypeDescriptor(type_descriptor);
foreach (var pd in TypeDescriptor.GetProperties(_settings).OfType<PropertyDescriptor>())
{
var desc = "Property Description needs to be defined. Please raise this issue on GitHub or at the discord: https://discord.gg/tDMvSRv";
var desc =
"Property Description needs to be defined. Please raise this issue on GitHub or at the discord: https://discord.gg/tDMvSRv";
if (pd.Description != null)
desc = translation.GetTranslatedText($"{pd.Name}_description", pd.Description);

Expand All @@ -54,7 +58,12 @@ private static void EditSettingsProperties(object _settings)
category = translation.GetTranslatedText($"{pd.Name}_category", pd.Category);
if (desc == null || category == null)
throw new Exception("Category / Description translations are null");
PropertyDescriptor pd2 = TypeDescriptor.CreateProperty(_settings.GetType(), pd, new DescriptionAttribute(desc), new CategoryAttribute(category));
PropertyDescriptor pd2 = TypeDescriptor.CreateProperty(
_settings.GetType(),
pd,
new DescriptionAttribute(desc),
new CategoryAttribute(category)
);
ctd.OverrideProperty(pd2);
}
TypeDescriptor.AddProvider(new TypeDescriptorOverridingProvider(ctd), _settings);
Expand All @@ -66,8 +75,7 @@ public class PropertyOverridingTypeDescriptor : CustomTypeDescriptor
private readonly Dictionary<string, PropertyDescriptor> overridePds = new();

public PropertyOverridingTypeDescriptor(ICustomTypeDescriptor parent)
: base(parent)
{ }
: base(parent) { }

public void OverrideProperty(PropertyDescriptor pd)
{
Expand Down
Loading

0 comments on commit b385ecb

Please sign in to comment.