mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2026-02-04 09:06:10 +00:00
mass commit of laziness
This commit is contained in:
parent
ce992c70ee
commit
6d4fc549d9
167 changed files with 5471 additions and 675 deletions
|
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk" />
|
||||
89
.Experimental/ByeByePerformanceThankYouAMD/Main.cs
Normal file
89
.Experimental/ByeByePerformanceThankYouAMD/Main.cs
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
using System.Collections;
|
||||
using ABI_RC.Core;
|
||||
using ABI_RC.Core.IO;
|
||||
using ABI_RC.Core.Util.Encryption;
|
||||
using ABI_RC.Systems.GameEventSystem;
|
||||
using HarmonyLib;
|
||||
using MelonLoader;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NAK.ByeByePerformanceThankYouAMD;
|
||||
|
||||
public class ByeByePerformanceThankYouAMDMod : MelonMod
|
||||
{
|
||||
private static MelonLogger.Instance Logger;
|
||||
|
||||
private static readonly MelonPreferences_Category Category =
|
||||
MelonPreferences.CreateCategory(nameof(ByeByePerformanceThankYouAMD));
|
||||
|
||||
private static readonly MelonPreferences_Entry<bool> EntryDisableMaterialInstancing =
|
||||
Category.CreateEntry(
|
||||
identifier: "disable_material_instancing",
|
||||
true,
|
||||
display_name: "Disable Material Instancing",
|
||||
description: "Disables material instancing to mitigate a shit visual issue on AMD");
|
||||
|
||||
public override void OnInitializeMelon()
|
||||
{
|
||||
Logger = LoggerInstance;
|
||||
ApplyPatches(typeof(CVREncryptionRouter_Patches));
|
||||
}
|
||||
|
||||
private void ApplyPatches(Type type)
|
||||
{
|
||||
try
|
||||
{
|
||||
HarmonyInstance.PatchAll(type);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LoggerInstance.Msg($"Failed while patching {type.Name}!");
|
||||
LoggerInstance.Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
internal static void ScanForInstancedMaterials()
|
||||
{
|
||||
if (!EntryDisableMaterialInstancing.Value)
|
||||
return;
|
||||
|
||||
Logger.Msg("An Asset Bundle has loaded, scanning for instanced materials to disable...");
|
||||
|
||||
if (Resources.FindObjectsOfTypeAll(typeof(Material)) is not Material[] allMaterials)
|
||||
{
|
||||
Logger.Msg("No materials found.");
|
||||
return;
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
foreach (Material material in allMaterials)
|
||||
{
|
||||
if (!material || !material.enableInstancing) continue;
|
||||
material.enableInstancing = false;
|
||||
count++;
|
||||
}
|
||||
|
||||
Logger.Msg($"Finished scanning for instanced materials. Disabled instancing on {count} loaded materials.");
|
||||
}
|
||||
}
|
||||
|
||||
internal static class CVREncryptionRouter_Patches
|
||||
{
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(CVREncryptionRouter), nameof(CVREncryptionRouter.LoadEncryptedBundle), typeof(bool))]
|
||||
private static void CVREncryptionRouter_LoadEncryptedBundle_Postfix(ref IEnumerator __result)
|
||||
{
|
||||
__result = Wrapper(__result);
|
||||
}
|
||||
|
||||
private static IEnumerator Wrapper(IEnumerator inner)
|
||||
{
|
||||
yield return null; // before start
|
||||
|
||||
while (inner.MoveNext())
|
||||
yield return inner.Current;
|
||||
|
||||
// after finish
|
||||
ByeByePerformanceThankYouAMDMod.ScanForInstancedMaterials();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
using MelonLoader;
|
||||
using NAK.ByeByePerformanceThankYouAMD.Properties;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
|
||||
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
|
||||
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
|
||||
[assembly: AssemblyTitle(nameof(NAK.ByeByePerformanceThankYouAMD))]
|
||||
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
|
||||
[assembly: AssemblyProduct(nameof(NAK.ByeByePerformanceThankYouAMD))]
|
||||
|
||||
[assembly: MelonInfo(
|
||||
typeof(NAK.ByeByePerformanceThankYouAMD.ByeByePerformanceThankYouAMDMod),
|
||||
nameof(NAK.ByeByePerformanceThankYouAMD),
|
||||
AssemblyInfoParams.Version,
|
||||
AssemblyInfoParams.Author,
|
||||
downloadLink: "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/ByeByePerformanceThankYouAMD"
|
||||
)]
|
||||
|
||||
[assembly: MelonGame("ChilloutVR", "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.ByeByePerformanceThankYouAMD.Properties;
|
||||
internal static class AssemblyInfoParams
|
||||
{
|
||||
public const string Version = "1.0.0";
|
||||
public const string Author = "NotAKidoS";
|
||||
}
|
||||
14
.Experimental/ByeByePerformanceThankYouAMD/README.md
Normal file
14
.Experimental/ByeByePerformanceThankYouAMD/README.md
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# SearchWithSpacesFix
|
||||
|
||||
Fixes search terms that use spaces.
|
||||
|
||||
---
|
||||
|
||||
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.
|
||||
23
.Experimental/ByeByePerformanceThankYouAMD/format.json
Normal file
23
.Experimental/ByeByePerformanceThankYouAMD/format.json
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"_id": -1,
|
||||
"name": "SearchWithSpacesFix",
|
||||
"modversion": "1.0.0",
|
||||
"gameversion": "2024r177",
|
||||
"loaderversion": "0.6.1",
|
||||
"modtype": "Mod",
|
||||
"author": "NotAKidoS",
|
||||
"description": "Fixes search terms that include spaces.",
|
||||
"searchtags": [
|
||||
"search",
|
||||
"spaces",
|
||||
"fix",
|
||||
"meow"
|
||||
],
|
||||
"requirements": [
|
||||
"None"
|
||||
],
|
||||
"downloadlink": "https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r42/SearchWithSpacesFix.dll",
|
||||
"sourcelink": "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/SearchWithSpacesFix/",
|
||||
"changelog": "- Initial release",
|
||||
"embedcolor": "#f61963"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue