using System;
using System.Collections;
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 BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using FistVR;
using Microsoft.CodeAnalysis;
using Sodalite;
using Sodalite.Api;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyCompany("JalexInteractive")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Customisable player trails for H3VR!")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("JalexInteractive.PlayerTrails")]
[assembly: AssemblyTitle("Player Trails")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace BepInEx
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
[Conditional("CodeGeneration")]
internal sealed class BepInAutoPluginAttribute : Attribute
{
public BepInAutoPluginAttribute(string id = null, string name = null, string version = null)
{
}
}
}
namespace BepInEx.Preloader.Core.Patching
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
[Conditional("CodeGeneration")]
internal sealed class PatcherAutoPluginAttribute : Attribute
{
public PatcherAutoPluginAttribute(string id = null, string name = null, string version = null)
{
}
}
}
namespace JalexInteractive
{
public class ButtonColourToggle : MonoBehaviour
{
public enum Type
{
Single,
Multi
}
public Type typeOfSet;
public List<Text> buttons;
public void AllSwitch(bool allSwitch)
{
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: 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_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
if (allSwitch)
{
foreach (Text button in buttons)
{
((Graphic)button).color = new Color(((Graphic)button).color.r, ((Graphic)button).color.g, ((Graphic)button).color.b, 1f);
}
return;
}
foreach (Text button2 in buttons)
{
((Graphic)button2).color = new Color(((Graphic)button2).color.r, ((Graphic)button2).color.g, ((Graphic)button2).color.b, 0.1f);
}
}
public void DoIt(int selected)
{
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_0140: Unknown result type (might be due to invalid IL or missing references)
//IL_014f: 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)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: 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_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Unknown result type (might be due to invalid IL or missing references)
//IL_0183: Unknown result type (might be due to invalid IL or missing references)
//IL_0199: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_01be: Unknown result type (might be due to invalid IL or missing references)
if (typeOfSet == Type.Single)
{
if (((Graphic)buttons[selected]).color.a == 0.1f)
{
((Graphic)buttons[selected]).color = new Color(((Graphic)buttons[selected]).color.r, ((Graphic)buttons[selected]).color.g, ((Graphic)buttons[selected]).color.b, 1f);
}
else
{
((Graphic)buttons[selected]).color = new Color(((Graphic)buttons[selected]).color.r, ((Graphic)buttons[selected]).color.g, ((Graphic)buttons[selected]).color.b, 0.1f);
}
return;
}
((Graphic)buttons[selected]).color = new Color(((Graphic)buttons[selected]).color.r, ((Graphic)buttons[selected]).color.g, ((Graphic)buttons[selected]).color.b, 1f);
for (int i = 0; i <= buttons.Count; i++)
{
if (i != selected)
{
((Graphic)buttons[selected]).color = new Color(((Graphic)buttons[selected]).color.r, ((Graphic)buttons[selected]).color.g, ((Graphic)buttons[selected]).color.b, 0.1f);
}
}
}
}
public class NGAPointableScrollbar : FVRPointable
{
public Scrollbar Scrollbar;
public RectTransform TrackRect;
private Collider _col;
private bool _grabbing;
private FVRViveHand _grabHand;
private Plane _dragPlane;
private float _grabOffset01;
private bool _vertical;
private bool _reversed;
private float _usableMinLocal;
private float _usableMaxLocal;
private void Awake()
{
_col = ((Component)this).GetComponent<Collider>();
if ((Object)(object)Scrollbar == (Object)null)
{
Scrollbar = ((Component)this).GetComponentInParent<Scrollbar>();
}
if ((Object)(object)TrackRect == (Object)null && (Object)(object)Scrollbar != (Object)null)
{
TrackRect = ((Component)Scrollbar).GetComponent<RectTransform>();
}
}
public override void Update()
{
//IL_0053: 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_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: 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_0076: 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_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: 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_010a: 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)
((FVRPointable)this).Update();
if (_grabbing && !((Object)(object)_grabHand == (Object)null) && !((Object)(object)Scrollbar == (Object)null) && !((Object)(object)TrackRect == (Object)null))
{
Vector3 oneEuroPointingPos = ((HandInput)(ref _grabHand.Input)).OneEuroPointingPos;
Vector3 val = _grabHand.Input.OneEuroPointRotation * Vector3.forward;
Ray val2 = default(Ray);
((Ray)(ref val2))..ctor(oneEuroPointingPos, val);
float num = default(float);
if (_grabHand.Input.TriggerUp || _grabHand.Input.GripUp)
{
_grabbing = false;
_grabHand = null;
}
else if (((Plane)(ref _dragPlane)).Raycast(val2, ref num))
{
Vector3 point = ((Ray)(ref val2)).GetPoint(num);
Vector3 val3 = ((Transform)TrackRect).InverseTransformPoint(point);
float num2 = (_vertical ? val3.y : val3.x);
float num3 = Mathf.InverseLerp(_usableMinLocal, _usableMaxLocal, num2);
num3 = Mathf.Clamp01(num3);
float num4 = (_reversed ? (1f - num3) : num3);
Scrollbar.value = Mathf.Clamp01(num4 - _grabOffset01);
}
}
}
public override void OnPoint(FVRViveHand hand)
{
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: 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_0071: 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_007a: 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_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
((FVRPointable)this).OnPoint(hand);
if ((Object)(object)_col == (Object)null || (Object)(object)Scrollbar == (Object)null || (Object)(object)TrackRect == (Object)null || _grabbing)
{
return;
}
Vector3 oneEuroPointingPos = ((HandInput)(ref hand.Input)).OneEuroPointingPos;
Vector3 val = hand.Input.OneEuroPointRotation * Vector3.forward;
Ray val2 = default(Ray);
((Ray)(ref val2))..ctor(oneEuroPointingPos, val);
if (hand.Input.TriggerDown || hand.Input.GripDown)
{
float num = Mathf.Max(base.MaxPointingRange, 0.01f);
RaycastHit val3 = default(RaycastHit);
if (_col.Raycast(val2, ref val3, num))
{
BeginGrab(hand, val2);
}
}
}
private void BeginGrab(FVRViveHand hand, Ray ray)
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Invalid comparison between Unknown and I4
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Invalid comparison between Unknown and I4
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Invalid comparison between Unknown and I4
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Invalid comparison between Unknown and I4
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: 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_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: 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)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: 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_01b8: Unknown result type (might be due to invalid IL or missing references)
//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
//IL_01c5: 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_01cc: Unknown result type (might be due to invalid IL or missing references)
//IL_01df: Unknown result type (might be due to invalid IL or missing references)
//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
_grabbing = true;
_grabHand = hand;
_vertical = (int)Scrollbar.direction == 2 || (int)Scrollbar.direction == 3;
_reversed = (int)Scrollbar.direction == 1 || (int)Scrollbar.direction == 3;
_dragPlane = new Plane(((Transform)TrackRect).forward, ((Transform)TrackRect).position);
Rect rect;
float num;
if (!_vertical)
{
rect = TrackRect.rect;
num = ((Rect)(ref rect)).xMin;
}
else
{
rect = TrackRect.rect;
num = ((Rect)(ref rect)).yMin;
}
float num2 = num;
float num3;
if (!_vertical)
{
rect = TrackRect.rect;
num3 = ((Rect)(ref rect)).xMax;
}
else
{
rect = TrackRect.rect;
num3 = ((Rect)(ref rect)).yMax;
}
float num4 = num3;
float num5 = 0f;
if ((Object)(object)Scrollbar.handleRect != (Object)null)
{
float num6;
if (!_vertical)
{
rect = Scrollbar.handleRect.rect;
num6 = ((Rect)(ref rect)).width;
}
else
{
rect = Scrollbar.handleRect.rect;
num6 = ((Rect)(ref rect)).height;
}
num5 = num6;
}
float num7 = num5 * 0.5f;
_usableMinLocal = num2 + num7;
_usableMaxLocal = num4 - num7;
if (Mathf.Abs(_usableMaxLocal - _usableMinLocal) < 0.0001f)
{
_usableMinLocal = num2;
_usableMaxLocal = num4;
}
float num8 = Scrollbar.value;
float num9 = default(float);
if (((Plane)(ref _dragPlane)).Raycast(ray, ref num9))
{
Vector3 point = ((Ray)(ref ray)).GetPoint(num9);
Vector3 val = ((Transform)TrackRect).InverseTransformPoint(point);
float num10 = (_vertical ? val.y : val.x);
float num11 = Mathf.InverseLerp(_usableMinLocal, _usableMaxLocal, num10);
num11 = Mathf.Clamp01(num11);
num8 = (_reversed ? (1f - num11) : num11);
}
_grabOffset01 = num8 - Scrollbar.value;
}
public override void EndPoint(FVRViveHand hand)
{
((FVRPointable)this).EndPoint(hand);
}
}
public class NGAScrollPointable : FVRPointable
{
private ScrollRect _scrollRect;
public float scrollSpeed = 5000f;
private void Awake()
{
_scrollRect = ((Component)this).GetComponent<ScrollRect>();
}
public override void Update()
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_0128: Unknown result type (might be due to invalid IL or missing references)
//IL_014f: Unknown result type (might be due to invalid IL or missing references)
//IL_0161: Unknown result type (might be due to invalid IL or missing references)
if (!base.m_isBeingPointedAt)
{
return;
}
Vector2 val = Vector2.zero;
foreach (FVRViveHand pointingHand in base.PointingHands)
{
if (!Mathf.Approximately(((Vector2)(ref pointingHand.Input.TouchpadAxes)).sqrMagnitude, 0f))
{
val = pointingHand.Input.TouchpadAxes;
break;
}
}
if (Object.op_Implicit((Object)(object)_scrollRect) && val != Vector2.zero)
{
if (_scrollRect.vertical && Mathf.Abs(val.y) > 0.01f)
{
float y = _scrollRect.content.sizeDelta.y;
float num = scrollSpeed * val.y * Time.deltaTime;
float num2 = _scrollRect.verticalNormalizedPosition + num / y;
_scrollRect.verticalNormalizedPosition = Mathf.Clamp01(num2);
}
if (_scrollRect.horizontal && Mathf.Abs(val.x) > 0.01f)
{
float x = _scrollRect.content.sizeDelta.x;
float num3 = scrollSpeed * val.x * Time.deltaTime;
float num4 = _scrollRect.horizontalNormalizedPosition + num3 / x;
_scrollRect.horizontalNormalizedPosition = Mathf.Clamp01(num4);
}
}
}
}
public class PlayerTrailsPanel : MonoBehaviour
{
public static int currentlyEditing = 0;
private static TrailRenderer trailClone;
public static Image rawImage;
public static GameObject rawImageGO;
public static Vector3 rawImageBasePos;
public static GameObject newPanel = null;
public static List<string> fileList;
public static List<Image> imageList = new List<Image>();
private static Text t_head_t;
private static Text t_lHand_t;
private static Text t_rHand_t;
private static Text t_head_o;
private static Text t_lHand_o;
private static Text t_rHand_o;
private static Slider s_x_o;
private static Slider s_y_o;
private static Slider s_z_o;
private static Text t_xv_o;
private static Text t_yv_o;
private static Text t_zv_o;
public static int startOrEndColour = 0;
private static Text t_startColour;
private static Text t_endColour;
private static Image i_colourSwatch;
private static Color32 currentColor;
private static Slider s_r_m;
private static Slider s_g_m;
private static Slider s_b_m;
private static Slider s_a_m;
private static Text t_rv_m;
private static Text t_gv_m;
private static Text t_bv_m;
private static Text t_av_m;
private static Text t_head_tr;
private static Text t_lHand_tr;
private static Text t_rHand_tr;
private static Slider s_t_tr;
private static Slider s_s_tr;
private static Slider s_e_tr;
private static Text t_tv_tr;
private static Text t_sv_tr;
private static Text t_ev_tr;
private void Awake()
{
//IL_049d: Unknown result type (might be due to invalid IL or missing references)
//IL_04a2: Unknown result type (might be due to invalid IL or missing references)
//IL_06bd: Unknown result type (might be due to invalid IL or missing references)
//IL_06c2: Unknown result type (might be due to invalid IL or missing references)
//IL_0732: Unknown result type (might be due to invalid IL or missing references)
currentlyEditing = 0;
Component component = ((Component)((Component)this).transform.Find("Canvas/TogglesPage/Body")).gameObject.GetComponent(typeof(Text));
t_head_t = (Text)(object)((component is Text) ? component : null);
ColourFlip(t_head_t, PlayerTrails.cfg_bodyEnabled.Value);
Component component2 = ((Component)((Component)this).transform.Find("Canvas/TogglesPage/LHand")).gameObject.GetComponent(typeof(Text));
t_lHand_t = (Text)(object)((component2 is Text) ? component2 : null);
ColourFlip(t_lHand_t, PlayerTrails.cfg_lHandEnabled.Value);
Component component3 = ((Component)((Component)this).transform.Find("Canvas/TogglesPage/RHand")).gameObject.GetComponent(typeof(Text));
t_rHand_t = (Text)(object)((component3 is Text) ? component3 : null);
ColourFlip(t_rHand_t, PlayerTrails.cfg_rHandEnabled.Value);
Component component4 = ((Component)((Component)this).transform.Find("Canvas/OffsetsPage/Body")).gameObject.GetComponent(typeof(Text));
t_head_o = (Text)(object)((component4 is Text) ? component4 : null);
Component component5 = ((Component)((Component)this).transform.Find("Canvas/OffsetsPage/LHand")).gameObject.GetComponent(typeof(Text));
t_lHand_o = (Text)(object)((component5 is Text) ? component5 : null);
Component component6 = ((Component)((Component)this).transform.Find("Canvas/OffsetsPage/RHand")).gameObject.GetComponent(typeof(Text));
t_rHand_o = (Text)(object)((component6 is Text) ? component6 : null);
ColourFlipSingle(currentlyEditing, t_head_o, t_lHand_o, t_rHand_o);
Component component7 = ((Component)((Component)this).transform.Find("Canvas/OffsetsPage/Sliders/X")).gameObject.GetComponent(typeof(Slider));
s_x_o = (Slider)(object)((component7 is Slider) ? component7 : null);
Component component8 = ((Component)((Component)this).transform.Find("Canvas/OffsetsPage/Sliders/Y")).gameObject.GetComponent(typeof(Slider));
s_y_o = (Slider)(object)((component8 is Slider) ? component8 : null);
Component component9 = ((Component)((Component)this).transform.Find("Canvas/OffsetsPage/Sliders/Z")).gameObject.GetComponent(typeof(Slider));
s_z_o = (Slider)(object)((component9 is Slider) ? component9 : null);
Component component10 = ((Component)((Component)this).transform.Find("Canvas/OffsetsPage/Sliders/X/Value")).gameObject.GetComponent(typeof(Text));
t_xv_o = (Text)(object)((component10 is Text) ? component10 : null);
Component component11 = ((Component)((Component)this).transform.Find("Canvas/OffsetsPage/Sliders/Y/Value")).gameObject.GetComponent(typeof(Text));
t_yv_o = (Text)(object)((component11 is Text) ? component11 : null);
Component component12 = ((Component)((Component)this).transform.Find("Canvas/OffsetsPage/Sliders/Z/Value")).gameObject.GetComponent(typeof(Text));
t_zv_o = (Text)(object)((component12 is Text) ? component12 : null);
Component component13 = ((Component)((Component)this).transform.Find("Canvas/MaterialPage/StartColour")).gameObject.GetComponent(typeof(Text));
t_startColour = (Text)(object)((component13 is Text) ? component13 : null);
Component component14 = ((Component)((Component)this).transform.Find("Canvas/MaterialPage/EndColour")).gameObject.GetComponent(typeof(Text));
t_endColour = (Text)(object)((component14 is Text) ? component14 : null);
ColourFlipSingle(currentlyEditing, t_startColour, t_endColour);
Component component15 = ((Component)((Component)this).transform.Find("Canvas/MaterialPage/ColourSwatch")).gameObject.GetComponent(typeof(Image));
i_colourSwatch = (Image)(object)((component15 is Image) ? component15 : null);
Component component16 = ((Component)((Component)this).transform.Find("Canvas/MaterialPage/Sliders/R")).gameObject.GetComponent(typeof(Slider));
s_r_m = (Slider)(object)((component16 is Slider) ? component16 : null);
Component component17 = ((Component)((Component)this).transform.Find("Canvas/MaterialPage/Sliders/G")).gameObject.GetComponent(typeof(Slider));
s_g_m = (Slider)(object)((component17 is Slider) ? component17 : null);
Component component18 = ((Component)((Component)this).transform.Find("Canvas/MaterialPage/Sliders/B")).gameObject.GetComponent(typeof(Slider));
s_b_m = (Slider)(object)((component18 is Slider) ? component18 : null);
Component component19 = ((Component)((Component)this).transform.Find("Canvas/MaterialPage/Sliders/A")).gameObject.GetComponent(typeof(Slider));
s_a_m = (Slider)(object)((component19 is Slider) ? component19 : null);
Component component20 = ((Component)((Component)this).transform.Find("Canvas/MaterialPage/Sliders/R/Value")).gameObject.GetComponent(typeof(Text));
t_rv_m = (Text)(object)((component20 is Text) ? component20 : null);
Component component21 = ((Component)((Component)this).transform.Find("Canvas/MaterialPage/Sliders/G/Value")).gameObject.GetComponent(typeof(Text));
t_gv_m = (Text)(object)((component21 is Text) ? component21 : null);
Component component22 = ((Component)((Component)this).transform.Find("Canvas/MaterialPage/Sliders/B/Value")).gameObject.GetComponent(typeof(Text));
t_bv_m = (Text)(object)((component22 is Text) ? component22 : null);
Component component23 = ((Component)((Component)this).transform.Find("Canvas/MaterialPage/Sliders/A/Value")).gameObject.GetComponent(typeof(Text));
t_av_m = (Text)(object)((component23 is Text) ? component23 : null);
currentColor = PlayerTrails.startColour;
Component component24 = ((Component)((Component)this).transform.Find("Canvas/TrailPage/Body")).gameObject.GetComponent(typeof(Text));
t_head_tr = (Text)(object)((component24 is Text) ? component24 : null);
Component component25 = ((Component)((Component)this).transform.Find("Canvas/TrailPage/LHand")).gameObject.GetComponent(typeof(Text));
t_lHand_tr = (Text)(object)((component25 is Text) ? component25 : null);
Component component26 = ((Component)((Component)this).transform.Find("Canvas/TrailPage/RHand")).gameObject.GetComponent(typeof(Text));
t_rHand_tr = (Text)(object)((component26 is Text) ? component26 : null);
ColourFlipSingle(currentlyEditing, t_head_tr, t_lHand_tr, t_rHand_tr);
Component component27 = ((Component)((Component)this).transform.Find("Canvas/TrailPage/Sliders/Time")).gameObject.GetComponent(typeof(Slider));
s_t_tr = (Slider)(object)((component27 is Slider) ? component27 : null);
Component component28 = ((Component)((Component)this).transform.Find("Canvas/TrailPage/Sliders/StartWidth")).gameObject.GetComponent(typeof(Slider));
s_s_tr = (Slider)(object)((component28 is Slider) ? component28 : null);
Component component29 = ((Component)((Component)this).transform.Find("Canvas/TrailPage/Sliders/EndWidth")).gameObject.GetComponent(typeof(Slider));
s_e_tr = (Slider)(object)((component29 is Slider) ? component29 : null);
Component component30 = ((Component)((Component)this).transform.Find("Canvas/TrailPage/Sliders/Time/Value")).gameObject.GetComponent(typeof(Text));
t_tv_tr = (Text)(object)((component30 is Text) ? component30 : null);
Component component31 = ((Component)((Component)this).transform.Find("Canvas/TrailPage/Sliders/StartWidth/Value")).gameObject.GetComponent(typeof(Text));
t_sv_tr = (Text)(object)((component31 is Text) ? component31 : null);
Component component32 = ((Component)((Component)this).transform.Find("Canvas/TrailPage/Sliders/EndWidth/Value")).gameObject.GetComponent(typeof(Text));
t_ev_tr = (Text)(object)((component32 is Text) ? component32 : null);
SwitchEditing(0);
SwitchStartOrEndColour(0);
CreateFileList();
Component component33 = ((Component)((Component)this).transform.Find("Canvas/MaterialPage/Textures/TexturesPanel/Viewport/ContentFrame/RawImage")).gameObject.GetComponent(typeof(Image));
rawImage = (Image)(object)((component33 is Image) ? component33 : null);
rawImageGO = ((Component)rawImage).gameObject;
rawImageBasePos = rawImageGO.transform.localPosition;
MaterialActiveSwitched();
Transform val = ((Component)this).transform.Find("TrailAnchor");
if (!Object.op_Implicit((Object)(object)val))
{
PlayerTrails.Logger.LogError((object)"Trail anchor found for trail reference");
}
if ((Object)(object)PlayerTrails.body != (Object)null)
{
Object.Instantiate<GameObject>(PlayerTrails.body, val);
Transform child = val.GetChild(0);
child.localPosition = new Vector3(0f, 0f, 0f);
((Component)child).gameObject.SetActive(true);
Component component34 = ((Component)child).gameObject.GetComponent(typeof(TrailRenderer));
trailClone = (TrailRenderer)(object)((component34 is TrailRenderer) ? component34 : null);
}
else
{
PlayerTrails.Logger.LogError((object)"Body not found for trail reference");
}
}
public static void CreateFileList()
{
string[] files = Directory.GetFiles(PlayerTrails.basePath);
string[] array = files;
List<string> list = new List<string>(array.Length);
list.AddRange(array);
fileList = list;
for (int i = 0; i < fileList.Count; i++)
{
string extension = Path.GetExtension(fileList[i].ToLower());
if (extension != ".png" && extension != ".jpg" && extension != ".jpeg")
{
fileList.Remove(fileList[i]);
}
}
PlayerTrails.Logger.LogMessage((object)("~~ Discovered " + fileList.Count + " valid textures ~~"));
foreach (string file in fileList)
{
PlayerTrails.Logger.LogMessage((object)file);
}
}
public void ColourFlip(Text flipMe, bool onOff)
{
//IL_003f: 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_0055: 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_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: 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)
if (onOff)
{
((Graphic)flipMe).color = new Color(((Graphic)flipMe).color.r, ((Graphic)flipMe).color.g, ((Graphic)flipMe).color.b, 1f);
}
else
{
((Graphic)flipMe).color = new Color(((Graphic)flipMe).color.r, ((Graphic)flipMe).color.g, ((Graphic)flipMe).color.b, 0.1f);
}
}
public void SwitchEditing(int switchTo)
{
currentlyEditing = switchTo;
ColourFlipSingle(switchTo, t_head_o, t_lHand_o, t_rHand_o);
ColourFlipSingle(switchTo, t_head_tr, t_lHand_tr, t_rHand_tr);
OffsetActiveSwitched();
PropertiesActiveSwitched();
switch (switchTo)
{
case 0:
trailClone = PlayerTrails.bodyTrail;
break;
case 1:
trailClone = PlayerTrails.lHandTrail;
break;
case 2:
trailClone = PlayerTrails.rHandTrail;
break;
}
}
public void SwitchStartOrEndColour(int switchTo)
{
startOrEndColour = switchTo;
ColourFlipSingle(switchTo, t_startColour, t_endColour);
MaterialActiveSwitched();
}
public void ColourFlipSingle(int selected, Text x, Text y, Text z = null)
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: 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_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: 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_00fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: 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_0176: Unknown result type (might be due to invalid IL or missing references)
//IL_0181: Unknown result type (might be due to invalid IL or missing references)
//IL_018c: Unknown result type (might be due to invalid IL or missing references)
//IL_019b: Unknown result type (might be due to invalid IL or missing references)
//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
//IL_01be: Unknown result type (might be due to invalid IL or missing references)
//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: 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_0148: Unknown result type (might be due to invalid IL or missing references)
//IL_0154: Unknown result type (might be due to invalid IL or missing references)
//IL_0163: Unknown result type (might be due to invalid IL or missing references)
//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0202: Unknown result type (might be due to invalid IL or missing references)
//IL_0211: Unknown result type (might be due to invalid IL or missing references)
switch (selected)
{
case 0:
((Graphic)x).color = new Color(((Graphic)x).color.r, ((Graphic)x).color.g, ((Graphic)x).color.b, 1f);
((Graphic)y).color = new Color(((Graphic)y).color.r, ((Graphic)y).color.g, ((Graphic)y).color.b, 0.1f);
if (Object.op_Implicit((Object)(object)z))
{
((Graphic)z).color = new Color(((Graphic)z).color.r, ((Graphic)z).color.g, ((Graphic)z).color.b, 0.1f);
}
break;
case 1:
((Graphic)x).color = new Color(((Graphic)x).color.r, ((Graphic)x).color.g, ((Graphic)x).color.b, 0.1f);
((Graphic)y).color = new Color(((Graphic)y).color.r, ((Graphic)y).color.g, ((Graphic)y).color.b, 1f);
if (Object.op_Implicit((Object)(object)z))
{
((Graphic)z).color = new Color(((Graphic)z).color.r, ((Graphic)z).color.g, ((Graphic)z).color.b, 0.1f);
}
break;
case 2:
((Graphic)x).color = new Color(((Graphic)x).color.r, ((Graphic)x).color.g, ((Graphic)x).color.b, 0.1f);
((Graphic)y).color = new Color(((Graphic)y).color.r, ((Graphic)y).color.g, ((Graphic)y).color.b, 0.1f);
if (Object.op_Implicit((Object)(object)z))
{
((Graphic)z).color = new Color(((Graphic)z).color.r, ((Graphic)z).color.g, ((Graphic)z).color.b, 1f);
}
break;
}
z = null;
}
public void ActiveFlip(int flipMe)
{
switch (flipMe)
{
case 0:
PlayerTrails.body.SetActive(!PlayerTrails.body.activeSelf);
PlayerTrails.cfg_bodyEnabled.Value = !PlayerTrails.cfg_bodyEnabled.Value;
break;
case 1:
PlayerTrails.lHand.SetActive(!PlayerTrails.lHand.activeSelf);
PlayerTrails.cfg_lHandEnabled.Value = !PlayerTrails.cfg_lHandEnabled.Value;
break;
case 2:
PlayerTrails.rHand.SetActive(!PlayerTrails.rHand.activeSelf);
PlayerTrails.cfg_rHandEnabled.Value = !PlayerTrails.cfg_rHandEnabled.Value;
break;
}
}
public void OffsetUpdate(int axis)
{
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_011c: Unknown result type (might be due to invalid IL or missing references)
//IL_0194: Unknown result type (might be due to invalid IL or missing references)
//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
switch (currentlyEditing)
{
case 0:
switch (axis)
{
case 0:
PlayerTrails.bodyOffset.x = s_x_o.value;
break;
case 1:
PlayerTrails.bodyOffset.y = s_y_o.value;
break;
case 2:
PlayerTrails.bodyOffset.z = s_z_o.value;
break;
}
PlayerTrails.body.transform.localPosition = PlayerTrails.bodyOffset;
PlayerTrails.cfg_bodyOffset.Value = PlayerTrails.bodyOffset;
break;
case 1:
switch (axis)
{
case 0:
PlayerTrails.lHandOffset.x = s_x_o.value;
break;
case 1:
PlayerTrails.lHandOffset.y = s_y_o.value;
break;
case 2:
PlayerTrails.lHandOffset.z = s_z_o.value;
break;
}
PlayerTrails.lHand.transform.localPosition = PlayerTrails.lHandOffset;
PlayerTrails.cfg_lHandOffset.Value = PlayerTrails.lHandOffset;
break;
case 2:
switch (axis)
{
case 0:
PlayerTrails.rHandOffset.x = s_x_o.value;
break;
case 1:
PlayerTrails.rHandOffset.y = s_y_o.value;
break;
case 2:
PlayerTrails.rHandOffset.z = s_z_o.value;
break;
}
PlayerTrails.rHand.transform.localPosition = PlayerTrails.rHandOffset;
PlayerTrails.cfg_rHandOffset.Value = PlayerTrails.rHandOffset;
break;
}
t_xv_o.text = s_x_o.value.ToString();
t_yv_o.text = s_y_o.value.ToString();
t_zv_o.text = s_z_o.value.ToString();
}
private void OffsetActiveSwitched()
{
switch (currentlyEditing)
{
case 0:
s_x_o.value = PlayerTrails.bodyOffset.x;
s_y_o.value = PlayerTrails.bodyOffset.y;
s_z_o.value = PlayerTrails.bodyOffset.z;
break;
case 1:
s_x_o.value = PlayerTrails.lHandOffset.x;
s_y_o.value = PlayerTrails.lHandOffset.y;
s_z_o.value = PlayerTrails.lHandOffset.z;
break;
case 2:
s_x_o.value = PlayerTrails.rHandOffset.x;
s_y_o.value = PlayerTrails.rHandOffset.y;
s_z_o.value = PlayerTrails.rHandOffset.z;
break;
}
t_xv_o.text = s_x_o.value.ToString();
t_yv_o.text = s_y_o.value.ToString();
t_zv_o.text = s_z_o.value.ToString();
}
public void MaterialUpdate(int rgba)
{
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
//IL_00f0: 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_01a6: Unknown result type (might be due to invalid IL or missing references)
//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
//IL_01d0: 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_01e5: Unknown result type (might be due to invalid IL or missing references)
//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
//IL_021f: Unknown result type (might be due to invalid IL or missing references)
//IL_0224: Unknown result type (might be due to invalid IL or missing references)
switch (startOrEndColour)
{
case 0:
switch (rgba)
{
case 0:
PlayerTrails.startColour.r = (byte)s_r_m.value;
break;
case 1:
PlayerTrails.startColour.g = (byte)s_g_m.value;
break;
case 2:
PlayerTrails.startColour.b = (byte)s_b_m.value;
break;
case 3:
PlayerTrails.startColour.a = (byte)s_a_m.value;
break;
}
PlayerTrails.bodyTrail.startColor = Color32.op_Implicit(PlayerTrails.startColour);
PlayerTrails.lHandTrail.startColor = Color32.op_Implicit(PlayerTrails.startColour);
PlayerTrails.rHandTrail.startColor = Color32.op_Implicit(PlayerTrails.startColour);
((Graphic)i_colourSwatch).color = Color32.op_Implicit(PlayerTrails.startColour);
PlayerTrails.cfg_startColour.Value = PlayerTrails.Color32ToV4(PlayerTrails.startColour);
((ConfigEntryBase)PlayerTrails.cfg_startColour).ConfigFile.Save();
trailClone.startColor = Color32.op_Implicit(PlayerTrails.startColour);
break;
case 1:
switch (rgba)
{
case 0:
PlayerTrails.endColour.r = (byte)s_r_m.value;
break;
case 1:
PlayerTrails.endColour.g = (byte)s_g_m.value;
break;
case 2:
PlayerTrails.endColour.b = (byte)s_b_m.value;
break;
case 3:
PlayerTrails.endColour.a = (byte)s_a_m.value;
break;
}
PlayerTrails.bodyTrail.endColor = Color32.op_Implicit(PlayerTrails.endColour);
PlayerTrails.lHandTrail.endColor = Color32.op_Implicit(PlayerTrails.endColour);
PlayerTrails.rHandTrail.endColor = Color32.op_Implicit(PlayerTrails.endColour);
((Graphic)i_colourSwatch).color = Color32.op_Implicit(PlayerTrails.endColour);
PlayerTrails.cfg_endColour.Value = PlayerTrails.Color32ToV4(PlayerTrails.endColour);
((ConfigEntryBase)PlayerTrails.cfg_endColour).ConfigFile.Save();
trailClone.endColor = Color32.op_Implicit(PlayerTrails.endColour);
break;
}
t_rv_m.text = s_r_m.value.ToString();
t_gv_m.text = s_g_m.value.ToString();
t_bv_m.text = s_b_m.value.ToString();
t_av_m.text = s_a_m.value.ToString();
}
private void MaterialActiveSwitched()
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: 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_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_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
switch (startOrEndColour)
{
case 0:
currentColor = PlayerTrails.startColour;
((Graphic)i_colourSwatch).color = Color32.op_Implicit(currentColor);
break;
case 1:
currentColor = PlayerTrails.endColour;
((Graphic)i_colourSwatch).color = Color32.op_Implicit(currentColor);
break;
}
s_r_m.value = (int)currentColor.r;
s_g_m.value = (int)currentColor.g;
s_b_m.value = (int)currentColor.b;
s_a_m.value = (int)currentColor.a;
t_rv_m.text = s_r_m.value.ToString();
t_gv_m.text = s_g_m.value.ToString();
t_bv_m.text = s_b_m.value.ToString();
t_av_m.text = s_a_m.value.ToString();
}
public static void TextureSwitch(string newmat)
{
PlayerTrails.trailTex.LoadImage(PlayerTrails.TextureGrab(newmat));
string[] source = newmat.Split(new char[1] { '\\' });
string value = source.Last();
PlayerTrails.cfg_trailTex.Value = value;
}
public void StartLoadPanelImages()
{
((MonoBehaviour)this).StartCoroutine(LoadPanelImages());
}
private IEnumerator LoadPanelImages()
{
CreateFileList();
List<Image> list = imageList;
if (list != null && list.Any())
{
foreach (Image img in imageList)
{
Object.Destroy((Object)(object)((Component)img).gameObject);
}
imageList.Clear();
rawImageGO.transform.localPosition = rawImageBasePos;
}
for (int k = 0; k < fileList.Count; k++)
{
newPanel = Object.Instantiate<GameObject>(rawImageGO, ((Component)rawImageGO.transform.parent).transform);
Component component = newPanel.GetComponent(typeof(Image));
Image newPanelImage = (Image)(object)((component is Image) ? component : null);
imageList.Add(newPanelImage);
Texture2D panelTex = new Texture2D(128, 128, (TextureFormat)12, false)
{
name = "panelTex" + k
};
panelTex.LoadImage(PlayerTrails.TextureGrab(fileList[k]));
Sprite panelSprite = Sprite.Create(panelTex, new Rect(0f, 0f, (float)((Texture)panelTex).width, (float)((Texture)panelTex).height), Vector2.op_Implicit(((Component)rawImage).transform.localPosition));
((Object)panelSprite).name = "panelSprite" + k;
imageList[k].sprite = panelSprite;
Component component2 = newPanel.GetComponent(typeof(Button));
Button buttonClick = (Button)(object)((component2 is Button) ? component2 : null);
string sendURL = fileList[k];
((UnityEvent)buttonClick.onClick).AddListener((UnityAction)delegate
{
TextureSwitch(sendURL);
});
newPanel.SetActive(true);
}
Transform transform = ((Component)rawImageGO.transform.parent).transform;
LayoutRebuilder.ForceRebuildLayoutImmediate((RectTransform)(object)((transform is RectTransform) ? transform : null));
yield return null;
}
public void PropertiesUpdate(int property)
{
switch (currentlyEditing)
{
case 0:
switch (property)
{
case 0:
PlayerTrails.bodyTrail.time = s_t_tr.value;
PlayerTrails.cfg_bodyTime.Value = PlayerTrails.bodyTrail.time;
break;
case 1:
PlayerTrails.bodyTrail.startWidth = s_s_tr.value / 2f;
PlayerTrails.cfg_bodyStartWidth.Value = PlayerTrails.bodyTrail.startWidth;
break;
case 2:
PlayerTrails.bodyTrail.endWidth = s_e_tr.value / 2f;
PlayerTrails.cfg_bodyEndWidth.Value = PlayerTrails.bodyTrail.endWidth;
break;
}
break;
case 1:
switch (property)
{
case 0:
PlayerTrails.lHandTrail.time = s_t_tr.value;
PlayerTrails.cfg_lHandTime.Value = PlayerTrails.lHandTrail.time;
break;
case 1:
PlayerTrails.lHandTrail.startWidth = s_s_tr.value / 2f;
PlayerTrails.cfg_lHandStartWidth.Value = PlayerTrails.lHandTrail.startWidth;
break;
case 2:
PlayerTrails.lHandTrail.endWidth = s_e_tr.value / 2f;
PlayerTrails.cfg_lHandEndWidth.Value = PlayerTrails.lHandTrail.endWidth;
break;
}
break;
case 2:
switch (property)
{
case 0:
PlayerTrails.rHandTrail.time = s_t_tr.value;
PlayerTrails.cfg_rHandTime.Value = PlayerTrails.rHandTrail.time;
break;
case 1:
PlayerTrails.rHandTrail.startWidth = s_s_tr.value / 2f;
PlayerTrails.cfg_rHandStartWidth.Value = PlayerTrails.rHandTrail.startWidth;
break;
case 2:
PlayerTrails.rHandTrail.endWidth = s_e_tr.value / 2f;
PlayerTrails.cfg_rHandEndWidth.Value = PlayerTrails.rHandTrail.endWidth;
break;
}
break;
}
t_tv_tr.text = s_t_tr.value.ToString();
t_sv_tr.text = s_s_tr.value.ToString();
t_ev_tr.text = s_e_tr.value.ToString();
}
private void PropertiesActiveSwitched()
{
switch (currentlyEditing)
{
case 0:
s_t_tr.value = PlayerTrails.bodyTrail.time;
s_s_tr.value = PlayerTrails.bodyTrail.startWidth * 2f;
s_e_tr.value = PlayerTrails.bodyTrail.endWidth * 2f;
break;
case 1:
s_t_tr.value = PlayerTrails.lHandTrail.time;
s_s_tr.value = PlayerTrails.lHandTrail.startWidth * 2f;
s_e_tr.value = PlayerTrails.lHandTrail.endWidth * 2f;
break;
case 2:
s_t_tr.value = PlayerTrails.rHandTrail.time;
s_s_tr.value = PlayerTrails.rHandTrail.startWidth * 2f;
s_e_tr.value = PlayerTrails.rHandTrail.endWidth * 2f;
break;
}
t_tv_tr.text = s_t_tr.value.ToString();
t_sv_tr.text = s_s_tr.value.ToString();
t_ev_tr.text = s_e_tr.value.ToString();
}
public void AllOff()
{
PlayerTrails.body.SetActive(false);
PlayerTrails.lHand.SetActive(false);
PlayerTrails.rHand.SetActive(false);
}
public void AllOn()
{
PlayerTrails.body.SetActive(true);
PlayerTrails.lHand.SetActive(true);
PlayerTrails.rHand.SetActive(true);
}
}
[BepInProcess("h3vr.exe")]
[BepInDependency("nrgill28.Sodalite", "1.4.1")]
[BepInPlugin("JalexInteractive.PlayerTrails", "Player Trails", "1.0.0")]
public class PlayerTrails : BaseUnityPlugin
{
public static ConfigEntry<bool> cfg_bodyEnabled;
public static ConfigEntry<bool> cfg_lHandEnabled;
public static ConfigEntry<bool> cfg_rHandEnabled;
public static ConfigEntry<Vector3> cfg_bodyOffset;
public static ConfigEntry<Vector3> cfg_lHandOffset;
public static ConfigEntry<Vector3> cfg_rHandOffset;
public static ConfigEntry<string> cfg_trailTex;
public static ConfigEntry<Vector4> cfg_startColour;
public static ConfigEntry<Vector4> cfg_endColour;
public static ConfigEntry<float> cfg_bodyTime;
public static ConfigEntry<float> cfg_lHandTime;
public static ConfigEntry<float> cfg_rHandTime;
public static ConfigEntry<float> cfg_bodyStartWidth;
public static ConfigEntry<float> cfg_lHandStartWidth;
public static ConfigEntry<float> cfg_rHandStartWidth;
public static ConfigEntry<float> cfg_bodyEndWidth;
public static ConfigEntry<float> cfg_lHandEndWidth;
public static ConfigEntry<float> cfg_rHandEndWidth;
public static GameObject body;
public static GameObject lHand;
public static GameObject rHand;
private GameObject optionsPanelPrefab;
public static TrailRenderer bodyTrail;
public static TrailRenderer lHandTrail;
public static TrailRenderer rHandTrail;
public static Material trailMat;
public static Texture2D trailTex;
public bool parented = false;
public static Vector3 bodyOffset;
public static Vector3 lHandOffset;
public static Vector3 rHandOffset;
public static Color32 startColour;
public static Color32 endColour;
public static string basePath;
public Scene activeScene;
public GameObject panel = null;
private bool spawnedThisScene = false;
public const string Id = "JalexInteractive.PlayerTrails";
internal static ManualLogSource Logger { get; private set; }
public static string Name => "Player Trails";
public static string Version => "1.0.0";
private void Awake()
{
//IL_00de: 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_014a: Unknown result type (might be due to invalid IL or missing references)
//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
//IL_03f9: Unknown result type (might be due to invalid IL or missing references)
//IL_0403: Expected O, but got Unknown
//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0408: Expected O, but got Unknown
//IL_041f: Unknown result type (might be due to invalid IL or missing references)
//IL_0424: Unknown result type (might be due to invalid IL or missing references)
Logger = ((BaseUnityPlugin)this).Logger;
Logger.LogMessage((object)("~ " + Name + " Version " + Version + " by Jalex Interactive - Initalising ~"));
((BaseUnityPlugin)this).Config.SaveOnConfigSet = true;
cfg_bodyEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "Head trail On/Off", true, "Turn the head/body trail on or off.");
cfg_lHandEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "Left hand trail On/Off", true, "Turn the left hand trail on or off.");
cfg_rHandEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "Right hand On/Off", true, "Turn the right hand trail on or off.");
Vector3 val = default(Vector3);
((Vector3)(ref val))..ctor(0f, -1f, 0f);
cfg_bodyOffset = ((BaseUnityPlugin)this).Config.Bind<Vector3>("Offsets", "Head Offset", val, "Offset for the head/body trail position (x,y,z)");
Vector3 val2 = default(Vector3);
((Vector3)(ref val2))..ctor(0f, 0f, -0.21f);
cfg_lHandOffset = ((BaseUnityPlugin)this).Config.Bind<Vector3>("Offsets", "Left Hand Offset", val2, "Offset for the left hand trail position (x,y,z)");
Vector3 val3 = default(Vector3);
((Vector3)(ref val3))..ctor(0f, 0f, -0.21f);
cfg_rHandOffset = ((BaseUnityPlugin)this).Config.Bind<Vector3>("Offsets", "Right Hand Offset", val3, "Offset for the right hand trail position (x,y,z)");
cfg_trailTex = ((BaseUnityPlugin)this).Config.Bind<string>("Material Properties", "Image name", "blank.png", "Image file used for the trail texture. Add your own by adding them to the textures folder in this mods directory (png and jpg only.)");
Vector4 val4 = default(Vector4);
((Vector4)(ref val4))..ctor(255f, 255f, 255f, 255f);
cfg_startColour = ((BaseUnityPlugin)this).Config.Bind<Vector4>("Material Properties", "Start Colour", val4, "Start colour of the trail");
Vector4 val5 = default(Vector4);
((Vector4)(ref val5))..ctor(255f, 255f, 255f, 0f);
cfg_endColour = ((BaseUnityPlugin)this).Config.Bind<Vector4>("Material Properties", "End Colour", val5, "End colour of the trail");
cfg_bodyTime = ((BaseUnityPlugin)this).Config.Bind<float>("Trail Properties", "Body Time", 3f, "Time before the head/body trail fades (higher values mean longer trails)");
cfg_lHandTime = ((BaseUnityPlugin)this).Config.Bind<float>("Trail Properties", "Left Hand Time", 1f, "Time before the left hand trail fades (higher values mean longer trails)");
cfg_rHandTime = ((BaseUnityPlugin)this).Config.Bind<float>("Trail Properties", "Right Hand Time", 1f, "Time before the right hand trail fades (higher values mean longer trails)");
cfg_bodyStartWidth = ((BaseUnityPlugin)this).Config.Bind<float>("Trail Properties", "Body Start Width", 0.2f, "Width of the body trail at the start of the trail");
cfg_lHandStartWidth = ((BaseUnityPlugin)this).Config.Bind<float>("Trail Properties", "Left Hand Start Width", 0.05f, "Width of the left hand trail at the start of the trail");
cfg_rHandStartWidth = ((BaseUnityPlugin)this).Config.Bind<float>("Trail Properties", "Right Hand Start Width", 0.05f, "Width of the right hand trail at the start of the trail");
cfg_bodyEndWidth = ((BaseUnityPlugin)this).Config.Bind<float>("Trail Properties", "Body End Width", 0f, "Width of the body trail at the end of the trail");
cfg_lHandEndWidth = ((BaseUnityPlugin)this).Config.Bind<float>("Trail Properties", "Left Hand End Width", 0f, "Width of the left hand trail at the end of the trail");
cfg_rHandEndWidth = ((BaseUnityPlugin)this).Config.Bind<float>("Trail Properties", "Right Hand End Width", 0f, "Width of the right hand trail at the end of the trail");
TrailSetup();
if (!cfg_bodyEnabled.Value)
{
body.SetActive(false);
}
if (!cfg_lHandEnabled.Value)
{
lHand.SetActive(false);
}
if (!cfg_rHandEnabled.Value)
{
rHand.SetActive(false);
}
AssetBundle val6 = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "playertrailspanel_preload"));
optionsPanelPrefab = val6.LoadAsset<GameObject>("PlayerTrailsPanel");
if (Object.op_Implicit((Object)(object)optionsPanelPrefab))
{
WristMenuAPI.Buttons.Add(new WristMenuButton("Player Trails Panel", new ButtonClickEvent(SpawnTrailsPanel)));
}
else
{
Logger.LogError((object)"~ Oopsie woopsie I made a fucky wucky ~");
}
activeScene = SceneManager.GetActiveScene();
}
private void TrailSetup()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Expected O, but got Unknown
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Expected O, but got Unknown
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Expected O, but got Unknown
//IL_0038: 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_004e: Expected O, but got Unknown
//IL_005b: 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_0071: Expected O, but got Unknown
//IL_011a: Unknown result type (might be due to invalid IL or missing references)
//IL_0143: Unknown result type (might be due to invalid IL or missing references)
//IL_0148: Unknown result type (might be due to invalid IL or missing references)
//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0311: Unknown result type (might be due to invalid IL or missing references)
//IL_0316: Unknown result type (might be due to invalid IL or missing references)
//IL_031b: Unknown result type (might be due to invalid IL or missing references)
//IL_031c: Unknown result type (might be due to invalid IL or missing references)
//IL_0324: Unknown result type (might be due to invalid IL or missing references)
//IL_0326: Unknown result type (might be due to invalid IL or missing references)
//IL_0327: Unknown result type (might be due to invalid IL or missing references)
//IL_032f: 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_0346: Unknown result type (might be due to invalid IL or missing references)
//IL_035a: Unknown result type (might be due to invalid IL or missing references)
//IL_035f: Unknown result type (might be due to invalid IL or missing references)
//IL_0364: Unknown result type (might be due to invalid IL or missing references)
//IL_0365: Unknown result type (might be due to invalid IL or missing references)
//IL_036d: 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_0370: Unknown result type (might be due to invalid IL or missing references)
//IL_0378: Unknown result type (might be due to invalid IL or missing references)
//IL_0385: Unknown result type (might be due to invalid IL or missing references)
//IL_038a: Unknown result type (might be due to invalid IL or missing references)
//IL_0394: Unknown result type (might be due to invalid IL or missing references)
//IL_0399: Unknown result type (might be due to invalid IL or missing references)
//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
//IL_03a8: Unknown result type (might be due to invalid IL or missing references)
body = new GameObject("BodyTrail");
lHand = new GameObject("LHandTrail");
rHand = new GameObject("RHandTrail");
trailMat = new Material(Shader.Find("Alloy/Particles/Additive (Soft)"))
{
name = "TrailMaterial"
};
trailTex = new Texture2D(128, 128, (TextureFormat)12, false)
{
name = "TrailTexture"
};
basePath = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location) + "\\textures\\";
string text = basePath + cfg_trailTex.Value;
if (File.Exists(text))
{
Logger.LogMessage((object)("~ Grabbing texture from: " + text + " ~"));
trailTex.LoadImage(TextureGrab(text));
}
else
{
Logger.LogError((object)"~ Current texture does not exist. Defaulting to blank. ~");
}
trailMat.SetTexture("_MainTex", (Texture)(object)trailTex);
trailMat.SetTextureScale("_MainTex", new Vector2(-1f, 1f));
trailMat.SetColor("_Color", Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue)));
Component obj = body.AddComponent(typeof(TrailRenderer));
bodyTrail = (TrailRenderer)(object)((obj is TrailRenderer) ? obj : null);
Component obj2 = lHand.AddComponent(typeof(TrailRenderer));
lHandTrail = (TrailRenderer)(object)((obj2 is TrailRenderer) ? obj2 : null);
Component obj3 = rHand.AddComponent(typeof(TrailRenderer));
rHandTrail = (TrailRenderer)(object)((obj3 is TrailRenderer) ? obj3 : null);
bodyTrail.startWidth = cfg_bodyStartWidth.Value;
lHandTrail.startWidth = cfg_lHandStartWidth.Value;
rHandTrail.startWidth = cfg_rHandStartWidth.Value;
bodyTrail.endWidth = cfg_bodyEndWidth.Value;
lHandTrail.endWidth = cfg_lHandEndWidth.Value;
rHandTrail.endWidth = cfg_rHandEndWidth.Value;
bodyTrail.time = cfg_bodyTime.Value;
lHandTrail.time = cfg_lHandTime.Value;
rHandTrail.time = cfg_rHandTime.Value;
TrailRenderer obj4 = bodyTrail;
TrailRenderer obj5 = lHandTrail;
int num = (rHandTrail.numCornerVertices = 5);
int numCornerVertices = (obj5.numCornerVertices = num);
obj4.numCornerVertices = numCornerVertices;
TrailRenderer obj6 = bodyTrail;
TrailRenderer obj7 = lHandTrail;
TrailRenderer obj8 = rHandTrail;
LineTextureMode val = (LineTextureMode)3;
obj8.textureMode = (LineTextureMode)3;
LineTextureMode textureMode = (obj7.textureMode = val);
obj6.textureMode = textureMode;
TrailRenderer obj9 = bodyTrail;
TrailRenderer obj10 = lHandTrail;
Material val3 = (((Renderer)rHandTrail).material = trailMat);
Material material = (((Renderer)obj10).material = val3);
((Renderer)obj9).material = material;
startColour = V4ToColor32(cfg_startColour.Value);
TrailRenderer obj11 = bodyTrail;
TrailRenderer obj12 = lHandTrail;
Color val6 = (rHandTrail.startColor = Color32.op_Implicit(startColour));
Color startColor = (obj12.startColor = val6);
obj11.startColor = startColor;
endColour = V4ToColor32(cfg_endColour.Value);
TrailRenderer obj13 = bodyTrail;
TrailRenderer obj14 = lHandTrail;
val6 = (rHandTrail.endColor = Color32.op_Implicit(endColour));
startColor = (obj14.endColor = val6);
obj13.endColor = startColor;
bodyOffset = cfg_bodyOffset.Value;
lHandOffset = cfg_lHandOffset.Value;
rHandOffset = cfg_rHandOffset.Value;
}
private void LateUpdate()
{
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)GM.CurrentPlayerBody) && !parented)
{
if (!Object.op_Implicit((Object)(object)body))
{
Logger.LogMessage((object)"~ Respawning trails ~");
TrailSetup();
}
Logger.LogMessage((object)"~ Binding trails to player ~");
((Component)bodyTrail).transform.SetParent(GM.CurrentPlayerBody.Head, false);
((Component)lHandTrail).transform.SetParent(GM.CurrentPlayerBody.LeftHand, false);
((Component)rHandTrail).transform.SetParent(GM.CurrentPlayerBody.RightHand, false);
((Component)bodyTrail).transform.localPosition = bodyOffset;
((Component)lHandTrail).transform.localPosition = lHandOffset;
((Component)rHandTrail).transform.localPosition = rHandOffset;
parented = true;
}
if (!Object.op_Implicit((Object)(object)bodyTrail))
{
Logger.LogMessage((object)"~ Trail destroyed - unparenting for respawn ~");
parented = false;
}
}
public static byte[] TextureGrab(string url)
{
return File.ReadAllBytes(url);
}
private void SpawnTrailsPanel(object sender, ButtonClickEventArgs args)
{
//IL_0017: 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_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_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)
if ((((Scene)(ref activeScene)).name == "MainMenu3") | (activeScene != SceneManager.GetActiveScene()))
{
PlayerTrailsPanel.imageList = new List<Image>();
if (activeScene != SceneManager.GetActiveScene())
{
spawnedThisScene = false;
}
activeScene = SceneManager.GetActiveScene();
if (!spawnedThisScene)
{
panel = Object.Instantiate<GameObject>(optionsPanelPrefab);
}
spawnedThisScene = true;
}
args.Hand.OtherHand.RetrieveObject(panel.GetComponent<FVRPhysicalObject>());
}
public static Vector4 Color32ToV4(Color32 colour)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
return new Vector4((float)(int)colour.r, (float)(int)colour.g, (float)(int)colour.b, (float)(int)colour.a);
}
public static Color32 V4ToColor32(Vector4 v4)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: 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_0011: 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_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
Color val = Color.op_Implicit(v4 / 255f);
return Color32.op_Implicit(val);
}
}
}