Skip to content

Commit

Permalink
Expose loaded mods in the interface
Browse files Browse the repository at this point in the history
  • Loading branch information
NotNite committed Oct 25, 2024
1 parent 4a0bfba commit a5474df
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion GDWeave/GDWeave.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Version>2.0.8.0</Version>
<Version>2.0.9.0</Version>

<!-- required for loader -->
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
Expand Down
1 change: 1 addition & 0 deletions GDWeave/IModInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace GDWeave;

public interface IModInterface {
public ILogger Logger { get; }
public string[] LoadedMods { get; }

public T ReadConfig<T>() where T : class, new();
public void WriteConfig<T>(T config) where T : class;
Expand Down
1 change: 1 addition & 0 deletions GDWeave/Loader/ModInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace GDWeave;

internal class ModInterface(string modId, ModLoader modLoader) : IModInterface {
public ILogger Logger { get; } = GDWeave.Logger.ForContext("SourceContext", modId);
public string[] LoadedMods => modLoader.LoadedMods.Select(x => x.Manifest.Id).ToArray();

private string GetConfigPath() => Path.Combine(GDWeave.GDWeaveDir, "configs", $"{modId}.json");

Expand Down

0 comments on commit a5474df

Please sign in to comment.