initial upload

This commit is contained in:
NotAKidoS 2022-09-10 05:29:42 -05:00
parent e994a28046
commit 7332bc73b5
7 changed files with 220 additions and 0 deletions

21
LICENSE Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 NotAKidoS
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

48
MenuScalePatch/Main.cs Normal file
View file

@ -0,0 +1,48 @@
using ABI_RC.Core.InteractionSystem;
using ABI_RC.Core.Player;
using ABI_RC.Core.Savior;
using cohtml;
using HarmonyLib;
using MelonLoader;
using UnityEngine;
namespace MenuScalePatch;
public class MenuScalePatch : MelonMod
{
[HarmonyPatch]
private class HarmonyPatches
{
[HarmonyPostfix]
[HarmonyPatch(typeof(CVR_MenuManager), "SetScale")]
private static void SetQMScale(ref CohtmlView ___quickMenu, ref float ____scaleFactor)
{
//correct quickmenu - pretty much needsQuickmenuPositionUpdate()
Transform rotationPivot = PlayerSetup.Instance._movementSystem.rotationPivot;
___quickMenu.transform.eulerAngles = new Vector3(rotationPivot.eulerAngles.x, rotationPivot.eulerAngles.y, rotationPivot.eulerAngles.z);
___quickMenu.transform.position = rotationPivot.position + rotationPivot.forward * 1f * ____scaleFactor;
}
//ViewManager.SetScale runs once a second when it should only run when aspect ratio changes...? bug
[HarmonyPostfix]
[HarmonyPatch(typeof(ViewManager), "SetScale")]
private static void SetMMScale(ref ViewManager __instance, ref bool ___needsMenuPositionUpdate, ref float ___scaleFactor, ref float ___cachedScreenAspectRatio, ref float ___cachedAvatarHeight)
{
//correct main menu - pretty much UpdateMenuPosition()
Transform rotationPivot = PlayerSetup.Instance._movementSystem.rotationPivot;
float num = Mathf.Abs(rotationPivot.localRotation.eulerAngles.z);
float settingsFloat = MetaPort.Instance.settings.GetSettingsFloat("GeneralMinimumMenuTilt");
if (MetaPort.Instance.isUsingVr && (num <= settingsFloat || num >= 360f - settingsFloat))
{
__instance.gameObject.transform.rotation = Quaternion.LookRotation(rotationPivot.forward, Vector3.up);
}
else
{
__instance.gameObject.transform.eulerAngles = new Vector3(rotationPivot.eulerAngles.x, rotationPivot.eulerAngles.y, rotationPivot.eulerAngles.z);
}
__instance.gameObject.transform.position = rotationPivot.position + rotationPivot.forward * 1f * ___scaleFactor;
___needsMenuPositionUpdate = false;
}
}
}

View file

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\ChilloutVR\MelonLoader\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Cohtml.Runtime">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\Cohtml.Runtime.dll</HintPath>
</Reference>
<Reference Include="MelonLoader">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\ChilloutVR\MelonLoader\MelonLoader.dll</HintPath>
</Reference>
<Reference Include="SteamVR">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\SteamVR.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.InputLegacyModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.PhysicsModule">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.PhysicsModule.dll</HintPath>
</Reference>
</ItemGroup>
<Target Name="Deploy" AfterTargets="Build">
<Copy SourceFiles="$(TargetPath)" DestinationFolder="C:\Program Files (x86)\Steam\steamapps\common\ChilloutVR\Mods\" />
<Message Text="Copied $(TargetPath) to C:\Program Files (x86)\Steam\steamapps\common\ChilloutVR\Mods\" Importance="high" />
</Target>
</Project>

View file

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.2.32630.192
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvatarScaleUpdater", "AvatarScaleUpdater.csproj", "{1B069D34-0AD6-43A4-A116-C325F37D33A6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1B069D34-0AD6-43A4-A116-C325F37D33A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1B069D34-0AD6-43A4-A116-C325F37D33A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1B069D34-0AD6-43A4-A116-C325F37D33A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1B069D34-0AD6-43A4-A116-C325F37D33A6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {67335521-EBA9-453E-A0E2-3DE0E3A86EBF}
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,30 @@
using MelonLoader;
using MenuScalePatch.Properties;
using System.Reflection;
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyTitle(nameof(MenuScalePatch))]
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
[assembly: AssemblyProduct(nameof(MenuScalePatch))]
[assembly: MelonInfo(
typeof(MenuScalePatch.MenuScalePatch),
nameof(MenuScalePatch),
AssemblyInfoParams.Version,
AssemblyInfoParams.Author,
downloadLink: "https://github.com/NotAKidOnSteam/MenuScalePatch"
)]
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
namespace MenuScalePatch.Properties;
internal static class AssemblyInfoParams
{
public const string Version = "1.0.0";
public const string Author = "NotAKidoS";
}

View file

@ -0,0 +1,23 @@
{
"_id": -1,
"name": "MenuScalePatch",
"modversion": "1.0.0",
"gameversion": "2022r168",
"loaderversion": "0.5.4",
"modtype": "Mod",
"author": "NotAKidoS",
"description": "Corrects MM and QM position when avatar is scaled.",
"searchtags": [
"menu",
"scale",
"avatarscale",
"slider"
],
"requirements": [
"None"
],
"downloadlink": "https://github.com/NotAKidOnSteam/MenuScalePatch/releases/download/r1/MenuScalePatch.dll",
"sourcelink": "https://github.com/NotAKidOnSteam/MenuScalePatch/",
"changelog": "Initial Release.",
"embedcolor": "804221"
}

30
README.md Normal file
View file

@ -0,0 +1,30 @@
# MenuScalePatch
just updates the menu position when the game detects a change in avatar scale
im sure itll be patched officially before cvrmg verifies it lol
---
Here is the block of text where I tell you this mod is not affiliated or endorsed by ABI.
https://documentation.abinteractive.net/official/legal/tos/#7-modding-our-games
> I am not affiliated with ABI in any official capacity, these mods are not endorsed or outright permitted by ABI and are subject to scrutiny.
> Neither I nor these mods are in any way affiliated with Alpha Blend Interactive and/or ChilloutVR. Using these modifications might cause issues with the performance, security or stability of the game. Use at your own risk.
> Any modifications that are not approved can get your ABI account terminated and such this modification is following the "modding guidelines" at the best it could be.
> They reserve the right to punish users using my mod.
> If you are scared of using modifications in your game do not install mods.
> I do not affiliate ABI and the mod is not supported by ABI.
> Me and this modification are in no affiliation with ABI and not supported by ABI.
> This mod is not affiliated with Alpha Blend Interactive. The mod comes with no warranty. Use at your own risk, as I am not responsible for any misuse.
> I'm not affiliated with Alpha Blend Interactive and this mod is not officially supported by the game.
> When releasing mods to the public, it is required to state, that the mod authors and modification are in no affiliation with ABI and not supported by ABI. :trollface:
> i ran out of places to steal disclaimers from