mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-03 14:59:23 +00:00
[WindowFocusCheckFix] iniyial push
This commit is contained in:
parent
a6fa59d24c
commit
1f99312c22
5 changed files with 114 additions and 0 deletions
39
WindowFocusCheckFix/Main.cs
Normal file
39
WindowFocusCheckFix/Main.cs
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
using System.Reflection;
|
||||||
|
using ABI_RC.Core;
|
||||||
|
using HarmonyLib;
|
||||||
|
using MelonLoader;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace NAK.WindowFocusCheckFix;
|
||||||
|
|
||||||
|
public class WindowFocusCheckFixMod : MelonMod
|
||||||
|
{
|
||||||
|
#region Melon Events
|
||||||
|
|
||||||
|
public override void OnInitializeMelon()
|
||||||
|
{
|
||||||
|
#region WindowFocusManager Patches
|
||||||
|
|
||||||
|
HarmonyInstance.Patch(
|
||||||
|
typeof(WindowFocusManager).GetMethod(nameof(WindowFocusManager.IsWindowFocused),
|
||||||
|
BindingFlags.NonPublic | BindingFlags.Static),
|
||||||
|
prefix: new HarmonyMethod(typeof(WindowFocusCheckFixMod).GetMethod(nameof(OnPreWindowFocusManagerIsWindowFocused),
|
||||||
|
BindingFlags.NonPublic | BindingFlags.Static))
|
||||||
|
);
|
||||||
|
|
||||||
|
#endregion WindowFocusManager Patches
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Melon Events
|
||||||
|
|
||||||
|
#region Harmony Patches
|
||||||
|
|
||||||
|
// ReSharper disable once RedundantAssignment
|
||||||
|
private static bool OnPreWindowFocusManagerIsWindowFocused(ref bool __result)
|
||||||
|
{
|
||||||
|
__result = Application.isFocused; // use Unity method instead
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Harmony Patches
|
||||||
|
}
|
32
WindowFocusCheckFix/Properties/AssemblyInfo.cs
Normal file
32
WindowFocusCheckFix/Properties/AssemblyInfo.cs
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
using MelonLoader;
|
||||||
|
using NAK.WindowFocusCheckFix.Properties;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
|
||||||
|
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
|
||||||
|
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
|
||||||
|
[assembly: AssemblyTitle(nameof(NAK.WindowFocusCheckFix))]
|
||||||
|
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
|
||||||
|
[assembly: AssemblyProduct(nameof(NAK.WindowFocusCheckFix))]
|
||||||
|
|
||||||
|
[assembly: MelonInfo(
|
||||||
|
typeof(NAK.WindowFocusCheckFix.WindowFocusCheckFixMod),
|
||||||
|
nameof(NAK.WindowFocusCheckFix),
|
||||||
|
AssemblyInfoParams.Version,
|
||||||
|
AssemblyInfoParams.Author,
|
||||||
|
downloadLink: "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/WindowFocusCheckFix"
|
||||||
|
)]
|
||||||
|
|
||||||
|
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
|
||||||
|
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
|
||||||
|
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
|
||||||
|
[assembly: MelonColor(255, 246, 25, 99)] // red-pink
|
||||||
|
[assembly: MelonAuthorColor(255, 158, 21, 32)] // red
|
||||||
|
[assembly: HarmonyDontPatchAll]
|
||||||
|
|
||||||
|
namespace NAK.WindowFocusCheckFix.Properties;
|
||||||
|
internal static class AssemblyInfoParams
|
||||||
|
{
|
||||||
|
public const string Version = "1.0.0";
|
||||||
|
public const string Author = "NotAKidoS";
|
||||||
|
}
|
14
WindowFocusCheckFix/README.md
Normal file
14
WindowFocusCheckFix/README.md
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# WindowFocusCheckFix
|
||||||
|
|
||||||
|
Fixes window focus check on specific Linux distribution. ????!??!?!
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Here is the block of text where I tell you this mod is not affiliated with or endorsed by ABI.
|
||||||
|
https://documentation.abinteractive.net/official/legal/tos/#7-modding-our-games
|
||||||
|
|
||||||
|
> This mod is an independent creation not affiliated with, supported by, or approved by Alpha Blend Interactive.
|
||||||
|
|
||||||
|
> Use of this mod is done so at the user's own risk and the creator cannot be held responsible for any issues arising from its use.
|
||||||
|
|
||||||
|
> To the best of my knowledge, I have adhered to the Modding Guidelines established by Alpha Blend Interactive.
|
6
WindowFocusCheckFix/WindowFocusCheckFix.csproj
Normal file
6
WindowFocusCheckFix/WindowFocusCheckFix.csproj
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<PropertyGroup>
|
||||||
|
<RootNamespace>YouAreMineNow</RootNamespace>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
23
WindowFocusCheckFix/format.json
Normal file
23
WindowFocusCheckFix/format.json
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
"_id": -1,
|
||||||
|
"name": "WindowFocusCheckFix",
|
||||||
|
"modversion": "1.0.0",
|
||||||
|
"gameversion": "2025r179",
|
||||||
|
"loaderversion": "0.6.1",
|
||||||
|
"modtype": "Mod",
|
||||||
|
"author": "NotAKidoS",
|
||||||
|
"description": "Fixes window focus check on specific Linux distribution. ????!??!?!\n",
|
||||||
|
"searchtags": [
|
||||||
|
"prop",
|
||||||
|
"spawn",
|
||||||
|
"friend",
|
||||||
|
"load"
|
||||||
|
],
|
||||||
|
"requirements": [
|
||||||
|
"None"
|
||||||
|
],
|
||||||
|
"downloadlink": "https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r46/WindowFocusCheckFix.dll",
|
||||||
|
"sourcelink": "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/WindowFocusCheckFix/",
|
||||||
|
"changelog": "- Initial Release",
|
||||||
|
"embedcolor": "#00FFFF"
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue