34 lines
850 B
C#
34 lines
850 B
C#
using CringePlugins.Render;
|
|
using HarmonyLib;
|
|
using VRage.Plugins;
|
|
|
|
namespace Plugin.ClientModLoader;
|
|
|
|
public class Plugin : IPlugin
|
|
{
|
|
private ModListComponent? _component;
|
|
|
|
private readonly DirectoryInfo _dir =
|
|
new(Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
|
|
"CringeLauncher", "config"));
|
|
|
|
public void Dispose()
|
|
{
|
|
}
|
|
|
|
public void Init(object gameInstance)
|
|
{
|
|
new Harmony("Plugin.ClientModLoader").PatchAll(typeof(Plugin).Assembly);
|
|
RenderHandler.Current.RegisterComponent(_component = new ModListComponent(Path.Join(_dir.FullName, "mods.json")));
|
|
ModInjector.Mods = _component.Installed;
|
|
}
|
|
|
|
public void Update()
|
|
{
|
|
}
|
|
|
|
public void OpenConfigDialog()
|
|
{
|
|
if (_component != null) _component.Visible = true;
|
|
}
|
|
} |