maybe fixed static buttons

This commit is contained in:
Aaro Varis
2025-03-24 17:27:46 +02:00
parent 77a6101e08
commit e29f0ebb70
5 changed files with 11 additions and 8 deletions

View File

@@ -10,7 +10,6 @@ using StressLevelZero.Rig;
using StressLevelZero.VRMK;
using UnhollowerBaseLib;
using UnityEngine;
using StressLevelZero.Player;
namespace BoneSync.Data
{

View File

@@ -12,7 +12,8 @@ using StressLevelZero.Interaction;
namespace BoneSync.Patching
{
// Credit: Entanglement, this patch is based on the one from Entanglement
// Credit: Entanglement
// this patch is based on the one from Entanglement
[HarmonyPatch(typeof(ForcePullGrip), nameof(ForcePullGrip.OnFarHandHoverUpdate))]
public class ForcePullPatch
{

View File

@@ -142,7 +142,6 @@ namespace BoneSync.Sync.Components
private SpawnFragment spawnFragment;
public bool IsStatic() => rigidbodies.Length == 0;
private void CheckAutoSync()
{
if (!isValid) return;
@@ -182,7 +181,7 @@ namespace BoneSync.Sync.Components
if (poolee && poolee.pool) {
return true;
}
if (IsStatic() && buttonToggles.Length != 0) return true;
if (buttonToggles.Length > 0) return true;
return false;
}
@@ -198,6 +197,10 @@ namespace BoneSync.Sync.Components
{
return transform.GetPath();
}
if (rigidbodies?.Length == 0 && buttonToggles?.Length > 0)
{
return transform.GetPath();
}
return "";
}
@@ -256,8 +259,8 @@ namespace BoneSync.Sync.Components
if (spawnFragment) return false; // if has spawn fragment, don't sync
FindAndUpdateComponents();
if (buttonToggles.Length > 0) return true;
if (rigidbodies.Length > 0) return true;
if (buttonToggles?.Length > 0) return true;
if (rigidbodies?.Length > 0) return true;
return false;
}

View File

@@ -94,6 +94,7 @@ namespace BoneSync.Sync.Components
public void EjectAllPlugs(bool force = false)
{
if (plugs == null) return;
foreach (AlignPlug plug in plugs)
{
if (plug == null) continue;

View File

@@ -47,8 +47,7 @@ namespace BoneSync.Sync.Components
magazine.magazineData.cartridgeType = magazineData.cartridgeType;
magazine.magazineData.weight = magazineData.weight;
magazine.magazineData.platform = magazineData.platform;
//magazine.CheckBulletArt();
//magazine.ShowBulletArt();
magazine.firstBullet?.SetActive(magazineData.AmmoSlots.Count > 0);
}
public MagazineSyncData GetMagazineData()