diff --git a/EnableFullScreenToggleIL2CPP_netFm/EnableFullScreenToggleIL2CPP_netFm.cs b/EnableFullScreenToggleIL2CPP_netFm/EnableFullScreenToggleIL2CPP_netFm.cs index 02be714..943d3a4 100644 --- a/EnableFullScreenToggleIL2CPP_netFm/EnableFullScreenToggleIL2CPP_netFm.cs +++ b/EnableFullScreenToggleIL2CPP_netFm/EnableFullScreenToggleIL2CPP_netFm.cs @@ -3,8 +3,6 @@ using System; using UnhollowerRuntimeLib; using UnityEngine; -using Input = UnityEngine.Input; -using KeyCode = UnityEngine.KeyCode; namespace EnableFullScreenToggleIL2CPP_netFm { @@ -16,7 +14,7 @@ public class EnableFullScreenToggle : BasePlugin { internal const string GUID = "SpockBauru.EnableFullScreenToggleIL2CPP_netFm"; internal const string PluginName = "Enable Full Screen Toggle"; - internal const string PluginVersion = "0.5"; + internal const string PluginVersion = "0.6"; //Game Object shared between all SpockPlugins_BepInEx plugins public GameObject SpockBauru; diff --git a/EnableResizeIL2CPP_netFm/EnableResize.cs b/EnableResizeIL2CPP_netFm/EnableResize.cs index d2693d0..23a4b4b 100644 --- a/EnableResizeIL2CPP_netFm/EnableResize.cs +++ b/EnableResizeIL2CPP_netFm/EnableResize.cs @@ -131,7 +131,6 @@ private void Initialize() StartCoroutine(TestScreen().WrapToIl2Cpp()); } - private IEnumerator TestScreen() { while (true) diff --git a/EnableResizeMono/EnableResizeMono.cs b/EnableResizeMono/EnableResizeMono.cs deleted file mode 100644 index 0a875fc..0000000 --- a/EnableResizeMono/EnableResizeMono.cs +++ /dev/null @@ -1,121 +0,0 @@ -using BepInEx; -using BepInEx.Configuration; -using System; -using System.Collections; -using System.Diagnostics; -using System.Runtime.InteropServices; -using System.Text; -using UnityEngine; - -namespace EnableResizeMono -{ - [BepInPlugin(GUID, PluginName, PluginVersion)] - public class EnableResizeMono : BaseUnityPlugin - { - public const string GUID = "SpockBauru.EnableResize.Mono"; - public const string PluginName = "Enable Resize Mono"; - public const string PluginVersion = "1.0"; - - public static ConfigEntry ConfigEnableResize { get; private set; } - - public delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr lParam); - - [DllImport("user32.dll")] - private static extern bool EnumWindows(EnumWindowsProc enumProc, IntPtr lParam); - - [DllImport("user32.dll", SetLastError = true)] - private static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId); - - [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)] - private static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount); - - [DllImport("user32.dll")] - public static extern int GetWindowLong(IntPtr hWnd, int nIndex); - - [DllImport("user32.dll")] - public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); - - // Almost the same: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowlongptra - private const int GWL_STYLE = -16; - - // https://docs.microsoft.com/en-us/windows/win32/winmsg/window-styles - private const int WS_CAPTION = 0XC00000; - private const int WS_MAXIMIZEBOX = 0x10000; - private const int WS_MINIMIZEBOX = 0x20000; - private const int WS_SYSMENU = 0x80000; - private const int WS_THICKFRAME = 0x40000; - - private const string GET_CLASS_NAME_MAGIC = "UnityWndClass"; //How Anon got this??? - private IntPtr WindowHandle = IntPtr.Zero; - - private int style = 0; - private bool fs = false; - private bool prevFS = true; - private int res = 0; - private int prevRes = 1; - private int borderless = 1; - private int prevBorderless = 0; - private int borderlessMask = WS_CAPTION | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_SYSMENU | WS_THICKFRAME; - private WaitForSecondsRealtime oneSecond = new WaitForSecondsRealtime(1f); - - internal void Awake() - { - ConfigEnableResize = Config.Bind("Config", "Enable Resize", true, "Whether to allow the game window to be resized. Requires game restart to take effect."); - if (!ConfigEnableResize.Value) return; - - var pid = Process.GetCurrentProcess().Id; - EnumWindows((w, param) => - { - if (w == IntPtr.Zero) return true; - if (GetWindowThreadProcessId(w, out uint lpdwProcessId) == 0) return true; - if (lpdwProcessId != pid) return true; - var cn = new StringBuilder(256); - if (GetClassName(w, cn, cn.Capacity) == 0) return true; - if (cn.ToString() != GET_CLASS_NAME_MAGIC) return true; - WindowHandle = w; - return false; - }, IntPtr.Zero); - - if (WindowHandle == IntPtr.Zero) return; - - StartCoroutine(TestScreen()); - ConfigEnableResize.SettingChanged += (sender, args) => StartCoroutine(TestScreen()); - } - - private IEnumerator TestScreen() - { - while (true) - { - if (!ConfigEnableResize.Value) yield break; - - fs = Screen.fullScreen; - res = Screen.width + Screen.height; - style = GetWindowLong(WindowHandle, GWL_STYLE); - - // If zero, is in borderless mode - borderless = style & borderlessMask; - - if (!fs && prevFS || - res != prevRes || - borderless != 0 && prevBorderless == 0) - { - ResizeWindow(); - } - - prevBorderless = borderless; - prevFS = fs; - prevRes = res; - yield return oneSecond; - } - } - - private void ResizeWindow() - { - if (fs) return; - if (borderless == 0) return; - style = GetWindowLong(WindowHandle, GWL_STYLE); - style |= WS_THICKFRAME | WS_MAXIMIZEBOX; - SetWindowLong(WindowHandle, GWL_STYLE, style); - } - } -} diff --git a/EnableResizeMono/EnableResizeMono.csproj b/EnableResizeMono/EnableResizeMono.csproj deleted file mode 100644 index f243c1d..0000000 --- a/EnableResizeMono/EnableResizeMono.csproj +++ /dev/null @@ -1,60 +0,0 @@ - - - - - Debug - AnyCPU - {6E835981-EEB7-4E65-B7C0-9F71AE92E4FB} - Library - Properties - EnableResizeMono - EnableResizeMono - v3.5 - 512 - true - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - - - - - - - ..\MonoLibs\BepInEx.dll - - - ..\MonoLibs\UnityEngine.dll - - - - - - - - - xcopy "$(TargetPath)" "$(SolutionDir)Releases\$(ProjectName)\BepInEx\Plugins\" /s /i /y -powershell Compress-Archive -Path '$(SolutionDir)Releases\$(ProjectName)\BepInEx\' -DestinationPath '$(SolutionDir)Releases\$(ProjectName).zip' -Force -RD /S /Q "$(SolutionDir)Releases\$(ProjectName)\" - - \ No newline at end of file diff --git a/EnableResizeMono/Properties/AssemblyInfo.cs b/EnableResizeMono/Properties/AssemblyInfo.cs deleted file mode 100644 index 980ceb4..0000000 --- a/EnableResizeMono/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System.Reflection; -using static EnableResizeMono.EnableResizeMono; - -[assembly: AssemblyTitle(GUID)] -[assembly: AssemblyDescription(PluginName)] -[assembly: AssemblyProduct(GUID)] -[assembly: AssemblyVersion(PluginVersion)] -[assembly: AssemblyFileVersion(PluginVersion)] diff --git a/GraphicsSettingsIL2CPP_netFm/GraphicsSettings.cs b/GraphicsSettingsIL2CPP_netFm/GraphicsSettings.cs index 1dee1e4..c3709d7 100644 --- a/GraphicsSettingsIL2CPP_netFm/GraphicsSettings.cs +++ b/GraphicsSettingsIL2CPP_netFm/GraphicsSettings.cs @@ -15,7 +15,7 @@ public class GraphicsSettings : BasePlugin { internal const string GUID = "SpockBauru.GraphicsSettingsIL2CPP_NetFm"; internal const string PluginName = "Graphics Settings"; - internal const string PluginVersion = "0.5"; + internal const string PluginVersion = "0.6"; private static ConfigEntry Width; private static ConfigEntry Height; diff --git a/MessageCenterIL2CPP_netFm/MessageCenter.cs b/MessageCenterIL2CPP_netFm/MessageCenter.cs index 853a062..092c56c 100644 --- a/MessageCenterIL2CPP_netFm/MessageCenter.cs +++ b/MessageCenterIL2CPP_netFm/MessageCenter.cs @@ -19,7 +19,7 @@ public partial class MessageCenter : BasePlugin { internal const string GUID = "SpockBauru.MessageCenterIL2CPP_netFm"; internal const string PluginName = "Message Center"; - internal const string PluginVersion = "0.5"; + internal const string PluginVersion = "0.6"; //Game Object shared between all SpockPlugins_BepInEx plugins public GameObject SpockBauru; diff --git a/MessageCenterIL2CPP_netFm/ShadowAndOutline.cs b/MessageCenterIL2CPP_netFm/ShadowAndOutline.cs index ecb1e0c..c062285 100644 --- a/MessageCenterIL2CPP_netFm/ShadowAndOutline.cs +++ b/MessageCenterIL2CPP_netFm/ShadowAndOutline.cs @@ -77,23 +77,5 @@ public static void DrawShadow(Rect rect, GUIContent content, GUIStyle style, Col style.normal.textColor = backupColor; } public static void DrawLayoutShadow(GUIContent content, GUIStyle style, Color txtColor, Color shadowColor, Vector2 direction, params GUILayoutOption[] options) => DrawShadow(GUILayoutUtility.GetRect(content, style, options), content, style, txtColor, shadowColor, direction); - - public static bool DrawButtonWithShadow(Rect r, GUIContent content, GUIStyle style, float shadowAlpha, Vector2 direction) - { - GUIStyle letters = style; - letters.normal.background = null; - letters.hover.background = null; - letters.active.background = null; - - bool result = GUI.Button(r, content, style); - - Color color = r.Contains(Event.current.mousePosition) ? letters.hover.textColor : letters.normal.textColor; - - DrawShadow(r, content, letters, color, new Color(0f, 0f, 0f, shadowAlpha), direction); - - return result; - } - - public static bool DrawLayoutButtonWithShadow(GUIContent content, GUIStyle style, float shadowAlpha, Vector2 direction, params GUILayoutOption[] options) => DrawButtonWithShadow(GUILayoutUtility.GetRect(content, style, options), content, style, shadowAlpha, direction); } } diff --git a/MuteInBackgroundIL2CPP_NetFm/MuteInBackground.cs b/MuteInBackgroundIL2CPP_NetFm/MuteInBackground.cs index ed736b4..739fa1d 100644 --- a/MuteInBackgroundIL2CPP_NetFm/MuteInBackground.cs +++ b/MuteInBackgroundIL2CPP_NetFm/MuteInBackground.cs @@ -15,7 +15,7 @@ public class MuteInBackground : BasePlugin { internal const string GUID = "SpockBauru.MuteInBackgroundIL2CPP_netFm"; internal const string PluginName = "Mute In Background"; - internal const string PluginVersion = "0.5"; + internal const string PluginVersion = "0.6"; //Game Object shared between all SpockPlugins_BepInEx plugins public GameObject SpockBauru; diff --git a/SpockPlugins_BepInEx.sln b/SpockPlugins_BepInEx.sln index e587433..346fb46 100644 --- a/SpockPlugins_BepInEx.sln +++ b/SpockPlugins_BepInEx.sln @@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.3.32825.248 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnableResizeMono", "EnableResizeMono\EnableResizeMono.csproj", "{6E835981-EEB7-4E65-B7C0-9F71AE92E4FB}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnableResizeIL2CPP_netFm", "EnableResizeIL2CPP_netFm\EnableResizeIL2CPP_netFm.csproj", "{9921DE3B-DEF2-4470-BD8F-23F207128844}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnableFullScreenToggleIL2CPP_netFm", "EnableFullScreenToggleIL2CPP_netFm\EnableFullScreenToggleIL2CPP_netFm.csproj", "{F37EF379-2D98-469F-8CBF-EC995F54D7DF}" @@ -21,10 +19,6 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6E835981-EEB7-4E65-B7C0-9F71AE92E4FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6E835981-EEB7-4E65-B7C0-9F71AE92E4FB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6E835981-EEB7-4E65-B7C0-9F71AE92E4FB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6E835981-EEB7-4E65-B7C0-9F71AE92E4FB}.Release|Any CPU.Build.0 = Release|Any CPU {9921DE3B-DEF2-4470-BD8F-23F207128844}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9921DE3B-DEF2-4470-BD8F-23F207128844}.Debug|Any CPU.Build.0 = Debug|Any CPU {9921DE3B-DEF2-4470-BD8F-23F207128844}.Release|Any CPU.ActiveCfg = Release|Any CPU