using System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("Plugins.Common")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ChzzkSkul { [BepInPlugin("com.slibul.chzzkskulcontroller", "ChzzkSkulController", "1.1.8")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class PluginController : BaseUnityPlugin { public static ManualLogSource Log; public static ConfigEntry EnableItemsMode; public static ConfigEntry EnableStreamerMode; public static ConfigEntry ToggleKey; private bool _showWindow = false; private Rect _windowRect = new Rect(150f, 150f, 380f, 260f); private GUIStyle _windowStyle; private GUIStyle _labelStyle; private GUIStyle _buttonStyle; private GUIStyle _toggleStyle; private GUIStyle _titleStyle; private bool _styleInitialized = false; private void Awake() { Log = ((BaseUnityPlugin)this).Logger; EnableItemsMode = ((BaseUnityPlugin)this).Config.Bind("General", "아이템 모드 활성화", true, "커스텀 아이템/스컬/각인 등의 콘텐츠 기능을 켜거나 끕니다."); EnableStreamerMode = ((BaseUnityPlugin)this).Config.Bind("General", "스트리머 모드 활성화", true, "치지직/유튜브 실시간 채팅 및 후원 연동 기능을 켜거나 끕니다."); ToggleKey = ((BaseUnityPlugin)this).Config.Bind("General", "메뉴 단축키", (KeyCode)108, "컨트롤러 메뉴 창을 열고 닫는 단축키입니다."); Log.LogInfo((object)"ChzzkSkulController initialized. Appling initial states..."); try { PluginItems.SetEnabled(EnableItemsMode.Value); } catch (Exception ex) { Log.LogError((object)("Failed to apply initial ItemsMode: " + ex)); } try { Plugin.SetEnabled(EnableStreamerMode.Value); } catch (Exception ex2) { Log.LogError((object)("Failed to apply initial StreamerMode: " + ex2)); } Log.LogInfo((object)"ChzzkSkulController loaded successfully!"); } private void Update() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) if (!Input.GetKeyDown(ToggleKey.Value)) { return; } _showWindow = !_showWindow; if (!_showWindow) { ((BaseUnityPlugin)this).Config.Save(); try { Plugin.ReloadAndReconnect(); } catch (Exception ex) { Log.LogError((object)("Failed to reload and reconnect: " + ex)); } } } private void OnGUI() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (_showWindow) { InitStyles(); _windowRect = GUI.Window(9998, _windowRect, new WindowFunction(DrawWindow), "ChzzkSkul 통합 컨트롤러", _windowStyle); } } private Texture2D MakeRoundedTex(int width, int height, Color col, int radius) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(width, height, (TextureFormat)4, false); Color[] array = (Color[])(object)new Color[width * height]; for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { bool flag = false; float num = 0f; if (j < radius && i < radius) { flag = true; num = Vector2.Distance(new Vector2((float)j, (float)i), new Vector2((float)radius, (float)radius)); } else if (j >= width - radius && i < radius) { flag = true; num = Vector2.Distance(new Vector2((float)j, (float)i), new Vector2((float)(width - radius - 1), (float)radius)); } else if (j < radius && i >= height - radius) { flag = true; num = Vector2.Distance(new Vector2((float)j, (float)i), new Vector2((float)radius, (float)(height - radius - 1))); } else if (j >= width - radius && i >= height - radius) { flag = true; num = Vector2.Distance(new Vector2((float)j, (float)i), new Vector2((float)(width - radius - 1), (float)(height - radius - 1))); } if (flag && num > (float)radius) { array[i * width + j] = Color.clear; } else { array[i * width + j] = col; } } } val.SetPixels(array); val.Apply(); ((Object)val).hideFlags = (HideFlags)61; return val; } private void InitStyles() { //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Expected O, but got Unknown //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Expected O, but got Unknown //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Expected O, but got Unknown //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Expected O, but got Unknown //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Expected O, but got Unknown //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Expected O, but got Unknown //IL_0316: Unknown result type (might be due to invalid IL or missing references) if (!_styleInitialized) { _styleInitialized = true; Color col = default(Color); ((Color)(ref col))..ctor(0.1f, 0.08f, 0.14f, 0.96f); Color col2 = default(Color); ((Color)(ref col2))..ctor(0.22f, 0.13f, 0.32f, 1f); Color col3 = default(Color); ((Color)(ref col3))..ctor(0.35f, 0.2f, 0.5f, 1f); Color col4 = default(Color); ((Color)(ref col4))..ctor(0.28f, 0.18f, 0.38f, 1f); Color textColor = default(Color); ((Color)(ref textColor))..ctor(1f, 0.85f, 0.4f, 1f); Color textColor2 = default(Color); ((Color)(ref textColor2))..ctor(0.9f, 0.9f, 0.95f, 1f); int num = 32; int num2 = 12; _windowStyle = new GUIStyle(GUI.skin.window); _windowStyle.normal.background = MakeRoundedTex(num, num, col, num2); _windowStyle.onNormal.background = MakeRoundedTex(num, num, col, num2); _windowStyle.border = new RectOffset(num2, num2, num2, num2); _windowStyle.normal.textColor = textColor; _windowStyle.onNormal.textColor = textColor; _windowStyle.fontSize = 17; _windowStyle.fontStyle = (FontStyle)1; _windowStyle.padding = new RectOffset(15, 15, 35, 15); _windowStyle.alignment = (TextAnchor)1; _titleStyle = new GUIStyle(GUI.skin.label); _titleStyle.fontSize = 15; _titleStyle.fontStyle = (FontStyle)1; _titleStyle.normal.textColor = textColor; _titleStyle.alignment = (TextAnchor)4; _labelStyle = new GUIStyle(GUI.skin.label); _labelStyle.fontSize = 14; _labelStyle.normal.textColor = textColor2; _labelStyle.alignment = (TextAnchor)3; int num3 = 6; _buttonStyle = new GUIStyle(GUI.skin.button); _buttonStyle.normal.background = MakeRoundedTex(num, num, col2, num3); _buttonStyle.hover.background = MakeRoundedTex(num, num, col3, num3); _buttonStyle.active.background = MakeRoundedTex(num, num, col4, num3); _buttonStyle.border = new RectOffset(num3, num3, num3, num3); _buttonStyle.normal.textColor = textColor2; _buttonStyle.hover.textColor = Color.white; _buttonStyle.fontSize = 14; _buttonStyle.fontStyle = (FontStyle)1; _toggleStyle = new GUIStyle(GUI.skin.toggle); _toggleStyle.normal.textColor = textColor2; _toggleStyle.fontSize = 14; } } private void DrawWindow(int windowID) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) GUILayout.Space(10f); GUILayout.Label($"{ToggleKey.Value} 키로 이 창을 열고 닫을 수 있습니다.", _titleStyle, Array.Empty()); GUILayout.Space(15f); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label("아이템 모드 (Items, Skulls, Inscriptions)", _labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(240f) }); bool flag = GUILayout.Toggle(EnableItemsMode.Value, EnableItemsMode.Value ? " ON" : " OFF", _toggleStyle, Array.Empty()); if (flag != EnableItemsMode.Value) { EnableItemsMode.Value = flag; try { PluginItems.SetEnabled(flag); } catch (Exception ex) { Log.LogError((object)("Failed to toggle ItemsMode: " + ex)); } } GUILayout.EndHorizontal(); GUILayout.Space(10f); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label("스트리머 모드 (Chzzk/YT Live, Chat & Don)", _labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(240f) }); bool flag2 = GUILayout.Toggle(EnableStreamerMode.Value, EnableStreamerMode.Value ? " ON" : " OFF", _toggleStyle, Array.Empty()); if (flag2 != EnableStreamerMode.Value) { EnableStreamerMode.Value = flag2; try { Plugin.SetEnabled(flag2); } catch (Exception ex2) { Log.LogError((object)("Failed to toggle StreamerMode: " + ex2)); } } GUILayout.EndHorizontal(); GUILayout.Space(25f); if (GUILayout.Button("설정 저장 및 닫기", _buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(38f) })) { ((BaseUnityPlugin)this).Config.Save(); _showWindow = false; try { Plugin.ReloadAndReconnect(); } catch (Exception ex3) { Log.LogError((object)("Failed to reload and reconnect: " + ex3)); } } GUI.DragWindow(); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "ChzzkController"; public const string PLUGIN_NAME = "ChzzkController"; public const string PLUGIN_VERSION = "1.1.8"; } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }