Skip to content

Commit

Permalink
Feat | Settings
Browse files Browse the repository at this point in the history
  • Loading branch information
kitUIN committed Dec 25, 2024
1 parent 868ae93 commit 6e70121
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!-- Nuget -->
<Version>1.1.3</Version>
<Version>1.2.2</Version>
<PackageId>ShadowPluginLoader.MetaAttributes</PackageId>
<Authors>kitUIN</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ public class ShadowPluginSettingClassAttribute : Attribute
/// <summary>
/// Plugin Type
/// </summary>
public string PluginType { get; init; }
public Type PluginType { get; }

/// <summary>
/// Plugin Namespace
/// Accessor Alias Name
/// </summary>
public string PluginNamespace { get; init; }
public string AccessorAlias { get; }

/// <summary>
/// An attribute used to mark a class as a plugin settings class for the Shadow Plugin Loader framework.
Expand All @@ -25,9 +25,9 @@ public class ShadowPluginSettingClassAttribute : Attribute
/// The designated class using this attribute should be intended to manage settings specific
/// to a plugin defined by the associated <see cref="PluginType"/>.
/// </remarks>
public ShadowPluginSettingClassAttribute(string pluginType, string pluginNamespace)
public ShadowPluginSettingClassAttribute(Type pluginType, string accessorAlias = "Settings")
{
PluginType = pluginType;
PluginNamespace = pluginNamespace;
AccessorAlias = accessorAlias;
}
}
8 changes: 4 additions & 4 deletions ShadowPluginLoader.MetaAttributes/ShadowSettingAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ public class ShadowSettingAttribute : Attribute
/// <summary>
/// Setting Type
/// </summary>
public string SettingType { get; init; }
public Type SettingType { get; }

/// <summary>
/// Setting Default
/// </summary>
public string? Default { get; init; }
public string? Default { get; }

/// <summary>
/// Setting Comment
/// </summary>
public string? Comment { get; init; }
public string? Comment { get; }

/// <summary>
/// Represents an attribute used to configure and manage specific field settings.
/// </summary>
public ShadowSettingAttribute(string settingType, string? defaultVal = null, string? comment = null)
public ShadowSettingAttribute(Type settingType, string? defaultVal = null, string? comment = null)
{
SettingType = settingType;
Default = defaultVal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,24 @@
/// Represents properties that specify aliases for classes generated by enumerated types.
/// </summary>
[AttributeUsage(AttributeTargets.Enum)]
public class ShadowPluginSettingClassAliasAttribute : Attribute
public class ShadowSettingClassAttribute : Attribute
{
/// <summary>
/// Plugin Alias
/// </summary>
public string Alias { get; init; }
public string Alias { get; }

/// <summary>
/// Setting Container
/// </summary>
public string Container { get; }

/// <summary>
/// Represents properties that specify aliases for classes generated by enumerated types
/// </summary>
public ShadowPluginSettingClassAliasAttribute(string alias)
public ShadowSettingClassAttribute(string container, string alias)
{
Alias = alias;
Container = container;
}
}
4 changes: 2 additions & 2 deletions ShadowPluginLoader.Tool/ShadowPluginLoader.Tool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<IncludeBuildOutput>false</IncludeBuildOutput>
<NoWarn>NU5128;NU5129</NoWarn>

<Version>1.2.2</Version>
<Version>1.3.0</Version>
<LangVersion>12</LangVersion>
<PackageId>ShadowPluginLoader.Tool</PackageId>
<Owner>kitUIN</Owner>
Expand All @@ -33,7 +33,7 @@
<None Include="$(OutputPath)\ShadowPluginLoader.MetaAttributes.dll" Pack="True" PackagePath="build\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ShadowPluginLoader.MetaAttributes" Version="1.1.3" />
<PackageReference Include="ShadowPluginLoader.MetaAttributes" Version="1.2.2" />
</ItemGroup>
<ItemGroup>
<None Include="Assets\build\**"/>
Expand Down

0 comments on commit 6e70121

Please sign in to comment.