using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using System.Text;
using FistVR;
using HarmonyLib;
using LSIIC.Core;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
using Valve.VR;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace LSIIC
{
public class MeatTrak : MonoBehaviour
{
public float NumberTarget;
public float NumberDisplay;
public char BlankChar;
public bool UseWideCharacters;
public GameObject[] Displays;
[Header("Use ASCII for these!")]
public Sprite[] DefaultCharacters;
public Sprite[] WideCharacters;
private Texture2D[] m_defaultTextures;
private Texture2D[] m_wideTextures;
private bool m_hasStarted;
public void Awake()
{
if (m_hasStarted)
{
InitDisplay();
}
}
public void InitDisplay()
{
m_defaultTextures = (Texture2D[])(object)new Texture2D[DefaultCharacters.Length];
for (int i = 0; i < DefaultCharacters.Length; i++)
{
m_defaultTextures[i] = ConvertSpriteToTexture(DefaultCharacters[i]);
}
m_wideTextures = (Texture2D[])(object)new Texture2D[WideCharacters.Length];
for (int j = 0; j < WideCharacters.Length; j++)
{
m_wideTextures[j] = ConvertSpriteToTexture(WideCharacters[j]);
}
NumberDisplay = NumberTarget;
SetDisplays(NumberTarget);
}
public static Texture2D ConvertSpriteToTexture(Sprite sprite)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Expected O, but got Unknown
if ((Object)(object)sprite != (Object)null)
{
Rect val = sprite.rect;
int num = (int)((Rect)(ref val)).width;
val = sprite.rect;
Texture2D val2 = new Texture2D(num, (int)((Rect)(ref val)).height);
Texture2D texture = sprite.texture;
val = sprite.textureRect;
int num2 = (int)((Rect)(ref val)).x;
val = sprite.textureRect;
int num3 = (int)((Rect)(ref val)).y;
val = sprite.textureRect;
int num4 = (int)((Rect)(ref val)).width;
val = sprite.textureRect;
Color[] pixels = texture.GetPixels(num2, num3, num4, (int)((Rect)(ref val)).height);
((Texture)val2).filterMode = (FilterMode)0;
val2.SetPixels(pixels);
val2.Apply();
return val2;
}
return null;
}
public void Update()
{
if (NumberDisplay != NumberTarget)
{
if (NumberDisplay < NumberTarget)
{
NumberDisplay += 1f;
}
else
{
NumberDisplay -= 1f;
}
SetDisplays(NumberDisplay);
}
}
public void SetDisplays(float number)
{
char[] array = number.ToString().ToCharArray();
Array.Reverse((Array)array);
for (int i = 0; i < Displays.Length; i++)
{
if (i < array.Length)
{
if (!UseWideCharacters && DefaultCharacters != null && DefaultCharacters.Length != 0)
{
((Renderer)Displays[i].GetComponent<MeshRenderer>()).material.mainTexture = (Texture)(object)m_defaultTextures[(uint)array[i]];
}
else if (WideCharacters != null && WideCharacters.Length != 0)
{
((Renderer)Displays[i].GetComponent<MeshRenderer>()).material.mainTexture = (Texture)(object)m_wideTextures[(uint)array[i]];
}
}
else if (!UseWideCharacters && DefaultCharacters != null && DefaultCharacters.Length != 0)
{
((Renderer)Displays[i].GetComponent<MeshRenderer>()).material.mainTexture = (Texture)(object)m_defaultTextures[(uint)BlankChar];
}
else if (WideCharacters != null && WideCharacters.Length != 0)
{
((Renderer)Displays[i].GetComponent<MeshRenderer>()).material.mainTexture = (Texture)(object)m_wideTextures[(uint)BlankChar];
}
}
}
}
public class MeatTrakAttachment : FVRFireArmAttachment
{
public void Awake()
{
((FVRFireArmAttachment)this).Awake();
MeatTrakAttachmentInterface meatTrakAttachmentInterface = base.AttachmentInterface as MeatTrakAttachmentInterface;
if ((Object)(object)meatTrakAttachmentInterface != (Object)null && (Object)(object)meatTrakAttachmentInterface.MeatTrak != (Object)null)
{
meatTrakAttachmentInterface.InitInterface();
meatTrakAttachmentInterface.MeatTrak.InitDisplay();
}
}
public override void ConfigureFromFlagDic(Dictionary<string, string> f)
{
if (f == null)
{
return;
}
MeatTrakAttachmentInterface meatTrakAttachmentInterface = base.AttachmentInterface as MeatTrakAttachmentInterface;
if ((Object)(object)meatTrakAttachmentInterface != (Object)null)
{
meatTrakAttachmentInterface.TrackingMode = (MeatTrakAttachmentInterface.TrackingModes)Enum.Parse(typeof(MeatTrakAttachmentInterface.TrackingModes), f["TrackingMode"]);
meatTrakAttachmentInterface.UpdateMode();
if ((Object)(object)meatTrakAttachmentInterface.MeatTrak != (Object)null)
{
meatTrakAttachmentInterface.MeatTrak.NumberTarget = float.Parse(f["NumberTarget"]);
meatTrakAttachmentInterface.MeatTrak.NumberDisplay = meatTrakAttachmentInterface.MeatTrak.NumberTarget;
}
}
}
public override Dictionary<string, string> GetFlagDic()
{
Dictionary<string, string> dictionary = new Dictionary<string, string>();
MeatTrakAttachmentInterface meatTrakAttachmentInterface = base.AttachmentInterface as MeatTrakAttachmentInterface;
if ((Object)(object)meatTrakAttachmentInterface != (Object)null)
{
dictionary.Add("TrackingMode", meatTrakAttachmentInterface.TrackingMode.ToString());
if ((Object)(object)meatTrakAttachmentInterface.MeatTrak != (Object)null)
{
dictionary.Add("NumberTarget", meatTrakAttachmentInterface.MeatTrak.NumberTarget.ToString());
}
}
return dictionary;
}
}
public class MeatTrakAttachmentInterface : FVRFireArmAttachmentInterface
{
public enum TrackingModes
{
None,
Kills,
Shots,
Reloads,
Bullets
}
[Header("MeatTrak Interface")]
public MeatTrak MeatTrak;
public TrackingModes TrackingMode;
public Sprite[] ModeSprites;
public Renderer ModeDiplayRenderer;
public AudioEvent Aud_ModeSwitch;
public AudioEvent Aud_ClearRequestConfirmation;
public AudioEvent Aud_ClearComplete;
private bool m_waitingForConfirmation;
private Texture2D[] m_modeTextures;
public void InitInterface()
{
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Expected O, but got Unknown
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Expected O, but got Unknown
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: Expected O, but got Unknown
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Expected O, but got Unknown
m_modeTextures = (Texture2D[])(object)new Texture2D[ModeSprites.Length];
for (int i = 0; i < ModeSprites.Length; i++)
{
m_modeTextures[i] = MeatTrak.ConvertSpriteToTexture(ModeSprites[i]);
}
UpdateMode();
GM.CurrentSceneSettings.KillEvent += new BotKill(wwBotKillEvent);
GM.CurrentSceneSettings.SosigKillEvent += new SosigKill(SosigKillEvent);
GM.CurrentSceneSettings.ShotFiredEvent += new ShotFired(ShotFiredEvent);
GM.CurrentSceneSettings.FireArmReloadedEvent += new FireArmReloaded(FireArmReloadedEvent);
}
public void Update()
{
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Expected O, but got Unknown
if (TrackingMode == TrackingModes.Bullets && (Object)(object)base.Attachment != (Object)null && (Object)(object)base.Attachment.GetRootObject() != (Object)null && base.Attachment.GetRootObject() is FVRFireArm)
{
UpdateBulletMode((FVRFireArm)base.Attachment.GetRootObject());
}
}
public void OnDestroy()
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Expected O, but got Unknown
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Expected O, but got Unknown
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Expected O, but got Unknown
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Expected O, but got Unknown
GM.CurrentSceneSettings.KillEvent -= new BotKill(wwBotKillEvent);
GM.CurrentSceneSettings.SosigKillEvent -= new SosigKill(SosigKillEvent);
GM.CurrentSceneSettings.ShotFiredEvent -= new ShotFired(ShotFiredEvent);
GM.CurrentSceneSettings.FireArmReloadedEvent -= new FireArmReloaded(FireArmReloadedEvent);
((FVRInteractiveObject)this).OnDestroy();
}
public override void OnAttach()
{
((FVRFireArmAttachmentInterface)this).OnAttach();
if ((Object)(object)base.Attachment != (Object)null && (Object)(object)base.Attachment.GetRootObject() != (Object)null && base.Attachment.GetRootObject() is FVRFireArm && (Object)(object)MeatTrak != (Object)null && MeatTrak.NumberTarget == 0f && TrackingMode == TrackingModes.None)
{
TrackingMode = TrackingModes.Bullets;
UpdateMode();
}
}
public override void UpdateInteraction(FVRViveHand hand)
{
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_0115: Unknown result type (might be due to invalid IL or missing references)
//IL_0179: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
((FVRFireArmAttachmentInterface)this).UpdateInteraction(hand);
if (!hand.Input.TouchpadDown || !(((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.25f) || !((Object)(object)MeatTrak != (Object)null))
{
return;
}
Vector2 touchpadAxes = hand.Input.TouchpadAxes;
if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.up) <= 45f)
{
if (m_waitingForConfirmation)
{
MeatTrak.NumberTarget = 0f;
if (Aud_ClearComplete.Clips.Count > 0)
{
SM.PlayCoreSound((FVRPooledAudioType)20, Aud_ClearComplete, ((Component)this).transform.position);
}
}
else if (Aud_ClearRequestConfirmation.Clips.Count > 0)
{
SM.PlayCoreSound((FVRPooledAudioType)20, Aud_ClearRequestConfirmation, ((Component)this).transform.position);
}
m_waitingForConfirmation = !m_waitingForConfirmation;
}
if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.left) <= 45f || Vector2.Angle(hand.Input.TouchpadAxes, Vector2.right) <= 45f)
{
int num = (int)Mathf.Sign(touchpadAxes.x);
TrackingMode = (TrackingModes)Mathf.Repeat((float)TrackingMode + (float)num, (float)ModeSprites.Length);
UpdateMode();
if (Aud_ModeSwitch.Clips.Count > 0)
{
SM.PlayCoreSound((FVRPooledAudioType)20, Aud_ModeSwitch, ((Component)this).transform.position);
}
}
}
public override void EndInteraction(FVRViveHand hand)
{
((FVRInteractiveObject)this).EndInteraction(hand);
m_waitingForConfirmation = false;
}
[ContextMenu("UpdateMode")]
public void UpdateMode()
{
if ((Object)(object)ModeDiplayRenderer != (Object)null && ModeDiplayRenderer.materials.Length <= 2 && m_modeTextures.Length != 0 && m_modeTextures.Length >= (int)TrackingMode)
{
ModeDiplayRenderer.materials[1].SetTexture("_MainTex", (Texture)(object)m_modeTextures[(int)TrackingMode]);
}
}
private void FireArmReloadedEvent(FVRObject obj)
{
if (!((Object)(object)obj == (Object)null) && (Object)(object)base.Attachment != (Object)null && (Object)(object)base.Attachment.GetRootObject() != (Object)null && (Object)(object)base.Attachment.GetRootObject().ObjectWrapper == (Object)(object)obj && (Object)(object)MeatTrak != (Object)null && TrackingMode == TrackingModes.Reloads)
{
MeatTrak.NumberTarget += 1f;
}
}
private void ShotFiredEvent(FVRFireArm firearm)
{
if (!((Object)(object)firearm == (Object)null) && (Object)(object)base.Attachment != (Object)null && (Object)(object)base.Attachment.GetRootObject() != (Object)null && (Object)(object)base.Attachment.GetRootObject() == (Object)(object)firearm)
{
if ((Object)(object)MeatTrak != (Object)null && TrackingMode == TrackingModes.Shots)
{
MeatTrak.NumberTarget += 1f;
}
else if (TrackingMode == TrackingModes.Bullets)
{
UpdateBulletMode(firearm);
}
}
}
private void SosigKillEvent(Sosig sosig)
{
if (!((Object)(object)sosig == (Object)null) && (Object)(object)base.Attachment != (Object)null && (Object)(object)base.Attachment.GetRootObject() != (Object)null && base.Attachment.GetRootObject() is FVRFireArm && (Object)(object)((FVRInteractiveObject)base.Attachment.GetRootObject()).m_hand != (Object)null && sosig.E.IFFCode != sosig.GetDiedFromIFF() && (Object)(object)MeatTrak != (Object)null && TrackingMode == TrackingModes.Kills)
{
MeatTrak.NumberTarget += 1f;
}
}
private void wwBotKillEvent(Damage dam)
{
if (dam != null && (Object)(object)base.Attachment != (Object)null && (Object)(object)base.Attachment.GetRootObject() != (Object)null && base.Attachment.GetRootObject() is FVRFireArm && (Object)(object)((FVRInteractiveObject)base.Attachment.GetRootObject()).m_hand != (Object)null && dam.Source_IFF == GM.CurrentPlayerBody.GetPlayerIFF() && (Object)(object)MeatTrak != (Object)null && TrackingMode == TrackingModes.Kills)
{
MeatTrak.NumberTarget += 1f;
}
}
private void UpdateBulletMode(FVRFireArm firearm)
{
//IL_020d: Unknown result type (might be due to invalid IL or missing references)
//IL_0214: Expected O, but got Unknown
if (!((Object)(object)base.Attachment != (Object)null) || !((Object)(object)base.Attachment.GetRootObject() != (Object)null) || !((Object)(object)base.Attachment.GetRootObject() == (Object)(object)firearm))
{
return;
}
MeatTrak.NumberTarget = 0f;
FVRFireArmMagazine componentInChildren = ((Component)firearm).GetComponentInChildren<FVRFireArmMagazine>();
if ((Object)(object)componentInChildren != (Object)null)
{
MeatTrak.NumberTarget = componentInChildren.m_numRounds;
}
FVRFireArmClip componentInChildren2 = ((Component)firearm).GetComponentInChildren<FVRFireArmClip>();
if ((Object)(object)componentInChildren2 != (Object)null)
{
MeatTrak.NumberTarget = componentInChildren2.m_numRounds;
}
if (firearm == null)
{
return;
}
if (firearm is BreakActionWeapon)
{
BreakActionWeapon val = (BreakActionWeapon)(object)((firearm is BreakActionWeapon) ? firearm : null);
for (int i = 0; i < val.Barrels.Length; i++)
{
if (val.Barrels[i].Chamber.IsFull && !val.Barrels[i].Chamber.IsSpent)
{
MeatTrak.NumberTarget += 1f;
}
}
}
else if (firearm is Derringer)
{
Derringer val2 = (Derringer)(object)((firearm is Derringer) ? firearm : null);
for (int j = 0; j < val2.Barrels.Count; j++)
{
if (val2.Barrels[j].Chamber.IsFull && !val2.Barrels[j].Chamber.IsSpent)
{
MeatTrak.NumberTarget += 1f;
}
}
}
else if (firearm is SingleActionRevolver)
{
SingleActionRevolver val3 = (SingleActionRevolver)(object)((firearm is SingleActionRevolver) ? firearm : null);
for (int k = 0; k < val3.Cylinder.Chambers.Length; k++)
{
if (val3.Cylinder.Chambers[k].IsFull && !val3.Cylinder.Chambers[k].IsSpent)
{
MeatTrak.NumberTarget += 1f;
}
}
}
if ((object)((object)firearm).GetType().GetField("Chamber") != null)
{
FVRFireArmChamber val4 = (FVRFireArmChamber)((object)firearm).GetType().GetField("Chamber").GetValue(firearm);
if (val4.IsFull && !val4.IsSpent)
{
MeatTrak.NumberTarget += 1f;
}
}
if ((object)((object)firearm).GetType().GetField("Chambers") == null)
{
return;
}
FVRFireArmChamber[] array = (FVRFireArmChamber[])((object)firearm).GetType().GetField("Chambers").GetValue(firearm);
for (int l = 0; l < array.Length; l++)
{
if (array[l].IsFull && !array[l].IsSpent)
{
MeatTrak.NumberTarget += 1f;
}
}
}
}
public class PortableGrabPoint : FVRPhysicalObject
{
[Header("PortableGrabPoint")]
public FVRHandGrabPoint GrabPoint;
public Renderer GeoRenderer;
[ColorUsage(false, true, 0f, 8f, 0.125f, 3f)]
public Color RingColorInactive = Color.black;
[ColorUsage(false, true, 0f, 8f, 0.125f, 3f)]
public Color RingColorActive = Color.white;
private FVRViveHand m_lastHand;
private bool m_grabPointActive;
private float m_timeSincePickup;
public override void BeginInteraction(FVRViveHand hand)
{
((FVRPhysicalObject)this).BeginInteraction(hand);
}
public override void UpdateInteraction(FVRViveHand hand)
{
((FVRPhysicalObject)this).UpdateInteraction(hand);
m_timeSincePickup += Time.deltaTime;
if (m_timeSincePickup >= 0.1f && hand.Input.TouchpadDown && (Object)(object)GrabPoint != (Object)null && !m_grabPointActive)
{
((FVRPhysicalObject)this).SetIsKinematicLocked(true);
hand.ForceSetInteractable((FVRInteractiveObject)(object)GrabPoint);
((FVRInteractiveObject)GrabPoint).BeginInteraction(hand);
m_lastHand = hand;
m_grabPointActive = true;
}
}
public override void FVRUpdate()
{
//IL_010e: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_011f: Unknown result type (might be due to invalid IL or missing references)
((FVRPhysicalObject)this).FVRUpdate();
if ((Object)(object)((FVRPhysicalObject)this).QuickbeltSlot != (Object)null)
{
m_grabPointActive = false;
}
if (m_grabPointActive && (Object)(object)m_lastHand != (Object)null && (Object)(object)m_lastHand.CurrentInteractable != (Object)(object)GrabPoint && (Object)(object)((FVRInteractiveObject)GrabPoint).m_hand == (Object)null && base.IsKinematicLocked)
{
((FVRPhysicalObject)this).SetIsKinematicLocked(false);
if ((Object)(object)m_lastHand != (Object)null)
{
m_lastHand.ForceSetInteractable((FVRInteractiveObject)(object)this);
((FVRInteractiveObject)this).BeginInteraction(m_lastHand);
}
m_grabPointActive = false;
}
if (m_timeSincePickup > 0f && !m_grabPointActive && !((Object)(object)((FVRInteractiveObject)this).m_hand != (Object)null))
{
m_timeSincePickup = Mathf.Clamp(m_timeSincePickup - Time.deltaTime, 0f, 1f);
}
if ((Object)(object)GeoRenderer != (Object)null && (Object)(object)GeoRenderer.material != (Object)null)
{
GeoRenderer.material.SetColor("_EmissionColor", Color.Lerp(RingColorInactive, RingColorActive, m_timeSincePickup));
}
}
}
public class RotateAroundRootAxis : FVRInteractiveObject
{
public enum RotationAxis
{
X,
Y
}
public enum State
{
Min,
Max,
Between
}
[Header("Rotate Around Root Axis")]
public Transform Root;
public Transform ObjectToRotate;
[Header("Axes and Angles")]
public RotationAxis Axis = RotationAxis.Y;
public bool InvertZRoot;
[Tooltip("x = min, y = max")]
public Vector2 RotationLimit;
public Vector3 TargetRotation;
[Range(0f, 360f)]
public float AutoComplete = 5f;
[Tooltip("This might be in rad/s?")]
public float CompletionRate = 6f;
private float m_targetAngle;
[Header("Events")]
public UnityEvent OnCompleteMin;
public UnityEvent OnCompleteMax;
public UnityEvent OnStartedBetween;
public State m_curState;
public State m_prevState;
public void Update()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
Vector3 localEulerAngles = ObjectToRotate.localEulerAngles;
if (localEulerAngles != TargetRotation)
{
ObjectToRotate.localEulerAngles = new Vector3(Mathf.LerpAngle(localEulerAngles.x, TargetRotation.x, Time.deltaTime * CompletionRate), Mathf.LerpAngle(localEulerAngles.y, TargetRotation.y, Time.deltaTime * CompletionRate), Mathf.LerpAngle(localEulerAngles.z, TargetRotation.z, Time.deltaTime * CompletionRate));
}
}
public override void UpdateInteraction(FVRViveHand hand)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0104: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Unknown result type (might be due to invalid IL or missing references)
//IL_0118: Unknown result type (might be due to invalid IL or missing references)
//IL_011d: Unknown result type (might be due to invalid IL or missing references)
//IL_0120: Unknown result type (might be due to invalid IL or missing references)
//IL_0125: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: Unknown result type (might be due to invalid IL or missing references)
//IL_0137: Unknown result type (might be due to invalid IL or missing references)
//IL_013c: Unknown result type (might be due to invalid IL or missing references)
//IL_0145: Unknown result type (might be due to invalid IL or missing references)
//IL_014a: Unknown result type (might be due to invalid IL or missing references)
//IL_014c: Unknown result type (might be due to invalid IL or missing references)
//IL_014e: Unknown result type (might be due to invalid IL or missing references)
//IL_0158: Unknown result type (might be due to invalid IL or missing references)
//IL_015a: Unknown result type (might be due to invalid IL or missing references)
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0214: Unknown result type (might be due to invalid IL or missing references)
//IL_0219: Unknown result type (might be due to invalid IL or missing references)
//IL_023a: Unknown result type (might be due to invalid IL or missing references)
//IL_023f: Unknown result type (might be due to invalid IL or missing references)
((FVRInteractiveObject)this).UpdateInteraction(hand);
Vector3 val2;
if (Axis == RotationAxis.X)
{
Vector3 val = ((Component)hand).transform.position - Root.position;
val2 = Vector3.ProjectOnPlane(val, Root.right);
val = ((Vector3)(ref val2)).normalized;
Vector3 val3 = ObjectToRotate.forward;
if (InvertZRoot)
{
val3 = -ObjectToRotate.forward;
}
float num = Mathf.Atan2(Vector3.Dot(Root.right, Vector3.Cross(val3, val)), Vector3.Dot(val3, val)) * 57.29578f;
num = Mathf.Clamp(num, -10f, 10f);
m_targetAngle += num;
m_targetAngle = Mathf.Clamp(m_targetAngle, RotationLimit.x, RotationLimit.y);
}
else if (Axis == RotationAxis.Y)
{
Vector3 val4 = ((Component)hand).transform.position - Root.position;
val2 = Vector3.ProjectOnPlane(val4, Root.up);
val4 = ((Vector3)(ref val2)).normalized;
Vector3 val5 = -((Component)Root).transform.forward;
m_targetAngle = Mathf.Atan2(Vector3.Dot(Root.up, Vector3.Cross(val5, val4)), Vector3.Dot(val5, val4)) * 57.29578f;
}
if (Mathf.Abs(m_targetAngle - RotationLimit.x) < 3f)
{
m_targetAngle = RotationLimit.x;
}
if (Mathf.Abs(m_targetAngle - RotationLimit.y) < 3f)
{
m_targetAngle = RotationLimit.y;
}
if (!(m_targetAngle >= RotationLimit.x) || !(m_targetAngle <= RotationLimit.y))
{
return;
}
if (Axis == RotationAxis.X)
{
TargetRotation = new Vector3(m_targetAngle, 0f, 0f);
}
else if (Axis == RotationAxis.Y)
{
TargetRotation = new Vector3(0f, m_targetAngle, 0f);
}
float num2 = Mathf.InverseLerp(RotationLimit.x, RotationLimit.y, m_targetAngle);
if (num2 > 1f - AutoComplete / 360f)
{
m_curState = State.Max;
}
else if (num2 < AutoComplete / 360f)
{
m_curState = State.Min;
}
else
{
m_curState = State.Between;
if (m_prevState != State.Between && OnStartedBetween != null)
{
OnStartedBetween.Invoke();
}
}
if (m_curState == State.Min && m_prevState != 0 && OnCompleteMin != null)
{
OnCompleteMin.Invoke();
}
if (m_curState == State.Max && m_prevState != State.Max && OnCompleteMax != null)
{
OnCompleteMax.Invoke();
}
m_prevState = m_curState;
}
}
public class SpectatorCamera : FVRPhysicalObject
{
[Header("Spectator Camera")]
public Camera DisplayCam;
public Camera RenderTargetCam;
public RotateAroundRootAxis Screen;
[Header("Rendering Settings")]
public Material ScreenOn;
public Material ScreenOff;
public Renderer LEDRenderer;
public Color LEDColorOn;
public Color LEDEmissOn;
public Color LEDColorOff;
public Color LEDEmissOff;
[Header("Audio Events")]
public AudioEvent CamOn;
public AudioEvent CamOff;
public AudioEvent FOVChange;
public AudioEvent KinematicToggle;
public bool CameraOn { get; private set; }
public override void BeginInteraction(FVRViveHand hand)
{
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Expected O, but got Unknown
((FVRPhysicalObject)this).BeginInteraction(hand);
if ((object)AccessTools.Field(typeof(FVRSceneSettings), "m_previewCam") != null)
{
Camera val = (Camera)AccessTools.Field(typeof(FVRSceneSettings), "m_previewCam").GetValue(GM.CurrentSceneSettings);
if ((Object)(object)ScreenOn != (Object)null && (Object)(object)val != (Object)null)
{
ScreenOn.SetTexture("_MainTex", (Texture)(object)val.targetTexture);
}
}
}
public override void UpdateInteraction(FVRViveHand hand)
{
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0129: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Unknown result type (might be due to invalid IL or missing references)
//IL_0118: Unknown result type (might be due to invalid IL or missing references)
//IL_018a: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
((FVRPhysicalObject)this).UpdateInteraction(hand);
if (!hand.Input.TouchpadDown || !(((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.25f))
{
return;
}
Vector2 touchpadAxes = hand.Input.TouchpadAxes;
if (Vector2.Angle(touchpadAxes, Vector2.down) <= 45f)
{
((FVRPhysicalObject)this).ToggleKinematicLocked();
if (KinematicToggle.Clips.Count > 0)
{
SM.PlayCoreSound((FVRPooledAudioType)20, KinematicToggle, ((Component)this).transform.position);
}
}
if (!((Object)(object)DisplayCam != (Object)null))
{
return;
}
if (Vector2.Angle(touchpadAxes, Vector2.up) <= 45f)
{
ToggleCameraState();
if ((Object)(object)Screen != (Object)null)
{
Screen.TargetRotation = new Vector3(0f, CameraOn ? 0f : (-90f), 0f);
}
}
if (CameraOn && (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.left) <= 45f || Vector2.Angle(hand.Input.TouchpadAxes, Vector2.right) <= 45f))
{
int num = (int)Mathf.Sign(touchpadAxes.x) * 10;
GM.Options.ControlOptions.CamFOV = Mathf.Clamp(GM.Options.ControlOptions.CamFOV + (float)num, 10f, 180f);
if (FOVChange.Clips.Count > 0)
{
SM.PlayCoreSound((FVRPooledAudioType)20, FOVChange, ((Component)this).transform.position);
}
}
}
public override void FVRUpdate()
{
((FVRPhysicalObject)this).FVRUpdate();
if (CameraOn && (Object)(object)GM.CurrentSceneSettings.GetCamObjectPoint() != (Object)(object)((Component)DisplayCam).transform)
{
UpdateCameraState(isOn: false);
}
}
[ContextMenu("Toggle Camera")]
public void ToggleCameraState()
{
UpdateCameraState(!CameraOn);
if (!CameraOn && (Object)(object)GM.CurrentSceneSettings.GetCamObjectPoint() == (Object)(object)((Component)DisplayCam).transform)
{
GM.CurrentSceneSettings.SetCamObjectPoint((Transform)null);
}
}
public void UpdateCameraState(bool isOn)
{
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_016f: Unknown result type (might be due to invalid IL or missing references)
//IL_0141: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
((Component)DisplayCam).gameObject.SetActive(isOn);
if (isOn)
{
if (Object.op_Implicit((Object)(object)DisplayCam))
{
GM.CurrentSceneSettings.SetCamObjectPoint(((Component)DisplayCam).transform);
}
GM.Options.ControlOptions.PCamMode = (PreviewCamMode)1;
}
if ((Object)(object)LEDRenderer != (Object)null)
{
LEDRenderer.material.SetColor("_Color", isOn ? LEDColorOn : LEDColorOff);
LEDRenderer.material.SetColor("_EmissionColor", isOn ? LEDEmissOn : LEDEmissOff);
}
if ((Object)(object)Screen != (Object)null)
{
Screen.TargetRotation = new Vector3(0f, isOn ? 0f : (-90f), 0f);
Material[] materials = ((Component)Screen).gameObject.GetComponent<Renderer>().materials;
if (materials.Length > 1)
{
materials[1] = (isOn ? ScreenOn : ScreenOff);
}
((Component)Screen).gameObject.GetComponent<Renderer>().materials = materials;
}
if (isOn && CamOn.Clips.Count > 0)
{
SM.PlayCoreSound((FVRPooledAudioType)20, CamOn, ((Component)this).transform.position);
}
else if (CamOff.Clips.Count > 0)
{
SM.PlayCoreSound((FVRPooledAudioType)20, CamOff, ((Component)this).transform.position);
}
CameraOn = isOn;
}
}
public class SpectatorCameraAttachmentInterface : FVRFireArmAttachmentInterface
{
[Header("Spectator Camera")]
public Camera DisplayCam;
[Header("Rendering Settings")]
public Renderer LEDRenderer;
public Color LEDColorOn;
public Color LEDEmissOn;
public Color LEDColorOff;
public Color LEDEmissOff;
[Header("Audio Events")]
public AudioEvent CamOn;
public AudioEvent CamOff;
public AudioEvent FOVChange;
public bool CameraOn { get; private set; }
public override void UpdateInteraction(FVRViveHand hand)
{
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: Unknown result type (might be due to invalid IL or missing references)
((FVRFireArmAttachmentInterface)this).UpdateInteraction(hand);
if (!hand.Input.TouchpadDown || !(((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.25f))
{
return;
}
Vector2 touchpadAxes = hand.Input.TouchpadAxes;
if (!((Object)(object)DisplayCam != (Object)null))
{
return;
}
if (Vector2.Angle(touchpadAxes, Vector2.up) <= 45f)
{
ToggleCameraState();
}
if (CameraOn && (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.left) <= 45f || Vector2.Angle(hand.Input.TouchpadAxes, Vector2.right) <= 45f))
{
int num = (int)Mathf.Sign(touchpadAxes.x) * 10;
GM.Options.ControlOptions.CamFOV = Mathf.Clamp(GM.Options.ControlOptions.CamFOV + (float)num, 10f, 180f);
if (FOVChange.Clips.Count > 0)
{
SM.PlayCoreSound((FVRPooledAudioType)20, FOVChange, ((Component)this).transform.position);
}
}
}
public override void FVRUpdate()
{
((FVRInteractiveObject)this).FVRUpdate();
if (CameraOn && (Object)(object)GM.CurrentSceneSettings.GetCamObjectPoint() != (Object)(object)((Component)DisplayCam).transform)
{
UpdateCameraState(isOn: false);
}
}
[ContextMenu("Toggle Camera")]
public void ToggleCameraState()
{
UpdateCameraState(!CameraOn);
if (!CameraOn && (Object)(object)GM.CurrentSceneSettings.GetCamObjectPoint() == (Object)(object)((Component)DisplayCam).transform)
{
GM.CurrentSceneSettings.SetCamObjectPoint((Transform)null);
}
}
public void UpdateCameraState(bool isOn)
{
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
((Component)DisplayCam).gameObject.SetActive(isOn);
if ((Object)(object)DisplayCam != (Object)null && isOn)
{
GM.CurrentSceneSettings.SetCamObjectPoint(((Component)DisplayCam).transform);
}
if ((Object)(object)LEDRenderer != (Object)null)
{
LEDRenderer.material.SetColor("_Color", isOn ? LEDColorOn : LEDColorOff);
LEDRenderer.material.SetColor("_EmissionColor", isOn ? LEDEmissOn : LEDEmissOff);
}
if (isOn && CamOn.Clips.Count > 0)
{
SM.PlayCoreSound((FVRPooledAudioType)20, CamOn, ((Component)this).transform.position);
}
else if (CamOff.Clips.Count > 0)
{
SM.PlayCoreSound((FVRPooledAudioType)20, CamOff, ((Component)this).transform.position);
}
CameraOn = isOn;
}
}
public class ToggleGameObject : MonoBehaviour
{
public GameObject TargetObject;
public void Toggle()
{
TargetObject.SetActive(!TargetObject.activeSelf);
}
}
}
namespace LSIIC.ModPanel
{
public class ModPanelV2 : FVRPhysicalObject, IFVRDamageable
{
public delegate void EventDamage(Damage dam);
[Header("ModPanelV2")]
public Canvas Canvas;
public Text BackgroundText;
public Text HeldObjectsText;
[Header("Pages")]
public Text PageNameText;
public List<GameObject> PagePrefabs;
[HideInInspector]
public List<ModPanelV2Page> Pages = new List<ModPanelV2Page>();
public Dictionary<Type, ModPanelV2Page> PagesByType = new Dictionary<Type, ModPanelV2Page>();
public List<GameObject> ControlPrefabs;
private ModPanelV2Page m_curPage;
private int m_pageIndex;
public event EventDamage DamageEvent;
public void Awake()
{
((FVRPhysicalObject)this).Awake();
foreach (GameObject pagePrefab in PagePrefabs)
{
ModPanelV2Page component = Object.Instantiate<GameObject>(pagePrefab, ((Component)Canvas).transform).GetComponent<ModPanelV2Page>();
((Component)component).gameObject.SetActive(false);
component.Panel = this;
component.PageInit();
Pages.Add(component);
if (!PagesByType.ContainsKey(((object)component).GetType()))
{
PagesByType[((object)component).GetType()] = component;
}
}
SwitchPage(0);
}
public override void UpdateInteraction(FVRViveHand hand)
{
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
((FVRPhysicalObject)this).UpdateInteraction(hand);
if (hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.25f)
{
Vector2 touchpadAxes = hand.Input.TouchpadAxes;
if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.left) <= 45f)
{
PrevPage();
}
else if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.right) <= 45f)
{
NextPage();
}
if (Vector2.Angle(touchpadAxes, Vector2.down) <= 45f)
{
((FVRPhysicalObject)this).ToggleKinematicLocked();
}
}
}
public void Update()
{
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)GM.CurrentPlayerBody.Head != (Object)null && Vector3.Dot(GM.CurrentPlayerBody.Head.position, ((Component)this).transform.position) > 0f && Pages.Count > m_pageIndex && (Object)(object)Pages[m_pageIndex] != (Object)null)
{
Pages[m_pageIndex].PageTick();
}
if ((Object)(object)BackgroundText != (Object)null)
{
BackgroundText.text = Helpers.H3InfoPrint((H3Info)int.MaxValue, true);
}
if (!((Object)(object)HeldObjectsText != (Object)null))
{
return;
}
bool flag = false;
FVRViveHand[] hands = GM.CurrentMovementManager.Hands;
for (int i = 0; i < hands.Length; i++)
{
if ((Object)(object)hands[i].CurrentInteractable != (Object)null)
{
flag = true;
break;
}
}
if (flag)
{
HeldObjectsText.text = Helpers.GetHeldObjects();
}
else if (!string.IsNullOrEmpty(HeldObjectsText.text))
{
HeldObjectsText.text = "";
}
}
public void SwitchPage(int index)
{
index = (int)Mathf.Repeat((float)index, (float)Pages.Count);
if ((Object)(object)m_curPage != (Object)null)
{
m_curPage.PageClose();
((Component)m_curPage).gameObject.SetActive(false);
}
m_curPage = Pages[index];
((Component)m_curPage).gameObject.SetActive(true);
m_curPage.PageOpen();
if ((Object)(object)PageNameText != (Object)null)
{
PageNameText.text = m_curPage.PageTitle;
}
m_pageIndex = index;
}
public void SwitchPage(ModPanelV2Page page)
{
int num = Pages.IndexOf(page);
if (num == -1)
{
Debug.LogError((object)"Page does not exist to panel");
}
else
{
SwitchPage(num);
}
}
public void SwitchPage(Type pagetype)
{
if (!PagesByType.ContainsKey(pagetype))
{
Debug.LogError((object)"Page type does not exist in dictionary");
return;
}
if ((Object)(object)m_curPage != (Object)null)
{
m_curPage.PageClose();
((Component)m_curPage).gameObject.SetActive(false);
}
m_curPage = PagesByType[pagetype];
((Component)m_curPage).gameObject.SetActive(true);
m_curPage.PageOpen();
if ((Object)(object)PageNameText != (Object)null)
{
PageNameText.text = m_curPage.PageTitle;
}
m_pageIndex = Pages.IndexOf(m_curPage);
}
public void PrevPage()
{
SwitchPage(m_pageIndex - 1);
}
public void NextPage()
{
SwitchPage(m_pageIndex + 1);
}
public void Damage(Damage dam)
{
OnDamage(dam);
}
public void OnDamage(Damage dam)
{
if (this.DamageEvent != null)
{
this.DamageEvent(dam);
}
}
}
public class ModPanelV2ObjectControl : MonoBehaviour
{
public enum ObjectType
{
Int32,
Single,
Boolean,
Enum,
Method,
Vectors,
Message
}
public ObjectType Type;
public object Instance;
public FieldInfo Field;
public MethodInfo Method;
public bool UpdatesOnTick;
public object[] MethodParameters;
private Text m_display;
private string m_message;
public void Awake()
{
if ((Object)(object)m_display == (Object)null)
{
m_display = ((Component)this).GetComponent<Text>();
}
}
public void Update()
{
if (UpdatesOnTick)
{
UpdateDisplay();
}
}
public void UpdateDisplay()
{
if (Instance != null && (Object)(object)m_display != (Object)null)
{
if ((object)Field != null)
{
m_display.text = string.Format(string.IsNullOrEmpty(m_message) ? "{1} {2}: {3}" : m_message, Field.FieldType.BaseType.Name, Field.FieldType.Name, Field.Name, Field.GetValue(Instance));
}
else if ((object)Method != null)
{
string text = "";
for (int i = 0; i < Method.GetParameters().Length; i++)
{
ParameterInfo parameterInfo = Method.GetParameters()[i];
text = text + parameterInfo.ParameterType.Name + " " + parameterInfo.Name;
text += ((i == Method.GetParameters().Length - 1) ? "" : ", ");
}
m_display.text = string.Format(string.IsNullOrEmpty(m_message) ? "{1} {0}.{2}({3})" : m_message, Method.DeclaringType.Name, Method.ReturnType.Name, Method.Name, text);
}
else
{
m_display.text = m_message;
}
}
else if ((Object)(object)m_display != (Object)null)
{
Type = ObjectType.Message;
m_display.text = "\nInstance is null!\n";
}
else
{
Debug.LogError((object)"Something is really wrong considering Instance and m_display are both null");
}
}
public void InitObjectControl(object instance, FieldInfo field, MethodInfo method, string message = null, bool updateOnTick = false, object[] parameters = null)
{
Instance = instance;
Field = field;
Method = method;
UpdatesOnTick = updateOnTick;
m_message = message;
MethodParameters = parameters;
Awake();
UpdateDisplay();
}
public void DeltaValue(int value)
{
if ((object)Field != null)
{
int num = (int)Field.GetValue(Instance);
if (Field.FieldType.IsEnum)
{
object value2 = Field.GetValue(Instance);
Array values = Enum.GetValues(value2.GetType());
int num2 = Array.IndexOf(values, value2);
Field.SetValue(Instance, values.GetValue((int)Mathf.Repeat((float)(num2 + value), (float)values.Length)));
}
else
{
Field.SetValue(Instance, num + value);
}
UpdateDisplay();
}
}
public void DeltaValue(float value)
{
if ((object)Field != null)
{
float num = (float)Field.GetValue(Instance);
Field.SetValue(Instance, num + value);
UpdateDisplay();
}
}
public void SetValue(int value)
{
if ((object)Field != null)
{
Field.SetValue(Instance, Convert.ChangeType(value, Field.FieldType));
UpdateDisplay();
}
}
public void SetValue(float value)
{
if ((object)Field != null)
{
Field.SetValue(Instance, value);
UpdateDisplay();
}
}
public void SetMaxValue()
{
if ((object)Field != null)
{
if ((object)Field.FieldType.GetField("MaxValue") != null)
{
Field.SetValue(Instance, Field.FieldType.GetField("MaxValue").GetValue(null));
}
UpdateDisplay();
}
}
public void OpenKeyboard()
{
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
if ((object)Field == null)
{
return;
}
((UnityEventBase)SteamVR_Events.System((EVREventType)1202)).RemoveAllListeners();
SteamVR_Events.System((EVREventType)1202).Listen((UnityAction<VREvent_t>)delegate
{
//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
StringBuilder stringBuilder = new StringBuilder(256);
SteamVR.instance.overlay.GetKeyboardText(stringBuilder, 256u);
string text = stringBuilder.ToString();
object value = Field.GetValue(Instance);
if (Type != ObjectType.Vectors)
{
value = Convert.ChangeType(text, Field.FieldType);
}
else
{
text = text.Replace("(", "").Replace(")", "");
string[] array = text.Split(new char[1] { ',' });
value = (((object)Field.FieldType != typeof(Vector3)) ? ((object)new Vector2(float.Parse(array[0]), float.Parse(array[1]))) : ((object)new Vector3(float.Parse(array[0]), float.Parse(array[1]), float.Parse(array[2]))));
}
Field.SetValue(Instance, value);
UpdateDisplay();
});
SteamVR.instance.overlay.ShowKeyboard(0, 0, "Enter the name of an asset.", 256u, Field.GetValue(Instance).ToString(), false, 0uL);
}
public void CallMethod()
{
if ((object)Method != null)
{
Method.Invoke(Instance, MethodParameters);
}
}
}
public class ModPanelV2Page : MonoBehaviour
{
public string PageTitle;
public Vector2 ObjectControlStart = new Vector2(20f, -16f);
public static float ObjectControlSpacing = -14f;
[HideInInspector]
public List<ModPanelV2ObjectControl> ObjectControls = new List<ModPanelV2ObjectControl>();
[HideInInspector]
public List<ModPanelV2ObjectControl> UpdatingObjectControls = new List<ModPanelV2ObjectControl>();
[HideInInspector]
public List<ModPanelV2ObjectControl> SavedObjectControls = new List<ModPanelV2ObjectControl>();
protected Dictionary<string, GameObject> Elements = new Dictionary<string, GameObject>();
[HideInInspector]
public ModPanelV2 Panel;
public virtual void PageInit()
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Expected O, but got Unknown
foreach (Transform item in ((Component)this).transform)
{
Transform val = item;
Elements.Add(((Object)((Component)val).gameObject).name, ((Component)val).gameObject);
}
}
public virtual void PageOpen()
{
}
public virtual void PageTick()
{
}
public virtual void PageClose(bool destroy = false)
{
}
public void OnDestroy()
{
PageClose(destroy: true);
}
public ModPanelV2ObjectControl AddObjectControl(Vector2 startOffset, int startIndex, object instance, string memberName, string message = null, bool updateOnTick = false, bool isMethod = false, object[] methodParameters = null)
{
//IL_0131: Unknown result type (might be due to invalid IL or missing references)
//IL_013f: Unknown result type (might be due to invalid IL or missing references)
//IL_0144: Unknown result type (might be due to invalid IL or missing references)
//IL_0149: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)Panel != (Object)null)
{
FieldInfo fieldInfo = null;
MethodInfo methodInfo = null;
ModPanelV2ObjectControl.ObjectType index = ModPanelV2ObjectControl.ObjectType.Message;
if (!string.IsNullOrEmpty(memberName))
{
if (instance != null)
{
if (!isMethod)
{
fieldInfo = AccessTools.Field(instance.GetType(), memberName);
}
else
{
if (methodParameters != null)
{
Type[] array = new Type[methodParameters.Length];
for (int i = 0; i < methodParameters.Length; i++)
{
array[i] = methodParameters[i].GetType();
}
}
methodInfo = AccessTools.Method(instance.GetType(), memberName, (Type[])null, (Type[])null);
}
}
if ((object)fieldInfo != null)
{
index = (fieldInfo.FieldType.IsEnum ? ModPanelV2ObjectControl.ObjectType.Enum : (((object)fieldInfo.FieldType != typeof(Vector2) && (object)fieldInfo.FieldType != typeof(Vector3)) ? ((ModPanelV2ObjectControl.ObjectType)Enum.Parse(typeof(ModPanelV2ObjectControl.ObjectType), fieldInfo.FieldType.Name)) : ModPanelV2ObjectControl.ObjectType.Vectors));
}
else if ((object)methodInfo != null)
{
index = ModPanelV2ObjectControl.ObjectType.Method;
}
else
{
index = ModPanelV2ObjectControl.ObjectType.Message;
message = "No member of the instance was found with the name\n" + memberName;
message += (isMethod ? "\nIt was said to be a method." : "\nIt was said to be a field.");
}
}
ModPanelV2ObjectControl component = Object.Instantiate<GameObject>(Panel.ControlPrefabs[(int)index], ((Component)this).transform).GetComponent<ModPanelV2ObjectControl>();
((Component)component).transform.localPosition = Vector2.op_Implicit(startOffset + new Vector2(0f, ObjectControlSpacing * (float)startIndex));
GameObject gameObject = ((Component)component).gameObject;
((Object)gameObject).name = ((Object)gameObject).name + memberName;
component.InitObjectControl(instance, fieldInfo, methodInfo, message, updateOnTick, methodParameters);
ObjectControls.Add(component);
if (updateOnTick)
{
UpdatingObjectControls.Add(component);
}
return component;
}
return null;
}
public int AddObjectControls(Vector2 startOffset, int startIndex, object instance, string[] memberNames, string[] messages = null, ulong updatesOnTick = 0uL, ulong methods = 0uL, object[][] methodParams = null)
{
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
for (int i = 0; i < memberNames.Length; i++)
{
if (!string.IsNullOrEmpty(memberNames[i]) || (messages != null && messages.Length > i && !string.IsNullOrEmpty(messages[i])))
{
string message = ((messages != null && messages.Length > i) ? messages[i] : "");
bool isMethod = ((methods >> i) & 1) != 0;
bool updateOnTick = ((updatesOnTick >> i) & 1) != 0;
object[] methodParameters = ((methodParams != null && methodParams.Length > i) ? methodParams[i] : null);
AddObjectControl(startOffset, startIndex + i, instance, memberNames[i], message, updateOnTick, isMethod, methodParameters);
}
}
return startIndex + memberNames.Length;
}
public void ClearObjectControls()
{
foreach (ModPanelV2ObjectControl objectControl in ObjectControls)
{
if (!((Object)(object)objectControl == (Object)null) && (SavedObjectControls == null || !SavedObjectControls.Contains(objectControl)))
{
Object.Destroy((Object)(object)((Component)objectControl).gameObject);
}
}
ObjectControls.Clear();
foreach (ModPanelV2ObjectControl savedObjectControl in SavedObjectControls)
{
if (!((Object)(object)savedObjectControl == (Object)null))
{
ObjectControls.Add(savedObjectControl);
}
}
}
}
public class ModPanelV2Page_Damage : ModPanelV2Page
{
[Header("Damage Page")]
public Text FieldValues;
public bool AverageDamages;
public Dictionary<float, Damage> AllDamages = new Dictionary<float, Damage>();
private Damage m_dmg;
public override void PageInit()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
base.PageInit();
AddObjectControl(new Vector2(20f, 16f), 0, this, "AverageDamages", "Do we averages damages together? Currently {3}");
}
public override void PageOpen()
{
base.PageOpen();
if ((Object)(object)Panel != (Object)null)
{
Panel.DamageEvent += Panel_DamageEvent;
}
}
public override void PageClose(bool destroy = false)
{
base.PageClose(destroy);
if ((Object)(object)Panel != (Object)null)
{
Panel.DamageEvent -= Panel_DamageEvent;
}
}
public void UpdateDamageDisplay()
{
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_010d: Unknown result type (might be due to invalid IL or missing references)
//IL_0121: Unknown result type (might be due to invalid IL or missing references)
//IL_0135: Unknown result type (might be due to invalid IL or missing references)
if (m_dmg != null)
{
FieldValues.text = $"{m_dmg.Class}\n{m_dmg.Source_IFF}\n\n{m_dmg.Dam_Blunt}\n{m_dmg.Dam_Piercing}\n{m_dmg.Dam_Cutting}\n{m_dmg.Dam_TotalKinetic}\n{m_dmg.Dam_Thermal}\n{m_dmg.Dam_Chilling}\n{m_dmg.Dam_EMP}\n{m_dmg.Dam_TotalEnergetic}\n{m_dmg.Dam_Stunning}\n{m_dmg.Dam_Blinding}\n\n{m_dmg.point:F3}\n{m_dmg.hitNormal:F3}\n{m_dmg.strikeDir:F3}\n{m_dmg.damageSize}\n\n{AllDamages.Count}";
if (AllDamages != null && AllDamages.Count > 1)
{
Text fieldValues = FieldValues;
fieldValues.text += $"\n{(float)AllDamages.Count / (AllDamages.Last().Key - AllDamages.First().Key) * 60f}";
}
else
{
Text fieldValues2 = FieldValues;
fieldValues2.text += "\n-";
}
}
else
{
Debug.LogError((object)"[ModPanelV2Page_Damage] m_dmg == null!");
}
}
public void ClearDamages()
{
if (AllDamages != null)
{
AllDamages.Clear();
}
FieldValues.text = "-\n-\n\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n\n-\n-\n-\n-\n\n-\n-";
}
public void Panel_DamageEvent(Damage dam)
{
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
//IL_0101: Unknown result type (might be due to invalid IL or missing references)
//IL_0136: Unknown result type (might be due to invalid IL or missing references)
//IL_016b: Unknown result type (might be due to invalid IL or missing references)
//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
//IL_020a: Unknown result type (might be due to invalid IL or missing references)
//IL_023f: Unknown result type (might be due to invalid IL or missing references)
//IL_0274: Unknown result type (might be due to invalid IL or missing references)
//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
//IL_0337: Unknown result type (might be due to invalid IL or missing references)
//IL_033c: Unknown result type (might be due to invalid IL or missing references)
//IL_0341: Unknown result type (might be due to invalid IL or missing references)
//IL_03cf: Unknown result type (might be due to invalid IL or missing references)
//IL_03d4: Unknown result type (might be due to invalid IL or missing references)
//IL_03d9: Unknown result type (might be due to invalid IL or missing references)
//IL_0467: Unknown result type (might be due to invalid IL or missing references)
//IL_046c: Unknown result type (might be due to invalid IL or missing references)
//IL_0471: Unknown result type (might be due to invalid IL or missing references)
//IL_04ab: Expected O, but got Unknown
if (!AverageDamages)
{
ClearDamages();
}
if (AllDamages != null && !AllDamages.ContainsKey(Time.time))
{
AllDamages.Add(Time.time, dam);
}
if (AllDamages != null && AllDamages.Count > 0)
{
m_dmg = new Damage
{
Class = AllDamages.Last().Value.Class,
Source_IFF = AllDamages.Last().Value.Source_IFF,
Dam_Blunt = AllDamages.Values.Average((Damage x) => x.Dam_Blunt),
Dam_Piercing = AllDamages.Values.Average((Damage x) => x.Dam_Piercing),
Dam_Cutting = AllDamages.Values.Average((Damage x) => x.Dam_Cutting),
Dam_TotalKinetic = AllDamages.Values.Average((Damage x) => x.Dam_TotalKinetic),
Dam_Thermal = AllDamages.Values.Average((Damage x) => x.Dam_Thermal),
Dam_Chilling = AllDamages.Values.Average((Damage x) => x.Dam_Chilling),
Dam_EMP = AllDamages.Values.Average((Damage x) => x.Dam_EMP),
Dam_TotalEnergetic = AllDamages.Values.Average((Damage x) => x.Dam_TotalEnergetic),
Dam_Stunning = AllDamages.Values.Average((Damage x) => x.Dam_Stunning),
Dam_Blinding = AllDamages.Values.Average((Damage x) => x.Dam_Blinding),
point = new Vector3(AllDamages.Values.Average((Damage x) => x.point.x), AllDamages.Values.Average((Damage x) => x.point.y), AllDamages.Values.Average((Damage x) => x.point.z)),
hitNormal = new Vector3(AllDamages.Values.Average((Damage x) => x.hitNormal.x), AllDamages.Values.Average((Damage x) => x.hitNormal.y), AllDamages.Values.Average((Damage x) => x.hitNormal.z)),
strikeDir = new Vector3(AllDamages.Values.Average((Damage x) => x.strikeDir.x), AllDamages.Values.Average((Damage x) => x.strikeDir.y), AllDamages.Values.Average((Damage x) => x.strikeDir.z)),
damageSize = AllDamages.Values.Average((Damage x) => x.damageSize)
};
}
UpdateDamageDisplay();
}
}
public class ModPanelV2Page_Debug : ModPanelV2Page
{
[Header("Debug Page")]
public Transform RaycastCylinder;
public Transform CylinderBack;
public Transform CylinderForward;
[Space]
public Text RaycastHitPath;
public Text RaycastHitInfo;
public Text RaycastObjectInfo;
[Space]
public Text ButtonSelectText;
public GameObject SelectedControls;
private Vector3 m_cylinderTarget;
private RaycastHit m_raycastHit;
private Collider m_raycastHitLastCollider;
private GameObject m_selection;
private Transform m_selectionParent;
private LayerMask m_layerMask;
private const int LAYERMASK_H3 = 532481;
private const int LAYERMASK_ALL = int.MaxValue;
public void Awake()
{
((LayerMask)(ref m_layerMask)).value = int.MaxValue;
if ((Object)(object)Panel != (Object)null)
{
m_raycastHitLastCollider = ((Component)Panel).GetComponentInChildren<Collider>();
}
}
public override void PageTick()
{
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_0313: Unknown result type (might be due to invalid IL or missing references)
//IL_0318: Unknown result type (might be due to invalid IL or missing references)
//IL_0338: Unknown result type (might be due to invalid IL or missing references)
//IL_0343: Unknown result type (might be due to invalid IL or missing references)
//IL_0353: Unknown result type (might be due to invalid IL or missing references)
//IL_0363: Unknown result type (might be due to invalid IL or missing references)
//IL_036f: Unknown result type (might be due to invalid IL or missing references)
//IL_0274: Unknown result type (might be due to invalid IL or missing references)
//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
base.PageTick();
if ((Object)(object)RaycastCylinder == (Object)null || (Object)(object)RaycastCylinder.parent == (Object)null)
{
return;
}
Vector3 val;
if ((Object)(object)m_selection == (Object)null)
{
if (Physics.Raycast(RaycastCylinder.parent.position, RaycastCylinder.parent.forward, ref m_raycastHit, 99999f, LayerMask.op_Implicit(m_layerMask), (QueryTriggerInteraction)2))
{
m_cylinderTarget = ((RaycastHit)(ref m_raycastHit)).point;
if ((Object)(object)RaycastHitInfo != (Object)null)
{
Text raycastHitInfo = RaycastHitInfo;
string[] obj = new string[6] { "Hit at ", null, null, null, null, null };
val = ((RaycastHit)(ref m_raycastHit)).point;
obj[1] = ((Vector3)(ref val)).ToString("F2");
obj[2] = ", ";
obj[3] = ((RaycastHit)(ref m_raycastHit)).distance.ToString("F2");
obj[4] = "m away. LayerMask of ";
obj[5] = ((LayerMask)(ref m_layerMask)).value.ToString();
raycastHitInfo.text = string.Concat(obj);
}
if ((Object)(object)m_raycastHitLastCollider != (Object)(object)((RaycastHit)(ref m_raycastHit)).collider)
{
m_raycastHitLastCollider = ((RaycastHit)(ref m_raycastHit)).collider;
if ((Object)(object)RaycastHitPath != (Object)null)
{
RaycastHitPath.text = Helpers.GetObjectHierarchyPath(((Component)((RaycastHit)(ref m_raycastHit)).collider).transform);
}
if ((Object)(object)RaycastObjectInfo != (Object)null)
{
RaycastObjectInfo.text = Helpers.GetObjectInfo(((Component)((RaycastHit)(ref m_raycastHit)).collider).gameObject, ((RaycastHit)(ref m_raycastHit)).collider.attachedRigidbody);
}
if ((Object)(object)ButtonSelectText != (Object)null)
{
((Component)ButtonSelectText).gameObject.SetActive(true);
}
}
}
else if ((Object)(object)m_raycastHitLastCollider != (Object)null)
{
m_raycastHitLastCollider = null;
m_cylinderTarget = Vector3.zero;
if ((Object)(object)RaycastHitInfo != (Object)null)
{
RaycastHitInfo.text = string.Empty;
}
if ((Object)(object)RaycastHitPath != (Object)null)
{
RaycastHitPath.text = string.Empty;
}
if ((Object)(object)RaycastObjectInfo != (Object)null)
{
RaycastObjectInfo.text = string.Empty;
}
if ((Object)(object)ButtonSelectText != (Object)null)
{
((Component)ButtonSelectText).gameObject.SetActive(false);
}
}
RaycastCylinder.localRotation = Quaternion.identity;
}
else
{
if ((Object)(object)RaycastHitInfo != (Object)null)
{
Text raycastHitInfo2 = RaycastHitInfo;
val = m_selection.transform.position;
raycastHitInfo2.text = "Selection at " + ((Vector3)(ref val)).ToString("F2") + ". LayerMask of " + ((LayerMask)(ref m_layerMask)).value;
}
m_cylinderTarget = m_selection.transform.position;
RaycastCylinder.LookAt(m_selection.transform);
}
((Component)RaycastCylinder).gameObject.SetActive(m_cylinderTarget != Vector3.zero);
RaycastCylinder.localScale = new Vector3(5f, 5f, Vector3.Distance(m_cylinderTarget, ((Component)this).transform.position) * (RaycastCylinder.localScale.x / RaycastCylinder.lossyScale.x));
}
public void SelectOrReleaseObject()
{
if ((Object)(object)m_selection == (Object)null && (Object)(object)m_raycastHitLastCollider != (Object)null)
{
SelectObject(((Component)m_raycastHitLastCollider).transform);
}
else
{
ReleaseObject();
}
}
public void SelectObject(Transform obj)
{
if ((Object)(object)m_selection != (Object)null)
{
ReleaseObject();
}
if ((Object)(object)obj != (Object)null)
{
m_selection = ((Component)obj).gameObject;
m_selectionParent = obj.parent;
if ((Object)(object)ButtonSelectText != (Object)null)
{
ButtonSelectText.text = "Release Object";
}
if ((Object)(object)SelectedControls != (Object)null)
{
SelectedControls.SetActive(true);
}
if ((Object)(object)RaycastHitPath != (Object)null)
{
RaycastHitPath.text = Helpers.GetObjectHierarchyPath(((Component)obj).transform);
}
if ((Object)(object)RaycastObjectInfo != (Object)null)
{
RaycastObjectInfo.text = Helpers.GetObjectInfo(((Component)obj).gameObject, m_raycastHitLastCollider.attachedRigidbody);
}
}
}
public void SelectObjectParent()
{
if ((Object)(object)m_selectionParent != (Object)null)
{
SelectObject(m_selectionParent);
}
}
public void ReleaseObject()
{
if ((Object)(object)m_selection != (Object)null && (Object)(object)m_selection.transform.parent != (Object)(object)m_selectionParent)
{
m_selection.transform.SetParent(m_selectionParent);
}
m_selection = null;
m_selectionParent = null;
((Component)RaycastCylinder).gameObject.SetActive(false);
if ((Object)(object)((FVRPhysicalObject)Panel).RootRigidbody != (Object)null)
{
((FVRPhysicalObject)Panel).RootRigidbody.ResetCenterOfMass();
}
if ((Object)(object)ButtonSelectText != (Object)null)
{
ButtonSelectText.text = "Select Object";
}
if ((Object)(object)SelectedControls != (Object)null)
{
SelectedControls.SetActive(false);
}
}
public void ToggleRaycastMask()
{
((LayerMask)(ref m_layerMask)).value = ((((LayerMask)(ref m_layerMask)).value == int.MaxValue) ? 532481 : int.MaxValue);
}
public void ToggleRaycastDirection()
{
if ((Object)(object)RaycastCylinder.parent == (Object)(object)CylinderBack)
{
RaycastCylinder.SetParent(CylinderForward);
}
else
{
RaycastCylinder.SetParent(CylinderBack);
}
}
public void DeleteObject()
{
if (!((Object)(object)m_selection != (Object)null))
{
return;
}
if ((Object)(object)m_selection.GetComponent<FVRInteractiveObject>() != (Object)null)
{
FVRInteractiveObject component = m_selection.GetComponent<FVRInteractiveObject>();
if (component.IsHeld)
{
component.EndInteraction(component.m_hand);
component.m_hand.ForceSetInteractable((FVRInteractiveObject)null);
}
}
Object.Destroy((Object)(object)m_selection.gameObject);
ReleaseObject();
}
public void GrabOrReleaseObject()
{
if ((Object)(object)m_selection != (Object)null)
{
m_selection.transform.SetParent(((Object)(object)m_selection.transform.parent == (Object)(object)((Component)Panel).transform) ? m_selectionParent : ((Component)Panel).transform);
if ((Object)(object)m_raycastHitLastCollider != (Object)null && (Object)(object)m_raycastHitLastCollider.attachedRigidbody != (Object)null)
{
m_raycastHitLastCollider.attachedRigidbody.isKinematic = (Object)(object)m_selection.transform.parent == (Object)(object)((Component)Panel).transform;
}
}
}
public void OpenObjectInPanelSpawnerPage()
{
if ((Object)(object)m_selection != (Object)null && (Object)(object)Panel != (Object)null)
{
ModPanelV2Page_Spawner modPanelV2Page_Spawner = (ModPanelV2Page_Spawner)Panel.PagesByType[typeof(ModPanelV2Page_Spawner)];
Panel.SwitchPage(modPanelV2Page_Spawner);
modPanelV2Page_Spawner.UpdateCurrentGameObj(m_selection);
}
}
}
public class ModPanelV2Page_HeldObject : ModPanelV2Page
{
[Header("Held Object Page")]
public Vector2[] Columns = (Vector2[])(object)new Vector2[3]
{
new Vector2(20f, -16f),
new Vector2(130f, -16f),
new Vector2(240f, -16f)
};
public bool ClearObjectControlsOnRelease = true;
private FVRInteractiveObject m_object;
private FVRInteractiveObject m_prevObject;
private Type[] m_allowedInteractables = new Type[1] { typeof(FVRFireArmAttachmentInterface) };
private ModPanelV2ObjectControl m_clearObjectControl;
private int[] m_columnStarts;
private FVRFireArmChamber m_curChamber;
private int m_curChamberIndex = -1;
public FVRInteractiveObject Object
{
get
{
return m_object;
}
set
{
m_prevObject = m_object;
m_object = value;
}
}
public override void PageInit()
{
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
base.PageInit();
if ((Object)(object)m_clearObjectControl == (Object)null)
{
m_clearObjectControl = AddObjectControl(new Vector2(20f, 16f), 0, this, "ClearObjectControlsOnRelease", "Clear object controls on release? Currently {3}");
SavedObjectControls.Add(m_clearObjectControl);
}
}
public override void PageOpen()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
base.PageOpen();
GM.CurrentSceneSettings.ObjectPickedUpEvent += new FVRObjectPickedUp(RefreshObjectControls);
}
public override void PageTick()
{
base.PageTick();
if (ClearObjectControlsOnRelease)
{
if ((Object)(object)Object != (Object)null && (Object)(object)Object.m_hand == (Object)null)
{
Object = null;
CleanupHeldObject();
}
FVRViveHand[] hands = GM.CurrentMovementManager.Hands;
foreach (FVRViveHand val in hands)
{
if (!((Object)(object)val.CurrentInteractable != (Object)null))
{
continue;
}
if ((Object)(object)Object != (Object)null && (Object)(object)Object != (Object)(object)val.CurrentInteractable)
{
if (!(val.CurrentInteractable is FVRPhysicalObject))
{
bool flag = false;
for (int j = 0; j < m_allowedInteractables.Length; j++)
{
Type type = ((object)val.CurrentInteractable).GetType();
Type type2 = m_allowedInteractables[j];
if (!type.IsSubclassOf(type2) && (object)type != type2)
{
flag = true;
}
}
if (flag)
{
continue;
}
}
if ((Object)(object)Object == (Object)(object)val.OtherHand.CurrentInteractable && (Object)(object)m_prevObject != (Object)(object)val.CurrentInteractable)
{
Object = val.CurrentInteractable;
RefreshObjectControls();
break;
}
if ((Object)(object)Object != (Object)(object)val.OtherHand.CurrentInteractable)
{
Object = val.CurrentInteractable;
RefreshObjectControls();
break;
}
}
else if ((Object)(object)Object == (Object)null)
{
Object = val.CurrentInteractable;
RefreshObjectControls();
break;
}
}
}
if (m_curChamberIndex != -1)
{
TryToGetCurrentChamber();
}
}
public override void PageClose(bool destroy)
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Expected O, but got Unknown
base.PageClose();
GM.CurrentSceneSettings.ObjectPickedUpEvent -= new FVRObjectPickedUp(RefreshObjectControls);
}
public void CleanupHeldObject()
{
ClearObjectControls();
if ((Object)(object)Panel != (Object)null && (Object)(object)Panel.PageNameText != (Object)null)
{
Panel.PageNameText.text = PageTitle;
}
m_curChamber = null;
m_curChamberIndex = -1;
}
public void TryToGetCurrentChamber()
{
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Expected O, but got Unknown
if (!((Object)(object)Object != (Object)null) || !((Object)(object)((Component)Object).GetComponent<FVRFireArm>() != (Object)null))
{
return;
}
if ((object)AccessTools.Field(((object)Object).GetType(), "Chamber") != null)
{
m_curChamber = (FVRFireArmChamber)AccessTools.Field(((object)Object).GetType(), "Chamber").GetValue(Object);
m_curChamberIndex = -1;
}
else
{
if ((object)AccessTools.Field(((object)Object).GetType(), "m_curChamber") == null)
{
return;
}
int num = (int)AccessTools.Field(((object)Object).GetType(), "m_curChamber").GetValue(Object);
if ((num == m_curChamberIndex && !((Object)(object)m_curChamber == (Object)null)) || (object)((object)Object).GetType().GetField("Chambers") == null)
{
return;
}
m_curChamberIndex = num;
FVRFireArmChamber[] array = (FVRFireArmChamber[])((object)Object).GetType().GetField("Chambers").GetValue(Object);
m_curChamber = array[m_curChamberIndex];
foreach (ModPanelV2ObjectControl updatingObjectControl in UpdatingObjectControls)
{
if ((object)updatingObjectControl.Instance.GetType() == typeof(FVRFireArmChamber))
{
updatingObjectControl.Instance = m_curChamber;
}
}
}
}
public void RefreshObjectControls(FVRInteractiveObject obj = null)
{
//IL_0217: Unknown result type (might be due to invalid IL or missing references)
//IL_0293: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_030d: Unknown result type (might be due to invalid IL or missing references)
//IL_0142: Unknown result type (might be due to invalid IL or missing references)
//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
//IL_0e32: Unknown result type (might be due to invalid IL or missing references)
//IL_0351: Unknown result type (might be due to invalid IL or missing references)
//IL_0ee6: Unknown result type (might be due to invalid IL or missing references)
//IL_03b1: Unknown result type (might be due to invalid IL or missing references)
//IL_0412: Unknown result type (might be due to invalid IL or missing references)
//IL_0469: Unknown result type (might be due to invalid IL or missing references)
//IL_0f45: Unknown result type (might be due to invalid IL or missing references)
//IL_04cb: Unknown result type (might be due to invalid IL or missing references)
//IL_0504: Unknown result type (might be due to invalid IL or missing references)
//IL_0573: Unknown result type (might be due to invalid IL or missing references)
//IL_05a9: Unknown result type (might be due to invalid IL or missing references)
//IL_0fdc: Unknown result type (might be due to invalid IL or missing references)
//IL_106d: Unknown result type (might be due to invalid IL or missing references)
//IL_10b5: Unknown result type (might be due to invalid IL or missing references)
//IL_05f7: Unknown result type (might be due to invalid IL or missing references)
//IL_0650: Unknown result type (might be due to invalid IL or missing references)
//IL_06af: Unknown result type (might be due to invalid IL or missing references)
//IL_110a: Unknown result type (might be due to invalid IL or missing references)
//IL_0712: Unknown result type (might be due to invalid IL or missing references)
//IL_119f: Unknown result type (might be due to invalid IL or missing references)
//IL_07e4: Unknown result type (might be due to invalid IL or missing references)
//IL_120f: Unknown result type (might be due to invalid IL or missing references)
//IL_08bd: Unknown result type (might be due to invalid IL or missing references)
//IL_0907: Unknown result type (might be due to invalid IL or missing references)
//IL_0767: Unknown result type (might be due to invalid IL or missing references)
//IL_127c: Unknown result type (might be due to invalid IL or missing references)
//IL_09da: Unknown result type (might be due to invalid IL or missing references)
//IL_0978: Unknown result type (might be due to invalid IL or missing references)
//IL_0839: Unknown result type (might be due to invalid IL or missing references)
//IL_12e3: Unknown result type (might be due to invalid IL or missing references)
//IL_0a5f: Unknown result type (might be due to invalid IL or missing references)
//IL_13e8: Unknown result type (might be due to invalid IL or missing references)
//IL_138d: Unknown result type (might be due to invalid IL or missing references)
//IL_0ad7: Unknown result type (might be due to invalid IL or missing references)
//IL_0b29: Unknown result type (might be due to invalid IL or missing references)
//IL_143f: Unknown result type (might be due to invalid IL or missing references)
//IL_0ba3: Unknown result type (might be due to invalid IL or missing references)
//IL_0c28: Unknown result type (might be due to invalid IL or missing references)
//IL_0c98: Unknown result type (might be due to invalid IL or missing references)
//IL_0d1c: Unknown result type (might be due to invalid IL or missing references)
//IL_0d97: Unknown result type (might be due to invalid IL or missing references)
//IL_0de2: Unknown result type (might be due to invalid IL or missing references)
CleanupHeldObject();
if ((Object)(object)obj != (Object)null)
{
Object = obj;
}
m_columnStarts = new int[3];
if (!((Object)(object)Object != (Object)null))
{
return;
}
if ((Object)(object)Panel != (Object)null && (Object)(object)Panel.PageNameText != (Object)null)
{
if (Object != null)
{
m_columnStarts[0] = AddObjectControls(Columns[0], m_columnStarts[0], Object, new string[3] { "ControlType", "UseGrabPointChild", "UseGripRotInterp" }, null, 0uL, 0uL);
Panel.PageNameText.text = PageTitle + " - " + ((Object)((Component)Object).gameObject).name;
}
if (Object is FVRPhysicalObject)
{
FVRInteractiveObject @object = Object;
FVRPhysicalObject val = (FVRPhysicalObject)(object)((@object is FVRPhysicalObject) ? @object : null);
if ((Object)(object)val.ObjectWrapper != (Object)null)
{
Panel.PageNameText.text = PageTitle + " - " + val.ObjectWrapper.DisplayName;
}
m_columnStarts[0] = AddObjectControls(Columns[0], m_columnStarts[0], Object, new string[10] { "SpawnLockable", "Harnessable", "Size", "ThrowVelMultiplier", "ThrowAngMultiplier", "UsesGravity", "DistantGrabbable", "DoesQuickbeltSlotFollowHead", "IsPickUpLocked", "m_doesDirectParent" }, null, 0uL, 0uL);
m_columnStarts[0] = AddObjectControls(Columns[0], m_columnStarts[0], Object, new string[1] { "ToggleKinematicLocked" }, null, 0uL, 1uL);
}
}
if ((Object)(object)((Component)Object).GetComponentInChildren<FVRFireArmMagazine>() != (Object)null)
{
m_columnStarts[2] = AddObjectControls(Columns[2], m_columnStarts[2], ((Component)Object).GetComponentInChildren<FVRFireArmMagazine>(), new string[6] { "m_capacity", "IsInfinite", "MagazineType", "RoundType", "FuelAmountLeft", "CanManuallyEjectRounds" }, null, 0uL, 0uL);
}
if ((Object)(object)((Component)Object).GetComponentInChildren<FVRFireArmClip>() != (Object)null)
{
m_columnStarts[2] = AddObjectControls(Columns[2], m_columnStarts[2], ((Component)Object).GetComponentInChildren<FVRFireArmClip>(), new string[5] { "m_capacity", "IsInfinite", "ClipType", "RoundType", "CanManuallyEjectRounds" }, null, 0uL, 0uL);
}
if (Object is FVRPhysicalObject)
{
if (Object is FVRFireArm)
{
Vector2 startOffset = Columns[0];
FVRInteractiveObject object2 = Object;
AddObjectControl(startOffset, 15, (object2 is FVRFireArm) ? object2 : null, "RoundType");
TryToGetCurrentChamber();
if ((Object)(object)m_curChamber != (Object)null)
{
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1], m_curChamber, new string[2] { "ChamberVelocityMultiplier", "IsManuallyExtractable" }, null, 0uL, 0uL);
}
if (Object is Handgun)
{
FVRInteractiveObject object3 = Object;
Handgun val2 = (Handgun)(object)((object3 is Handgun) ? object3 : null);
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1] + 1, val2, new string[6] { "HasSlideRelease", "HasSlideReleaseControl", "HasSlideLockFunctionality", "HasManualDecocker", "HasMagReleaseInput", "CanPhysicsSlideRack" }, null, 0uL, 0uL);
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1] + 1, val2.Slide, new string[5] { "Speed_Forward", "Speed_Rearward", "Speed_Held", "SpringStiffness", "HasLastRoundSlideHoldOpen" }, null, 0uL, 0uL);
AddObjectControls(Columns[2], 14, val2.FireSelectorModes[val2.FireSelectorModeIndex], new string[2] { "ModeType", "BurstAmount" }, null, 1uL, 0uL);
}
else if (Object is OpenBoltReceiver)
{
FVRInteractiveObject object4 = Object;
OpenBoltReceiver val3 = (OpenBoltReceiver)(object)((object4 is OpenBoltReceiver) ? object4 : null);
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1] + 1, val3, new string[1] { "HasMagReleaseButton" }, null, 0uL, 0uL);
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1] + 1, val3.Bolt, new string[8] { "BoltSpeed_Forward", "BoltSpeed_Rearward", "BoltSpeed_Held", "BoltSpringStiffness", "HasLastRoundBoltHoldOpen", "BoltRot_Standard", "BoltRot_Safe", "BoltRot_SlipDistance" }, null, 0uL, 0uL);
AddObjectControls(Columns[2], 14, val3.FireSelector_Modes[val3.FireSelectorModeIndex], new string[1] { "ModeType" }, null, 1uL, 0uL);
AddObjectControls(Columns[2], 15, val3, new string[1] { "SuperBurstAmount" }, null, 0uL, 0uL);
}
else if (Object is ClosedBoltWeapon)
{
FVRInteractiveObject object5 = Object;
ClosedBoltWeapon val4 = (ClosedBoltWeapon)(object)((object5 is ClosedBoltWeapon) ? object5 : null);
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1] + 1, val4, new string[5] { "EjectsMagazineOnEmpty", "BoltLocksWhenNoMagazineFound", "DoesClipEntryRequireBoltBack", "HasMagReleaseButton", "HasBoltReleaseButton" }, null, 0uL, 0uL);
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1] + 1, val4.Bolt, new string[6] { "Speed_Forward", "Speed_Rearward", "Speed_Held", "SpringStiffness", "HasLastRoundBoltHoldOpen", "DoesClipHoldBoltOpen" }, null, 0uL, 0uL);
AddObjectControls(Columns[2], 14, val4.FireSelector_Modes[val4.FireSelectorModeIndex], new string[2] { "ModeType", "BurstAmount" }, null, 1uL, 0uL);
}
else if (Object is BreakActionWeapon)
{
FVRInteractiveObject object6 = Object;
BreakActionWeapon val5 = (BreakActionWeapon)(object)((object6 is BreakActionWeapon) ? object6 : null);
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1], val5, new string[4] { "m_isLatched", "UsesManuallyCockedHammers", "FireAllBarrels", "PopOutEmpties" }, null, 0uL, 8uL);
for (int i = 0; i < Math.Min(val5.Barrels.Length, 14); i++)
{
m_columnStarts[2] = AddObjectControls(Columns[2], m_columnStarts[2], val5.Barrels[i].Chamber, new string[1] { "ChamberVelocityMultiplier" }, null, 0uL, 0uL);
}
}
else if (Object is Derringer)
{
FVRInteractiveObject object7 = Object;
Derringer val6 = (Derringer)(object)((object7 is Derringer) ? object7 : null);
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1], val6, new string[4] { "HingeValues", "DoesAutoEjectRounds", "IsTriggerDoubleAction", "DeletesCartridgeOnFire" }, null, 0uL, 0uL);
for (int j = 0; j < Math.Min(val6.Barrels.Count, 14); j++)
{
m_columnStarts[2] = AddObjectControls(Columns[2], m_columnStarts[2], val6.Barrels[j].Chamber, new string[1] { "ChamberVelocityMultiplier" }, null, 0uL, 0uL);
}
}
else if (Object is TubeFedShotgun)
{
FVRInteractiveObject object8 = Object;
TubeFedShotgun val7 = (TubeFedShotgun)(object)((object8 is TubeFedShotgun) ? object8 : null);
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1] + 1, val7, new string[3] { "m_isHammerCocked", "UsesSlamFireTrigger", "CanModeSwitch" }, null, 0uL, 0uL);
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1] + 1, val7.Bolt, new string[5] { "Speed_Forward", "Speed_Rearward", "Speed_Held", "SpringStiffness", "HasLastRoundBoltHoldOpen" }, null, 0uL, 0uL);
if ((Object)(object)val7.Handle != (Object)null)
{
m_columnStarts[2] = AddObjectControls(Columns[2], m_columnStarts[2] + 1, val7.Handle, new string[2] { "Speed_Held", "m_isHandleLocked" }, null, 0uL, 0uL);
}
}
else if (Object is Flaregun)
{
FVRInteractiveObject object9 = Object;
Flaregun instance = (Flaregun)(object)((object9 is Flaregun) ? object9 : null);
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1] + 1, instance, new string[7] { "HingeAxis", "RotOut", "CanUnlatch", "IsHighPressureTolerant", "m_isHammerCocked", "m_isDestroyed", "CocksOnOpen" }, null, 0uL, 0uL);
}
else if (Object is SimpleLauncher)
{
FVRInteractiveObject object10 = Object;
SimpleLauncher instance2 = (SimpleLauncher)(object)((object10 is SimpleLauncher) ? object10 : null);
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1] + 1, instance2, new string[5] { "HasTrigger", "AlsoPlaysSuppressedSound", "DeletesCartridgeOnFire", "FireOnCol", "ColThresh" }, null, 0uL, 0uL);
}
else if (Object is BoltActionRifle)
{
FVRInteractiveObject object11 = Object;
BoltActionRifle val8 = (BoltActionRifle)(object)((object11 is BoltActionRifle) ? object11 : null);
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1] + 1, val8, new string[4] { "HasMagEjectionButton", "m_isHammerCocked", "EjectsMagazineOnEmpty", "HasMagEjectionButton" }, null, 0uL, 0uL);
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1] + 1, val8.BoltHandle, new string[5] { "UsesQuickRelease", "BaseRotOffset", "MinRot", "MaxRot", "UnlockThreshold" }, null, 0uL, 0uL);
}
else if (Object is Revolver)
{
FVRInteractiveObject object12 = Object;
Revolver instance3 = (Revolver)(object)((object12 is Revolver) ? object12 : null);
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1] + 1, instance3, new string[7] { "AllowsSuppressor", "CanManuallyCockHammer", "m_isHammerLocked", "m_isCylinderArmLocked", "CylinderRotRange", "IsCylinderArmZ", "GravityRotsCylinderPositive" }, null, 0uL, 0uL);
}
else if (Object is SingleActionRevolver)
{
FVRInteractiveObject object13 = Object;
SingleActionRevolver instance4 = (SingleActionRevolver)(object)((object13 is SingleActionRevolver) ? object13 : null);
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1] + 1, instance4, new string[4] { "AllowsSuppressor", "DoesCylinderTranslateForward", "DoesHalfCockHalfRotCylinder", "HasTransferBarSafety" }, null, 0uL, 0uL);
}
else if (Object is LAPD2019)
{
FVRInteractiveObject object14 = Object;
LAPD2019 val9 = (LAPD2019)(object)((object14 is LAPD2019) ? object14 : null);
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1] + 1, val9, new string[10] { "m_isCylinderArmLocked", "CylinderRotRange", "GravityRotsCylinderPositive", "m_isAutoChargeEnabled", "m_hasBattery", "m_batteryCharge", "m_hasThermalClip", "m_heatThermalClip", "m_heatSystem", "m_barrelHeatDamage" }, null, 0uL, 0uL);
m_columnStarts[2] = AddObjectControls(Columns[2], m_columnStarts[2], val9.BoltHandle, new string[5] { "UsesQuickRelease", "BaseRotOffset", "MinRot", "MaxRot", "UnlockThreshold" }, null, 0uL, 0uL);
}
else if (Object is RevolvingShotgun)
{
FVRInteractiveObject object15 = Object;
RevolvingShotgun val10 = (RevolvingShotgun)(object)((object15 is RevolvingShotgun) ? object15 : null);
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1] + 1, val10, new string[4] { "DoesFiringRecock", "CylinderLoaded", "IsCylinderRotClockwise", "EjectCylinder" }, null, 0uL, 8uL);
AddObjectControls(Columns[2], 15, val10.FireSelector_Modes[val10.FireSelectorModeIndex], new string[1] { "ModeType" }, null, 1uL, 0uL);
}
}
else if (Object is FVRFireArmRound)
{
ref int reference = ref m_columnStarts[1];
Vector2 startOffset2 = Columns[1];
int startIndex = m_columnStarts[1];
FVRInteractiveObject object16 = Object;
reference = AddObjectControls(startOffset2, startIndex, (object16 is FVRFireArmRound) ? object16 : null, new string[13]
{
"RoundType", "RoundClass", "IsHighPressure", "NumProjectiles", "ProjectileSpread", "IsDestroyedAfterCounter", "m_isKillCounting", "isCookingOff", "isManuallyChamberable", "IsCaseless",
"isMagazineLoadable", "isPalmable", "MaxPalmedAmount"
}, null, 0uL, 0uL);
}
else if (Object is PinnedGrenade)
{
ref int reference2 = ref m_columnStarts[1];
Vector2 startOffset3 = Columns[1];
int startIndex2 = m_columnStarts[1];
FVRInteractiveObject object17 = Object;
reference2 = AddObjectControls(startOffset3, startIndex2, (object17 is FVRGrenade) ? object17 : null, new string[3] { "ReleaseLever", "DefaultFuse", "HasImpactFuse" }, null, 0uL, 1uL);
}
else if (Object is MF2_Medigun)
{
ref int reference3 = ref m_columnStarts[1];
Vector2 startOffset4 = Columns[1];
int startIndex3 = m_columnStarts[1];
FVRInteractiveObject object18 = Object;
reference3 = AddObjectControls(startOffset4, startIndex3, (object18 is MF2_Medigun) ? object18 : null, new string[7] { "EngageRange", "MaxRange", "TryEngageBeam", "EngageUber", "DisEngageBeam", "m_uberChargeUp", "m_uberChargeOut" }, null, 96uL, 28uL);
}
else if ((Object)(object)((Component)Object).GetComponent<SosigLink>() != (Object)null)
{
SosigLink component = ((Component)Object).GetComponent<SosigLink>();
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1], component.S, new string[11]
{
"ClearSosig", "", "BodyState", "CurrentOrder", "Mustard", "BleedDamageMult", "BleedRateMult", "Speed_Crawl", "Speed_Sneak", "Speed_Walk",
"Speed_Run"
}, null, 28uL, 1uL);
m_columnStarts[2] = AddObjectControls(Columns[2], m_columnStarts[2], component, new string[3] { "m_integrity", "StaggerMagnitude", "DamMult" }, null, 1uL, 0uL);
m_columnStarts[2] = AddObjectControls(Columns[2], m_columnStarts[2] + 1, component.S.E, new string[1] { "IFFCode" }, null, 0uL, 0uL);
}
else if (Object is SosigWeaponPlayerInterface)
{
ref int reference4 = ref m_columnStarts[1];
Vector2 startOffset5 = Columns[1];
int startIndex4 = m_columnStarts[1];
FVRInteractiveObject object19 = Object;
reference4 = AddObjectControls(startOffset5, startIndex4, ((SosigWeaponPlayerInterface)((object19 is SosigWeaponPlayerInterface) ? object19 : null)).W, new string[9] { "CycleSpeedForward", "CycleSpeedBackward", "ShotsPerLoad", "m_shotsLeft", "ProjectilesPerShot", "ProjectileSpread", "isFullAuto", "ReloadTime", "BurstLimit" }, null, 0uL, 0uL);
}
else if (Object is RW_Powerup)
{
ref int reference5 = ref m_columnStarts[1];
Vector2 startOffset6 = Columns[1];
int startIndex5 = m_columnStarts[1];
FVRInteractiveObject object20 = Object;
reference5 = AddObjectControls(startOffset6, startIndex5, (object20 is RW_Powerup) ? object20 : null, new string[5] { "PowerupType", "PowerupIntensity", "PowerupDuration", "Cooked", "UpdateSymbols" }, null, 0uL, 16uL);
}
else if (Object is ShatterablePhysicalObject)
{
ref int reference6 = ref m_columnStarts[1];
Vector2 startOffset7 = Columns[1];
int startIndex6 = m_columnStarts[1];
FVRInteractiveObject object21 = Object;
reference6 = AddObjectControls(startOffset7, startIndex6, (object21 is ShatterablePhysicalObject) ? object21 : null, new string[4] { "currentToughness", "TransfersVelocityExplosively", "DamageReceivedMultiplier", "CollisionShatterThreshold" }, null, 0uL, 0uL);
}
else if ((Object)(object)((Component)Object).GetComponent<RotrwBangerJunk>() != (Object)null)
{
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1], ((Component)Object).GetComponent<RotrwBangerJunk>(), new string[2] { "Type", "ContainerSize" }, null, 0uL, 0uL);
}
else if (Object is Banger)
{
FVRInteractiveObject object22 = Object;
Banger val11 = (Banger)(object)((object22 is Banger) ? object22 : null);
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1], val11, new string[12]
{
"BType", "BSize", "m_isArmed", "m_timeToPayload", "ProxRange", "m_timeSinceArmed", "m_shrapnelVel", "m_isSticky", "m_isSilent", "m_isHoming",
"m_canbeshot", "SetToBouncy"
}, null, 0uL, 2048uL);
if ((Object)(object)val11.BDial != (Object)null)
{
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1], val11.BDial, new string[3] { "DialTick", "m_isPrimed", "m_hasDinged" }, null, 0uL, 0uL);
}
}
else if (Object is BangerDetonator)
{
ref int reference7 = ref m_columnStarts[1];
Vector2 startOffset8 = Columns[1];
int startIndex7 = m_columnStarts[1];
FVRInteractiveObject object23 = Object;
reference7 = AddObjectControls(startOffset8, startIndex7, (object23 is BangerDetonator) ? object23 : null, new string[2] { "Detonate", "TriggerRange" }, null, 0uL, 1uL);
}
else if (Object is GronchHatCase)
{
ref int reference8 = ref m_columnStarts[1];
Vector2 startOffset9 = Columns[1];
int startIndex8 = m_columnStarts[1];
FVRInteractiveObject object24 = Object;
reference8 = AddObjectControls(startOffset9, startIndex8, (object24 is GronchHatCase) ? object24 : null, new string[2] { "m_isOpen", "HID" }, null, 0uL, 0uL);
}
else if ((Object)(object)((Component)Object).GetComponent<FVRFireArmAttachment>() != (Object)null && (Object)(object)((Component)Object).GetComponent<FVRFireArmAttachment>().AttachmentInterface != (Object)null)
{
RefreshObjectControls_AttachmentInterfaces(((Component)Object).GetComponent<FVRFireArmAttachment>().AttachmentInterface);
}
}
else if (Object != null && Object is FVRFireArmAttachmentInterface)
{
FVRInteractiveObject object25 = Object;
RefreshObjectControls_AttachmentInterfaces((FVRFireArmAttachmentInterface)(object)((object25 is FVRFireArmAttachmentInterface) ? object25 : null));
}
}
public void RefreshObjectControls_AttachmentInterfaces(FVRFireArmAttachmentInterface attachInterface)
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
if (attachInterface is Amplifier && (Object)(object)((Amplifier)((attachInterface is Amplifier) ? attachInterface : null)).ScopeCam != (Object)null)
{
m_columnStarts[1] = AddObjectControls(Columns[1], m_columnStarts[1], ((Amplifier)((attachInterface is Amplifier) ? attachInterface : null)).ScopeCam, new string[10] { "OnEnable", "Magnification", "Resolution", "AngleBlurStrength", "CutoffSoftness", "AngularOccludeSensitivity", "ReticuleScale", "MagnificationEnabledAtStart", "LensSpaceDistortion", "LensChromaticDistortion" }, null, 0uL, 1uL);
}
}
}
public class ModPanelV2Page_Index : ModPanelV2Page
{
[Header("Index Page")]
public Text H3InfoText;
public Text[] PageButtons;
public override void PageOpen()
{
base.PageOpen();
if ((Object)(object)Panel != (Object)null)
{
Text[] pageButtons = PageButtons;
for (int i = 0; i < pageButtons.Length; i++)
{
((Component)pageButtons[i]).gameObject.SetActive(false);
}
for (int j = 0; j < Panel.Pages.Count; j++)
{
PageButtons[j].text = Panel.Pages[j].PageTitle;
((Component)PageButtons[j]).gameObject.SetActive(true);
}
}
}
public override void PageTick()
{
base.PageTick();
if ((Object)(object)H3InfoText != (Object)null)
{
H3InfoText.text = Helpers.H3InfoPrint((H3Info)int.MaxValue, true);
}
}
public void GotoPanelPage(int page)
{
if ((Object)(object)Panel != (Object)null)
{
Panel.SwitchPage(page);
}
}
}
public class ModPanelV2Page_Scene : ModPanelV2Page
{
[Header("Scene Page")]
public Vector2[] Columns = (Vector2[])(object)new Vector2[3]
{
new Vector2(20f, -16f),
new Vector2(130f, -16f),
new Vector2(240f, -16f)
};
private int[] m_columnStarts = new int[3];
private int m_playerIFF = -3;
private PowerupType m_powerupType = (PowerupType)2;
private PowerUpIntensity m_powerupIntensity;
private PowerUpDuration m_powerupDuration = (PowerUpDuration)4;
private bool m_powerupInverted;
private float m_powerupDurationOverride = -1f;
private FVRSoundEnvironment m_soundEnv = (FVRSoundEnvironment)1;
public override void PageInit()
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
base.PageInit();
if ((Object)(object)GM.CurrentSceneSettings != (Object)null)
{
m_soundEnv = GM.CurrentSceneSettings.DefaultSoundEnvironment;
}
}
public override void PageOpen()
{
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
//IL_016f: Unknown result type (might be due to invalid IL or missing references)
//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
//IL_0236: Unknown result type (might be due to invalid IL or missing references)
//IL_026d: Unknown result type (might be due to invalid IL or missing references)
base.PageOpen();
if (ObjectControls.Count <= 0)
{
if ((Object)(object)GM.CurrentSceneSettings != (Object)null)
{
m_columnStarts[0] = AddObjectControls(Columns[0], m_columnStarts[0], GM.CurrentSceneSettings, new string[14]
{
"IsSpawnLockingEnabled", "DoesDamageGetRegistered", "MaxProjectileRange", "ForcesCasingDespawn", "DoesTeleportUseCooldown", "DoesAllowAirControl", "UsesPlayerCatcher", "CatchHeight", "DefaultPlayerIFF", "IsQuickbeltSwappingAllowed",
"IsSceneLowLight", "IsAmmoInfinite", "AllowsInfiniteAmmoMags", "UsesUnlockSystem"
}, null, 0uL, 0uL);
}
if ((Object)(object)GM.CurrentPla