-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathPlugin.cs
More file actions
45 lines (39 loc) · 1.25 KB
/
Plugin.cs
File metadata and controls
45 lines (39 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using IPA;
using IPA.Config;
using IPA.Config.Stores;
using ServerBrowser.Assets;
using ServerBrowser.Installers;
using SiraUtil.Web.SiraSync;
using SiraUtil.Zenject;
using IPALogger = IPA.Logging.Logger;
namespace ServerBrowser
{
[Plugin(RuntimeOptions.DynamicInit)]
// ReSharper disable once ClassNeverInstantiated.Global
public class Plugin
{
// ReSharper disable once MemberCanBePrivate.Global
internal static PluginConfig Config { get; private set; } = null!;
[Init]
public void Init(IPALogger logger, Zenjector zenjector, Config config)
{
Config = config.Generated<PluginConfig>();
zenjector.UseMetadataBinder<Plugin>();
zenjector.UseLogger(logger);
zenjector.UseHttpService();
zenjector.UseSiraSync(SiraSyncServiceType.GitHub, "roydejong", "BeatSaberServerBrowser");
zenjector.Install<BssbAppInstaller>(Location.App);
zenjector.Install<BssbMenuInstaller>(Location.Menu);
}
[OnEnable]
public void OnEnable()
{
if (!Sprites.IsInitialized)
Sprites.Initialize();
}
[OnDisable]
public void OnDisable()
{
}
}
}