This repository has been archived by the owner on Dec 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathPlugin.cs
55 lines (50 loc) · 1.37 KB
/
Plugin.cs
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
46
47
48
49
50
51
52
53
54
55
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using IPA;
using IPA.Config;
using IPA.Config.Stores;
using UnityEngine.SceneManagement;
using UnityEngine;
using IPALogger = IPA.Logging.Logger;
using EnhancedStreamChat.Chat;
using IPA.Loader;
using System.Reflection;
namespace EnhancedStreamChat
{
[Plugin(RuntimeOptions.DynamicInit)]
public class Plugin
{
internal static Plugin instance { get; private set; }
internal static string Name => "EnhancedStreamChat";
internal static string Version => _meta.Version.ToString() ?? Assembly.GetExecutingAssembly().GetName().Version.ToString();
private static PluginMetadata _meta;
[Init]
public void Init(IPALogger logger, PluginMetadata meta)
{
instance = this;
_meta = meta;
Logger.log = logger;
Logger.log.Debug("Logger initialized.");
var config = ChatConfig.instance;
}
[OnEnable]
public void OnEnable()
{
try
{
ChatManager.instance.enabled = true;
}
catch(Exception ex)
{
Logger.log.Error(ex);
}
}
[OnDisable]
public void OnDisable()
{
ChatManager.instance.enabled = false;
}
}
}