Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Commit

Permalink
Get rid of that obsolete usage warning
Browse files Browse the repository at this point in the history
  • Loading branch information
zkxs committed Apr 9, 2022
1 parent 9f40ffd commit 66eaaa5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
3 changes: 1 addition & 2 deletions NeosModLoader/ModConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,7 @@ private bool AnyValuesSet()

internal static ModConfiguration LoadConfigForMod(LoadedNeosMod mod)
{
// intentional call to an obsolete method. This will need reorganizing in the next major version.
ModConfigurationDefinition definition = mod.NeosMod.GetConfigurationDefinition();
ModConfigurationDefinition definition = mod.NeosMod.BuildConfigurationDefinition();
if (definition == null)
{
// if there's no definition, then there's nothing for us to do here
Expand Down
17 changes: 13 additions & 4 deletions NeosModLoader/NeosMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,27 @@ public abstract class NeosMod : NeosModBase
public virtual void OnEngineInit() { }

/// <summary>
/// Get the defined configuration for this mod. This should be overridden by your mod if necessary.
/// Build the defined configuration for this mod.
/// </summary>
/// <returns>This mod's configuration definition. calls DefineConfiguration(ModConfigurationDefinitionBuilder) by default.</returns>
[Obsolete("This method is obsolete. Use DefineConfiguration(ModConfigurationDefinitionBuilder) instead.")] // REMOVE IN NEXT MAJOR VERSION
public virtual ModConfigurationDefinition GetConfigurationDefinition()
/// <returns>This mod's configuration definition.</returns>
internal ModConfigurationDefinition BuildConfigurationDefinition()
{
ModConfigurationDefinitionBuilder builder = new(this);
builder.ProcessAttributes();
DefineConfiguration(builder);
return builder.Build();
}

/// <summary>
/// Get the defined configuration for this mod. This should be overridden by your mod if necessary.
/// </summary>
/// <returns>This mod's configuration definition. calls DefineConfiguration(ModConfigurationDefinitionBuilder) by default.</returns>
[Obsolete("This method is obsolete. Use DefineConfiguration(ModConfigurationDefinitionBuilder) instead.")] // REMOVE IN NEXT MAJOR VERSION
public virtual ModConfigurationDefinition GetConfigurationDefinition()
{
return BuildConfigurationDefinition();
}

/// <summary>
/// Create a configuration definition for this mod.
/// </summary>
Expand Down

0 comments on commit 66eaaa5

Please sign in to comment.