[WindowFocusCheckFix] iniyial push

This commit is contained in:
NotAKidoS 2025-04-12 04:05:48 -05:00
parent a6fa59d24c
commit 1f99312c22
5 changed files with 114 additions and 0 deletions

View 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
}

View 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";
}

View 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.

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>YouAreMineNow</RootNamespace>
</PropertyGroup>
</Project>

View 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"
}