mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
stickers
This commit is contained in:
parent
61f1a884d2
commit
475593bc1d
25 changed files with 2172 additions and 0 deletions
33
Stickers/Patches.cs
Normal file
33
Stickers/Patches.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using ABI_RC.Core.InteractionSystem;
|
||||
using ABI_RC.Core.Player;
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NAK.Stickers.Patches;
|
||||
|
||||
internal static class PlayerSetupPatches
|
||||
{
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(PlayerSetup), nameof(PlayerSetup.GetCurrentPropSelectionMode))]
|
||||
private static void Postfix_PlayerSetup_GetCurrentPropSelectionMode(ref PlayerSetup.PropSelectionMode __result)
|
||||
{
|
||||
if (StickerSystem.Instance.IsInStickerMode) __result = (PlayerSetup.PropSelectionMode)4;
|
||||
}
|
||||
}
|
||||
|
||||
internal static class ControllerRayPatches
|
||||
{
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ControllerRay), nameof(ControllerRay.HandlePropSpawn))]
|
||||
private static void Prefix_ControllerRay_HandlePropSpawn(ref ControllerRay __instance)
|
||||
{
|
||||
if (!StickerSystem.Instance.IsInStickerMode)
|
||||
return;
|
||||
|
||||
if (__instance._gripDown) StickerSystem.Instance.IsInStickerMode = false;
|
||||
if (__instance._hitUIInternal || !__instance._interactDown)
|
||||
return;
|
||||
|
||||
StickerSystem.Instance.PlaceStickerFromTransform(__instance.rayDirectionTransform);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue