initial
This commit is contained in:
31
LightPerms/Plugin.cs
Normal file
31
LightPerms/Plugin.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System.IO;
|
||||
using System.Windows.Controls;
|
||||
using heh;
|
||||
using Torch;
|
||||
using Torch.API;
|
||||
using Torch.API.Managers;
|
||||
using Torch.API.Plugins;
|
||||
using Torch.API.Session;
|
||||
using Torch.Views;
|
||||
|
||||
namespace LightPerms;
|
||||
|
||||
public class Plugin : TorchPluginBase, IWpfPlugin
|
||||
{
|
||||
private Persistent<Config> _config = null!;
|
||||
|
||||
public override void Init(ITorchBase torch)
|
||||
{
|
||||
base.Init(torch);
|
||||
_config = Persistent<Config>.Load(Path.Combine(StoragePath, "LightPerms.cfg"));
|
||||
Torch.Managers.AddManager(DbManager.Static);
|
||||
Torch.Managers.AddManager(new PermissionsManager(Torch));
|
||||
Torch.Managers.GetManager<ITorchSessionManager>().AddFactory(s => new MultiplayerMembersManager(s.Torch));
|
||||
}
|
||||
|
||||
public UserControl GetControl() => new PropertyGrid
|
||||
{
|
||||
Margin = new(3),
|
||||
DataContext = _config.Data
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user