using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using CustomGrabColour;
using HarmonyLib;
using MenuLib;
using MenuLib.MonoBehaviors;
using Microsoft.CodeAnalysis;
using Photon.Pun;
using UnityEngine;
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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Enchanted Games")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Lets you change your grab beam colour")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyInformationalVersion("1.1.0+f60b4b721f33dd9a45ecc38f778728b60e365aba")]
[assembly: AssemblyProduct("CustomGrabColour")]
[assembly: AssemblyTitle("CustomGrabColour")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.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;
}
}
}
internal class Assets
{
internal static AssetBundle mainAssetBundle;
private static string[] assetNames = new string[0];
internal static void LoadAssetBundle(string assetbundlePath)
{
if ((Object)(object)mainAssetBundle == (Object)null)
{
mainAssetBundle = AssetBundle.LoadFromFile(assetbundlePath);
}
assetNames = mainAssetBundle.GetAllAssetNames();
}
internal static AssetBundle GetBundle()
{
if (!Object.op_Implicit((Object)(object)mainAssetBundle))
{
Debug.LogError((object)"There is no AssetBundle to load assets from.");
return null;
}
return mainAssetBundle;
}
}
internal class ConfigMenu
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static Action <>9__7_1;
public static BuilderDelegate <>9__7_0;
public static BuilderDelegate <>9__8_0;
public static ScrollViewBuilderDelegate <>9__8_1;
public static Action<float> <>9__8_20;
public static ScrollViewBuilderDelegate <>9__8_2;
public static Action<float> <>9__8_21;
public static ScrollViewBuilderDelegate <>9__8_3;
public static Action<float> <>9__8_22;
public static ScrollViewBuilderDelegate <>9__8_4;
public static Action<float> <>9__8_23;
public static ScrollViewBuilderDelegate <>9__8_5;
public static Action<bool> <>9__8_24;
public static ScrollViewBuilderDelegate <>9__8_6;
public static ScrollViewBuilderDelegate <>9__8_7;
public static Action<float> <>9__8_25;
public static ScrollViewBuilderDelegate <>9__8_8;
public static Action<float> <>9__8_26;
public static ScrollViewBuilderDelegate <>9__8_9;
public static Action<float> <>9__8_27;
public static ScrollViewBuilderDelegate <>9__8_10;
public static Action<float> <>9__8_28;
public static ScrollViewBuilderDelegate <>9__8_11;
public static Action<bool> <>9__8_29;
public static ScrollViewBuilderDelegate <>9__8_12;
public static ScrollViewBuilderDelegate <>9__8_13;
public static Action<float> <>9__8_30;
public static ScrollViewBuilderDelegate <>9__8_14;
public static Action<float> <>9__8_31;
public static ScrollViewBuilderDelegate <>9__8_15;
public static Action<float> <>9__8_32;
public static ScrollViewBuilderDelegate <>9__8_16;
public static Action<float> <>9__8_33;
public static ScrollViewBuilderDelegate <>9__8_17;
public static Action<bool> <>9__8_34;
public static ScrollViewBuilderDelegate <>9__8_18;
internal void <Init>b__7_0(Transform parent)
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
REPOButton val = MenuAPI.CreateREPOButton("Change Grab Colour", (Action)delegate
{
OpenPopup();
}, parent, new Vector2(28.3f, 350f));
}
internal void <Init>b__7_1()
{
OpenPopup();
}
internal void <OpenPopup>b__8_0(Transform parent)
{
//IL_001a: 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_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: 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_0106: Unknown result type (might be due to invalid IL or missing references)
//IL_0123: 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_00d5: 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)
float verticalPos = getVerticalPos(0);
REPOLabel val = MenuAPI.CreateREPOLabel("Neutral Colour Preview", parent, new Vector2(452f, verticalPos - 60f));
((Component)val).transform.localScale = Vector2.op_Implicit(new Vector2(0.5f, 0.5f));
if (!Object.op_Implicit((Object)(object)neutralGrabColourPreviewParent))
{
CreateBeamPreviewColourRectangle(parent, new Vector2(515f, verticalPos), out neutralGrabColourPreviewParent, out neutralGrabColourPreviewImage);
}
float verticalPos2 = getVerticalPos(1);
REPOLabel val2 = MenuAPI.CreateREPOLabel("Rotating Colour Preview", parent, new Vector2(452f, verticalPos2 - 60f));
((Component)val2).transform.localScale = Vector2.op_Implicit(new Vector2(0.5f, 0.5f));
if (!Object.op_Implicit((Object)(object)rotatingGrabColourPreviewParent))
{
CreateBeamPreviewColourRectangle(parent, new Vector2(515f, verticalPos2), out rotatingGrabColourPreviewParent, out rotatingGrabColourPreviewImage);
}
float verticalPos3 = getVerticalPos(2);
REPOLabel val3 = MenuAPI.CreateREPOLabel("Healing Colour Preview", parent, new Vector2(452f, verticalPos3 - 60f));
((Component)val3).transform.localScale = Vector2.op_Implicit(new Vector2(0.5f, 0.5f));
if (!Object.op_Implicit((Object)(object)healingGrabColourPreviewParent))
{
CreateBeamPreviewColourRectangle(parent, new Vector2(515f, verticalPos3), out healingGrabColourPreviewParent, out healingGrabColourPreviewImage);
}
}
internal RectTransform <OpenPopup>b__8_1(Transform parent)
{
//IL_0012: 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_0032: Unknown result type (might be due to invalid IL or missing references)
REPOLabel val = MenuAPI.CreateREPOLabel("Neutral Beam Colour", parent, new Vector2(0f, getVerticalOffsetForScrollChildren(0)));
((Component)val).transform.localScale = Vector2.op_Implicit(new Vector2(0.5f, 0.5f));
return ((REPOElement)val).rectTransform;
}
internal RectTransform <OpenPopup>b__8_2(Transform parent)
{
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val = CreateColourSlider("Red", "", delegate(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalNeutralColour.matchSkin)
{
CustomGrabBeamColour.LocalNeutralColour.r = f;
Color color = ((Graphic)neutralGrabColourPreviewImage).color;
color.r = f;
((Graphic)neutralGrabColourPreviewImage).color = color;
}
}, CustomGrabBeamColour.LocalNeutralColour.r, 1f, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(1)));
return ((REPOElement)val).rectTransform;
}
internal void <OpenPopup>b__8_20(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalNeutralColour.matchSkin)
{
CustomGrabBeamColour.LocalNeutralColour.r = f;
Color color = ((Graphic)neutralGrabColourPreviewImage).color;
color.r = f;
((Graphic)neutralGrabColourPreviewImage).color = color;
}
}
internal RectTransform <OpenPopup>b__8_3(Transform parent)
{
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val = CreateColourSlider("Green", "", delegate(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalNeutralColour.matchSkin)
{
CustomGrabBeamColour.LocalNeutralColour.g = f;
Color color = ((Graphic)neutralGrabColourPreviewImage).color;
color.g = f;
((Graphic)neutralGrabColourPreviewImage).color = color;
}
}, CustomGrabBeamColour.LocalNeutralColour.g, 1f, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(2)));
return ((REPOElement)val).rectTransform;
}
internal void <OpenPopup>b__8_21(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalNeutralColour.matchSkin)
{
CustomGrabBeamColour.LocalNeutralColour.g = f;
Color color = ((Graphic)neutralGrabColourPreviewImage).color;
color.g = f;
((Graphic)neutralGrabColourPreviewImage).color = color;
}
}
internal RectTransform <OpenPopup>b__8_4(Transform parent)
{
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val = CreateColourSlider("Blue", "", delegate(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalNeutralColour.matchSkin)
{
CustomGrabBeamColour.LocalNeutralColour.b = f;
Color color = ((Graphic)neutralGrabColourPreviewImage).color;
color.b = f;
((Graphic)neutralGrabColourPreviewImage).color = color;
}
}, CustomGrabBeamColour.LocalNeutralColour.b, 1f, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(3)));
return ((REPOElement)val).rectTransform;
}
internal void <OpenPopup>b__8_22(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalNeutralColour.matchSkin)
{
CustomGrabBeamColour.LocalNeutralColour.b = f;
Color color = ((Graphic)neutralGrabColourPreviewImage).color;
color.b = f;
((Graphic)neutralGrabColourPreviewImage).color = color;
}
}
internal RectTransform <OpenPopup>b__8_5(Transform parent)
{
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val = CreateColourSlider("Opacity", "", delegate(float f)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: 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)
CustomGrabBeamColour.LocalNeutralColour.a = f;
Color color = ((Graphic)neutralGrabColourPreviewImage).color;
color.a = f;
((Graphic)neutralGrabColourPreviewImage).color = color;
}, CustomGrabBeamColour.LocalNeutralColour.a, CustomGrabColourConfig.MaxOpacity, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(4)));
return ((REPOElement)val).rectTransform;
}
internal void <OpenPopup>b__8_23(float f)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: 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)
CustomGrabBeamColour.LocalNeutralColour.a = f;
Color color = ((Graphic)neutralGrabColourPreviewImage).color;
color.a = f;
((Graphic)neutralGrabColourPreviewImage).color = color;
}
internal RectTransform <OpenPopup>b__8_6(Transform parent)
{
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
REPOToggle val2 = MenuAPI.CreateREPOToggle("Match Skin Colour", (Action<bool>)delegate(bool val)
{
CustomGrabBeamColour.LocalNeutralColour.matchSkin = val;
HandleNeutralSkinMatchChange();
}, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(5)), "Yes", "No", CustomGrabBeamColour.LocalNeutralColour.matchSkin);
return ((REPOElement)val2).rectTransform;
}
internal void <OpenPopup>b__8_24(bool val)
{
CustomGrabBeamColour.LocalNeutralColour.matchSkin = val;
HandleNeutralSkinMatchChange();
}
internal RectTransform <OpenPopup>b__8_7(Transform parent)
{
//IL_0012: 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_0032: Unknown result type (might be due to invalid IL or missing references)
REPOLabel val = MenuAPI.CreateREPOLabel("Rotating Beam Colour", parent, new Vector2(0f, getVerticalOffsetForScrollChildren(6)));
((Component)val).transform.localScale = Vector2.op_Implicit(new Vector2(0.5f, 0.5f));
return ((REPOElement)val).rectTransform;
}
internal RectTransform <OpenPopup>b__8_8(Transform parent)
{
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val = CreateColourSlider("Red", "", delegate(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalRotatingColour.matchSkin)
{
CustomGrabBeamColour.LocalRotatingColour.r = f;
Color color = ((Graphic)rotatingGrabColourPreviewImage).color;
color.r = f;
((Graphic)rotatingGrabColourPreviewImage).color = color;
HandleRotatingSkinMatchChange();
}
}, CustomGrabBeamColour.LocalRotatingColour.r, 1f, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(7)));
return ((REPOElement)val).rectTransform;
}
internal void <OpenPopup>b__8_25(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalRotatingColour.matchSkin)
{
CustomGrabBeamColour.LocalRotatingColour.r = f;
Color color = ((Graphic)rotatingGrabColourPreviewImage).color;
color.r = f;
((Graphic)rotatingGrabColourPreviewImage).color = color;
HandleRotatingSkinMatchChange();
}
}
internal RectTransform <OpenPopup>b__8_9(Transform parent)
{
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val = CreateColourSlider("Green", "", delegate(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalRotatingColour.matchSkin)
{
CustomGrabBeamColour.LocalRotatingColour.g = f;
Color color = ((Graphic)rotatingGrabColourPreviewImage).color;
color.g = f;
((Graphic)rotatingGrabColourPreviewImage).color = color;
HandleRotatingSkinMatchChange();
}
}, CustomGrabBeamColour.LocalRotatingColour.g, 1f, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(8)));
return ((REPOElement)val).rectTransform;
}
internal void <OpenPopup>b__8_26(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalRotatingColour.matchSkin)
{
CustomGrabBeamColour.LocalRotatingColour.g = f;
Color color = ((Graphic)rotatingGrabColourPreviewImage).color;
color.g = f;
((Graphic)rotatingGrabColourPreviewImage).color = color;
HandleRotatingSkinMatchChange();
}
}
internal RectTransform <OpenPopup>b__8_10(Transform parent)
{
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val = CreateColourSlider("Blue", "", delegate(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalRotatingColour.matchSkin)
{
CustomGrabBeamColour.LocalRotatingColour.b = f;
Color color = ((Graphic)rotatingGrabColourPreviewImage).color;
color.b = f;
((Graphic)rotatingGrabColourPreviewImage).color = color;
HandleRotatingSkinMatchChange();
}
}, CustomGrabBeamColour.LocalRotatingColour.b, 1f, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(9)));
return ((REPOElement)val).rectTransform;
}
internal void <OpenPopup>b__8_27(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalRotatingColour.matchSkin)
{
CustomGrabBeamColour.LocalRotatingColour.b = f;
Color color = ((Graphic)rotatingGrabColourPreviewImage).color;
color.b = f;
((Graphic)rotatingGrabColourPreviewImage).color = color;
HandleRotatingSkinMatchChange();
}
}
internal RectTransform <OpenPopup>b__8_11(Transform parent)
{
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val = CreateColourSlider("Opacity", "", delegate(float f)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: 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)
CustomGrabBeamColour.LocalRotatingColour.a = f;
Color color = ((Graphic)rotatingGrabColourPreviewImage).color;
color.a = f;
((Graphic)rotatingGrabColourPreviewImage).color = color;
HandleRotatingSkinMatchChange();
}, CustomGrabBeamColour.LocalRotatingColour.a, CustomGrabColourConfig.MaxOpacity, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(10)));
return ((REPOElement)val).rectTransform;
}
internal void <OpenPopup>b__8_28(float f)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: 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)
CustomGrabBeamColour.LocalRotatingColour.a = f;
Color color = ((Graphic)rotatingGrabColourPreviewImage).color;
color.a = f;
((Graphic)rotatingGrabColourPreviewImage).color = color;
HandleRotatingSkinMatchChange();
}
internal RectTransform <OpenPopup>b__8_12(Transform parent)
{
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
REPOToggle val2 = MenuAPI.CreateREPOToggle("Match Skin Colour", (Action<bool>)delegate(bool val)
{
CustomGrabBeamColour.LocalRotatingColour.matchSkin = val;
HandleRotatingSkinMatchChange();
}, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(11)), "Yes", "No", CustomGrabBeamColour.LocalRotatingColour.matchSkin);
return ((REPOElement)val2).rectTransform;
}
internal void <OpenPopup>b__8_29(bool val)
{
CustomGrabBeamColour.LocalRotatingColour.matchSkin = val;
HandleRotatingSkinMatchChange();
}
internal RectTransform <OpenPopup>b__8_13(Transform parent)
{
//IL_0012: 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_0032: Unknown result type (might be due to invalid IL or missing references)
REPOLabel val = MenuAPI.CreateREPOLabel("Healing Beam Colour", parent, new Vector2(0f, getVerticalOffsetForScrollChildren(6)));
((Component)val).transform.localScale = Vector2.op_Implicit(new Vector2(0.5f, 0.5f));
return ((REPOElement)val).rectTransform;
}
internal RectTransform <OpenPopup>b__8_14(Transform parent)
{
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val = CreateColourSlider("Red", "", delegate(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalHealingColour.matchSkin)
{
CustomGrabBeamColour.LocalHealingColour.r = f;
Color color = ((Graphic)healingGrabColourPreviewImage).color;
color.r = f;
((Graphic)healingGrabColourPreviewImage).color = color;
HandleHealingSkinMatchChange();
}
}, CustomGrabBeamColour.LocalHealingColour.r, 1f, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(7)));
return ((REPOElement)val).rectTransform;
}
internal void <OpenPopup>b__8_30(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalHealingColour.matchSkin)
{
CustomGrabBeamColour.LocalHealingColour.r = f;
Color color = ((Graphic)healingGrabColourPreviewImage).color;
color.r = f;
((Graphic)healingGrabColourPreviewImage).color = color;
HandleHealingSkinMatchChange();
}
}
internal RectTransform <OpenPopup>b__8_15(Transform parent)
{
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val = CreateColourSlider("Green", "", delegate(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalHealingColour.matchSkin)
{
CustomGrabBeamColour.LocalHealingColour.g = f;
Color color = ((Graphic)healingGrabColourPreviewImage).color;
color.g = f;
((Graphic)healingGrabColourPreviewImage).color = color;
HandleHealingSkinMatchChange();
}
}, CustomGrabBeamColour.LocalHealingColour.g, 1f, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(8)));
return ((REPOElement)val).rectTransform;
}
internal void <OpenPopup>b__8_31(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalHealingColour.matchSkin)
{
CustomGrabBeamColour.LocalHealingColour.g = f;
Color color = ((Graphic)healingGrabColourPreviewImage).color;
color.g = f;
((Graphic)healingGrabColourPreviewImage).color = color;
HandleHealingSkinMatchChange();
}
}
internal RectTransform <OpenPopup>b__8_16(Transform parent)
{
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val = CreateColourSlider("Blue", "", delegate(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalHealingColour.matchSkin)
{
CustomGrabBeamColour.LocalHealingColour.b = f;
Color color = ((Graphic)healingGrabColourPreviewImage).color;
color.b = f;
((Graphic)healingGrabColourPreviewImage).color = color;
HandleHealingSkinMatchChange();
}
}, CustomGrabBeamColour.LocalHealingColour.b, 1f, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(9)));
return ((REPOElement)val).rectTransform;
}
internal void <OpenPopup>b__8_32(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalHealingColour.matchSkin)
{
CustomGrabBeamColour.LocalHealingColour.b = f;
Color color = ((Graphic)healingGrabColourPreviewImage).color;
color.b = f;
((Graphic)healingGrabColourPreviewImage).color = color;
HandleHealingSkinMatchChange();
}
}
internal RectTransform <OpenPopup>b__8_17(Transform parent)
{
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val = CreateColourSlider("Opacity", "", delegate(float f)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: 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)
CustomGrabBeamColour.LocalHealingColour.a = f;
Color color = ((Graphic)healingGrabColourPreviewImage).color;
color.a = f;
((Graphic)healingGrabColourPreviewImage).color = color;
HandleHealingSkinMatchChange();
}, CustomGrabBeamColour.LocalHealingColour.a, CustomGrabColourConfig.MaxOpacity, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(10)));
return ((REPOElement)val).rectTransform;
}
internal void <OpenPopup>b__8_33(float f)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: 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)
CustomGrabBeamColour.LocalHealingColour.a = f;
Color color = ((Graphic)healingGrabColourPreviewImage).color;
color.a = f;
((Graphic)healingGrabColourPreviewImage).color = color;
HandleHealingSkinMatchChange();
}
internal RectTransform <OpenPopup>b__8_18(Transform parent)
{
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
REPOToggle val2 = MenuAPI.CreateREPOToggle("Match Skin Colour", (Action<bool>)delegate(bool val)
{
CustomGrabBeamColour.LocalHealingColour.matchSkin = val;
HandleHealingSkinMatchChange();
}, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(11)), "Yes", "No", CustomGrabBeamColour.LocalHealingColour.matchSkin);
return ((REPOElement)val2).rectTransform;
}
internal void <OpenPopup>b__8_34(bool val)
{
CustomGrabBeamColour.LocalHealingColour.matchSkin = val;
HandleHealingSkinMatchChange();
}
}
private static Image neutralGrabColourPreviewImage;
private static GameObject neutralGrabColourPreviewParent;
private static Image rotatingGrabColourPreviewImage;
private static GameObject rotatingGrabColourPreviewParent;
private static Image healingGrabColourPreviewImage;
private static GameObject healingGrabColourPreviewParent;
private static float horizontalPos = 70f;
public static void Init()
{
//IL_0015: 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_0020: Expected O, but got Unknown
object obj = <>c.<>9__7_0;
if (obj == null)
{
BuilderDelegate val = delegate(Transform parent)
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
REPOButton val2 = MenuAPI.CreateREPOButton("Change Grab Colour", (Action)delegate
{
OpenPopup();
}, parent, new Vector2(28.3f, 350f));
};
<>c.<>9__7_0 = val;
obj = (object)val;
}
MenuAPI.AddElementToEscapeMenu((BuilderDelegate)obj);
}
private static void OpenPopup()
{
//IL_0039: 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_0044: Expected O, but got Unknown
//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_006f: Expected O, but got Unknown
//IL_0099: 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_00a4: Expected O, but got Unknown
//IL_00ce: 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_00d9: Expected O, but got Unknown
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_0108: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: Expected O, but got Unknown
//IL_0138: Unknown result type (might be due to invalid IL or missing references)
//IL_013d: Unknown result type (might be due to invalid IL or missing references)
//IL_0143: Expected O, but got Unknown
//IL_016d: Unknown result type (might be due to invalid IL or missing references)
//IL_0172: Unknown result type (might be due to invalid IL or missing references)
//IL_0178: Expected O, but got Unknown
//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
//IL_01ad: Expected O, but got Unknown
//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
//IL_01e2: Expected O, but got Unknown
//IL_020c: 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)
//IL_0217: Expected O, but got Unknown
//IL_0241: Unknown result type (might be due to invalid IL or missing references)
//IL_0246: Unknown result type (might be due to invalid IL or missing references)
//IL_024c: Expected O, but got Unknown
//IL_0276: Unknown result type (might be due to invalid IL or missing references)
//IL_027b: Unknown result type (might be due to invalid IL or missing references)
//IL_0281: Expected O, but got Unknown
//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
//IL_02b6: Expected O, but got Unknown
//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
//IL_02eb: Expected O, but got Unknown
//IL_0315: Unknown result type (might be due to invalid IL or missing references)
//IL_031a: Unknown result type (might be due to invalid IL or missing references)
//IL_0320: Expected O, but got Unknown
//IL_034a: Unknown result type (might be due to invalid IL or missing references)
//IL_034f: Unknown result type (might be due to invalid IL or missing references)
//IL_0355: Expected O, but got Unknown
//IL_037f: Unknown result type (might be due to invalid IL or missing references)
//IL_0384: Unknown result type (might be due to invalid IL or missing references)
//IL_038a: Expected O, but got Unknown
//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
//IL_03b9: Unknown result type (might be due to invalid IL or missing references)
//IL_03bf: Expected O, but got Unknown
//IL_0411: Unknown result type (might be due to invalid IL or missing references)
//IL_041b: Expected O, but got Unknown
//IL_0421: Unknown result type (might be due to invalid IL or missing references)
//IL_042b: Unknown result type (might be due to invalid IL or missing references)
//IL_0435: Unknown result type (might be due to invalid IL or missing references)
//IL_03e9: Unknown result type (might be due to invalid IL or missing references)
//IL_03ee: Unknown result type (might be due to invalid IL or missing references)
//IL_03f4: Expected O, but got Unknown
REPOPopupPage changeGrabColourPage = MenuAPI.CreateREPOPopupPage("Change Grab Beam Colour", (PresetSide)0, false, true, 1.5f);
REPOPopupPage obj = changeGrabColourPage;
object obj2 = <>c.<>9__8_0;
if (obj2 == null)
{
BuilderDelegate val2 = delegate(Transform parent)
{
//IL_001a: 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_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: 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_0106: Unknown result type (might be due to invalid IL or missing references)
//IL_0123: 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_00d5: 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)
float verticalPos = getVerticalPos(0);
REPOLabel val41 = MenuAPI.CreateREPOLabel("Neutral Colour Preview", parent, new Vector2(452f, verticalPos - 60f));
((Component)val41).transform.localScale = Vector2.op_Implicit(new Vector2(0.5f, 0.5f));
if (!Object.op_Implicit((Object)(object)neutralGrabColourPreviewParent))
{
CreateBeamPreviewColourRectangle(parent, new Vector2(515f, verticalPos), out neutralGrabColourPreviewParent, out neutralGrabColourPreviewImage);
}
float verticalPos2 = getVerticalPos(1);
REPOLabel val42 = MenuAPI.CreateREPOLabel("Rotating Colour Preview", parent, new Vector2(452f, verticalPos2 - 60f));
((Component)val42).transform.localScale = Vector2.op_Implicit(new Vector2(0.5f, 0.5f));
if (!Object.op_Implicit((Object)(object)rotatingGrabColourPreviewParent))
{
CreateBeamPreviewColourRectangle(parent, new Vector2(515f, verticalPos2), out rotatingGrabColourPreviewParent, out rotatingGrabColourPreviewImage);
}
float verticalPos3 = getVerticalPos(2);
REPOLabel val43 = MenuAPI.CreateREPOLabel("Healing Colour Preview", parent, new Vector2(452f, verticalPos3 - 60f));
((Component)val43).transform.localScale = Vector2.op_Implicit(new Vector2(0.5f, 0.5f));
if (!Object.op_Implicit((Object)(object)healingGrabColourPreviewParent))
{
CreateBeamPreviewColourRectangle(parent, new Vector2(515f, verticalPos3), out healingGrabColourPreviewParent, out healingGrabColourPreviewImage);
}
};
<>c.<>9__8_0 = val2;
obj2 = (object)val2;
}
obj.AddElement((BuilderDelegate)obj2);
REPOPopupPage obj3 = changeGrabColourPage;
object obj4 = <>c.<>9__8_1;
if (obj4 == null)
{
ScrollViewBuilderDelegate val3 = delegate(Transform parent)
{
//IL_0012: 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_0032: Unknown result type (might be due to invalid IL or missing references)
REPOLabel val40 = MenuAPI.CreateREPOLabel("Neutral Beam Colour", parent, new Vector2(0f, getVerticalOffsetForScrollChildren(0)));
((Component)val40).transform.localScale = Vector2.op_Implicit(new Vector2(0.5f, 0.5f));
return ((REPOElement)val40).rectTransform;
};
<>c.<>9__8_1 = val3;
obj4 = (object)val3;
}
obj3.AddElementToScrollView((ScrollViewBuilderDelegate)obj4, 0f, 0f);
REPOPopupPage obj5 = changeGrabColourPage;
object obj6 = <>c.<>9__8_2;
if (obj6 == null)
{
ScrollViewBuilderDelegate val4 = delegate(Transform parent)
{
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val39 = CreateColourSlider("Red", "", delegate(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalNeutralColour.matchSkin)
{
CustomGrabBeamColour.LocalNeutralColour.r = f;
Color color12 = ((Graphic)neutralGrabColourPreviewImage).color;
color12.r = f;
((Graphic)neutralGrabColourPreviewImage).color = color12;
}
}, CustomGrabBeamColour.LocalNeutralColour.r, 1f, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(1)));
return ((REPOElement)val39).rectTransform;
};
<>c.<>9__8_2 = val4;
obj6 = (object)val4;
}
obj5.AddElementToScrollView((ScrollViewBuilderDelegate)obj6, 0f, 0f);
REPOPopupPage obj7 = changeGrabColourPage;
object obj8 = <>c.<>9__8_3;
if (obj8 == null)
{
ScrollViewBuilderDelegate val5 = delegate(Transform parent)
{
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val38 = CreateColourSlider("Green", "", delegate(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalNeutralColour.matchSkin)
{
CustomGrabBeamColour.LocalNeutralColour.g = f;
Color color11 = ((Graphic)neutralGrabColourPreviewImage).color;
color11.g = f;
((Graphic)neutralGrabColourPreviewImage).color = color11;
}
}, CustomGrabBeamColour.LocalNeutralColour.g, 1f, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(2)));
return ((REPOElement)val38).rectTransform;
};
<>c.<>9__8_3 = val5;
obj8 = (object)val5;
}
obj7.AddElementToScrollView((ScrollViewBuilderDelegate)obj8, 0f, 0f);
REPOPopupPage obj9 = changeGrabColourPage;
object obj10 = <>c.<>9__8_4;
if (obj10 == null)
{
ScrollViewBuilderDelegate val6 = delegate(Transform parent)
{
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val37 = CreateColourSlider("Blue", "", delegate(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalNeutralColour.matchSkin)
{
CustomGrabBeamColour.LocalNeutralColour.b = f;
Color color10 = ((Graphic)neutralGrabColourPreviewImage).color;
color10.b = f;
((Graphic)neutralGrabColourPreviewImage).color = color10;
}
}, CustomGrabBeamColour.LocalNeutralColour.b, 1f, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(3)));
return ((REPOElement)val37).rectTransform;
};
<>c.<>9__8_4 = val6;
obj10 = (object)val6;
}
obj9.AddElementToScrollView((ScrollViewBuilderDelegate)obj10, 0f, 0f);
REPOPopupPage obj11 = changeGrabColourPage;
object obj12 = <>c.<>9__8_5;
if (obj12 == null)
{
ScrollViewBuilderDelegate val7 = delegate(Transform parent)
{
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val36 = CreateColourSlider("Opacity", "", delegate(float f)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: 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)
CustomGrabBeamColour.LocalNeutralColour.a = f;
Color color9 = ((Graphic)neutralGrabColourPreviewImage).color;
color9.a = f;
((Graphic)neutralGrabColourPreviewImage).color = color9;
}, CustomGrabBeamColour.LocalNeutralColour.a, CustomGrabColourConfig.MaxOpacity, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(4)));
return ((REPOElement)val36).rectTransform;
};
<>c.<>9__8_5 = val7;
obj12 = (object)val7;
}
obj11.AddElementToScrollView((ScrollViewBuilderDelegate)obj12, 0f, 0f);
REPOPopupPage obj13 = changeGrabColourPage;
object obj14 = <>c.<>9__8_6;
if (obj14 == null)
{
ScrollViewBuilderDelegate val8 = delegate(Transform parent)
{
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
REPOToggle val35 = MenuAPI.CreateREPOToggle("Match Skin Colour", (Action<bool>)delegate(bool val)
{
CustomGrabBeamColour.LocalNeutralColour.matchSkin = val;
HandleNeutralSkinMatchChange();
}, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(5)), "Yes", "No", CustomGrabBeamColour.LocalNeutralColour.matchSkin);
return ((REPOElement)val35).rectTransform;
};
<>c.<>9__8_6 = val8;
obj14 = (object)val8;
}
obj13.AddElementToScrollView((ScrollViewBuilderDelegate)obj14, 0f, 0f);
REPOPopupPage obj15 = changeGrabColourPage;
object obj16 = <>c.<>9__8_7;
if (obj16 == null)
{
ScrollViewBuilderDelegate val9 = delegate(Transform parent)
{
//IL_0012: 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_0032: Unknown result type (might be due to invalid IL or missing references)
REPOLabel val34 = MenuAPI.CreateREPOLabel("Rotating Beam Colour", parent, new Vector2(0f, getVerticalOffsetForScrollChildren(6)));
((Component)val34).transform.localScale = Vector2.op_Implicit(new Vector2(0.5f, 0.5f));
return ((REPOElement)val34).rectTransform;
};
<>c.<>9__8_7 = val9;
obj16 = (object)val9;
}
obj15.AddElementToScrollView((ScrollViewBuilderDelegate)obj16, 0f, 0f);
REPOPopupPage obj17 = changeGrabColourPage;
object obj18 = <>c.<>9__8_8;
if (obj18 == null)
{
ScrollViewBuilderDelegate val10 = delegate(Transform parent)
{
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val33 = CreateColourSlider("Red", "", delegate(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalRotatingColour.matchSkin)
{
CustomGrabBeamColour.LocalRotatingColour.r = f;
Color color8 = ((Graphic)rotatingGrabColourPreviewImage).color;
color8.r = f;
((Graphic)rotatingGrabColourPreviewImage).color = color8;
HandleRotatingSkinMatchChange();
}
}, CustomGrabBeamColour.LocalRotatingColour.r, 1f, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(7)));
return ((REPOElement)val33).rectTransform;
};
<>c.<>9__8_8 = val10;
obj18 = (object)val10;
}
obj17.AddElementToScrollView((ScrollViewBuilderDelegate)obj18, 0f, 0f);
REPOPopupPage obj19 = changeGrabColourPage;
object obj20 = <>c.<>9__8_9;
if (obj20 == null)
{
ScrollViewBuilderDelegate val11 = delegate(Transform parent)
{
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val32 = CreateColourSlider("Green", "", delegate(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalRotatingColour.matchSkin)
{
CustomGrabBeamColour.LocalRotatingColour.g = f;
Color color7 = ((Graphic)rotatingGrabColourPreviewImage).color;
color7.g = f;
((Graphic)rotatingGrabColourPreviewImage).color = color7;
HandleRotatingSkinMatchChange();
}
}, CustomGrabBeamColour.LocalRotatingColour.g, 1f, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(8)));
return ((REPOElement)val32).rectTransform;
};
<>c.<>9__8_9 = val11;
obj20 = (object)val11;
}
obj19.AddElementToScrollView((ScrollViewBuilderDelegate)obj20, 0f, 0f);
REPOPopupPage obj21 = changeGrabColourPage;
object obj22 = <>c.<>9__8_10;
if (obj22 == null)
{
ScrollViewBuilderDelegate val12 = delegate(Transform parent)
{
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val31 = CreateColourSlider("Blue", "", delegate(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalRotatingColour.matchSkin)
{
CustomGrabBeamColour.LocalRotatingColour.b = f;
Color color6 = ((Graphic)rotatingGrabColourPreviewImage).color;
color6.b = f;
((Graphic)rotatingGrabColourPreviewImage).color = color6;
HandleRotatingSkinMatchChange();
}
}, CustomGrabBeamColour.LocalRotatingColour.b, 1f, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(9)));
return ((REPOElement)val31).rectTransform;
};
<>c.<>9__8_10 = val12;
obj22 = (object)val12;
}
obj21.AddElementToScrollView((ScrollViewBuilderDelegate)obj22, 0f, 0f);
REPOPopupPage obj23 = changeGrabColourPage;
object obj24 = <>c.<>9__8_11;
if (obj24 == null)
{
ScrollViewBuilderDelegate val13 = delegate(Transform parent)
{
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val30 = CreateColourSlider("Opacity", "", delegate(float f)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: 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)
CustomGrabBeamColour.LocalRotatingColour.a = f;
Color color5 = ((Graphic)rotatingGrabColourPreviewImage).color;
color5.a = f;
((Graphic)rotatingGrabColourPreviewImage).color = color5;
HandleRotatingSkinMatchChange();
}, CustomGrabBeamColour.LocalRotatingColour.a, CustomGrabColourConfig.MaxOpacity, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(10)));
return ((REPOElement)val30).rectTransform;
};
<>c.<>9__8_11 = val13;
obj24 = (object)val13;
}
obj23.AddElementToScrollView((ScrollViewBuilderDelegate)obj24, 0f, 0f);
REPOPopupPage obj25 = changeGrabColourPage;
object obj26 = <>c.<>9__8_12;
if (obj26 == null)
{
ScrollViewBuilderDelegate val14 = delegate(Transform parent)
{
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
REPOToggle val29 = MenuAPI.CreateREPOToggle("Match Skin Colour", (Action<bool>)delegate(bool val)
{
CustomGrabBeamColour.LocalRotatingColour.matchSkin = val;
HandleRotatingSkinMatchChange();
}, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(11)), "Yes", "No", CustomGrabBeamColour.LocalRotatingColour.matchSkin);
return ((REPOElement)val29).rectTransform;
};
<>c.<>9__8_12 = val14;
obj26 = (object)val14;
}
obj25.AddElementToScrollView((ScrollViewBuilderDelegate)obj26, 0f, 0f);
REPOPopupPage obj27 = changeGrabColourPage;
object obj28 = <>c.<>9__8_13;
if (obj28 == null)
{
ScrollViewBuilderDelegate val15 = delegate(Transform parent)
{
//IL_0012: 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_0032: Unknown result type (might be due to invalid IL or missing references)
REPOLabel val28 = MenuAPI.CreateREPOLabel("Healing Beam Colour", parent, new Vector2(0f, getVerticalOffsetForScrollChildren(6)));
((Component)val28).transform.localScale = Vector2.op_Implicit(new Vector2(0.5f, 0.5f));
return ((REPOElement)val28).rectTransform;
};
<>c.<>9__8_13 = val15;
obj28 = (object)val15;
}
obj27.AddElementToScrollView((ScrollViewBuilderDelegate)obj28, 0f, 0f);
REPOPopupPage obj29 = changeGrabColourPage;
object obj30 = <>c.<>9__8_14;
if (obj30 == null)
{
ScrollViewBuilderDelegate val16 = delegate(Transform parent)
{
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val27 = CreateColourSlider("Red", "", delegate(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalHealingColour.matchSkin)
{
CustomGrabBeamColour.LocalHealingColour.r = f;
Color color4 = ((Graphic)healingGrabColourPreviewImage).color;
color4.r = f;
((Graphic)healingGrabColourPreviewImage).color = color4;
HandleHealingSkinMatchChange();
}
}, CustomGrabBeamColour.LocalHealingColour.r, 1f, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(7)));
return ((REPOElement)val27).rectTransform;
};
<>c.<>9__8_14 = val16;
obj30 = (object)val16;
}
obj29.AddElementToScrollView((ScrollViewBuilderDelegate)obj30, 0f, 0f);
REPOPopupPage obj31 = changeGrabColourPage;
object obj32 = <>c.<>9__8_15;
if (obj32 == null)
{
ScrollViewBuilderDelegate val17 = delegate(Transform parent)
{
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val26 = CreateColourSlider("Green", "", delegate(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalHealingColour.matchSkin)
{
CustomGrabBeamColour.LocalHealingColour.g = f;
Color color3 = ((Graphic)healingGrabColourPreviewImage).color;
color3.g = f;
((Graphic)healingGrabColourPreviewImage).color = color3;
HandleHealingSkinMatchChange();
}
}, CustomGrabBeamColour.LocalHealingColour.g, 1f, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(8)));
return ((REPOElement)val26).rectTransform;
};
<>c.<>9__8_15 = val17;
obj32 = (object)val17;
}
obj31.AddElementToScrollView((ScrollViewBuilderDelegate)obj32, 0f, 0f);
REPOPopupPage obj33 = changeGrabColourPage;
object obj34 = <>c.<>9__8_16;
if (obj34 == null)
{
ScrollViewBuilderDelegate val18 = delegate(Transform parent)
{
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val25 = CreateColourSlider("Blue", "", delegate(float f)
{
//IL_0022: 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)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
if (!CustomGrabBeamColour.LocalHealingColour.matchSkin)
{
CustomGrabBeamColour.LocalHealingColour.b = f;
Color color2 = ((Graphic)healingGrabColourPreviewImage).color;
color2.b = f;
((Graphic)healingGrabColourPreviewImage).color = color2;
HandleHealingSkinMatchChange();
}
}, CustomGrabBeamColour.LocalHealingColour.b, 1f, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(9)));
return ((REPOElement)val25).rectTransform;
};
<>c.<>9__8_16 = val18;
obj34 = (object)val18;
}
obj33.AddElementToScrollView((ScrollViewBuilderDelegate)obj34, 0f, 0f);
REPOPopupPage obj35 = changeGrabColourPage;
object obj36 = <>c.<>9__8_17;
if (obj36 == null)
{
ScrollViewBuilderDelegate val19 = delegate(Transform parent)
{
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
REPOSlider val24 = CreateColourSlider("Opacity", "", delegate(float f)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: 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)
CustomGrabBeamColour.LocalHealingColour.a = f;
Color color = ((Graphic)healingGrabColourPreviewImage).color;
color.a = f;
((Graphic)healingGrabColourPreviewImage).color = color;
HandleHealingSkinMatchChange();
}, CustomGrabBeamColour.LocalHealingColour.a, CustomGrabColourConfig.MaxOpacity, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(10)));
return ((REPOElement)val24).rectTransform;
};
<>c.<>9__8_17 = val19;
obj36 = (object)val19;
}
obj35.AddElementToScrollView((ScrollViewBuilderDelegate)obj36, 0f, 0f);
REPOPopupPage obj37 = changeGrabColourPage;
object obj38 = <>c.<>9__8_18;
if (obj38 == null)
{
ScrollViewBuilderDelegate val20 = delegate(Transform parent)
{
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
REPOToggle val23 = MenuAPI.CreateREPOToggle("Match Skin Colour", (Action<bool>)delegate(bool val)
{
CustomGrabBeamColour.LocalHealingColour.matchSkin = val;
HandleHealingSkinMatchChange();
}, parent, new Vector2(0f, getVerticalOffsetForScrollChildren(11)), "Yes", "No", CustomGrabBeamColour.LocalHealingColour.matchSkin);
return ((REPOElement)val23).rectTransform;
};
<>c.<>9__8_18 = val20;
obj38 = (object)val20;
}
obj37.AddElementToScrollView((ScrollViewBuilderDelegate)obj38, 0f, 0f);
changeGrabColourPage.AddElement((BuilderDelegate)delegate(Transform parent)
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: 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_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: 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)
REPOButton val21 = MenuAPI.CreateREPOButton("Done", (Action)delegate
{
changeGrabColourPage.ClosePage(true);
CustomGrabBeamColour.UpdateBeamColourForAllBeams();
CustomGrabBeamColour.SaveLocalColoursToConfig();
}, parent, new Vector2(horizontalPos, 30f));
REPOButton val22 = MenuAPI.CreateREPOButton("Reset", (Action)delegate
{
changeGrabColourPage.ClosePage(true);
CustomGrabBeamColour.ResetBeamColours();
CustomGrabBeamColour.UpdateBeamColourForAllBeams();
CustomGrabBeamColour.SaveLocalColoursToConfig();
}, parent, new Vector2(590f, 30f));
val22.overrideButtonSize = val22.GetLabelSize() / 2f;
((Component)val22).transform.localScale = Vector2.op_Implicit(new Vector2(0.5f, 0.5f));
});
SetupPreviewRectangleColours(CustomGrabBeamColour.LocalNeutralColour.colour, CustomGrabBeamColour.LocalHealingColour.colour, CustomGrabBeamColour.LocalRotatingColour.colour);
changeGrabColourPage.OpenPage(false);
}
private static void SetupPreviewRectangleColours(Color neutralColour, Color healingColour, Color rotatingColour)
{
//IL_0006: 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_001e: Unknown result type (might be due to invalid IL or missing references)
((Graphic)neutralGrabColourPreviewImage).color = neutralColour;
((Graphic)healingGrabColourPreviewImage).color = healingColour;
((Graphic)rotatingGrabColourPreviewImage).color = rotatingColour;
HandleNeutralSkinMatchChange();
HandleRotatingSkinMatchChange();
HandleHealingSkinMatchChange();
}
private static void HandleNeutralSkinMatchChange()
{
//IL_001e: 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_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: 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)
((Graphic)neutralGrabColourPreviewImage).color = (CustomGrabBeamColour.LocalNeutralColour.matchSkin ? CustomGrabBeamColour.GetLocalBodyColour(Color.black) : CustomGrabBeamColour.LocalNeutralColour.colour);
Color color = ((Graphic)neutralGrabColourPreviewImage).color;
color.a = CustomGrabBeamColour.LocalNeutralColour.colour.a;
((Graphic)neutralGrabColourPreviewImage).color = color;
}
private static void HandleRotatingSkinMatchChange()
{
//IL_001e: 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_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: 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)
((Graphic)rotatingGrabColourPreviewImage).color = (CustomGrabBeamColour.LocalRotatingColour.matchSkin ? CustomGrabBeamColour.GetLocalBodyColour(Color.black) : CustomGrabBeamColour.LocalRotatingColour.colour);
Color color = ((Graphic)rotatingGrabColourPreviewImage).color;
color.a = CustomGrabBeamColour.LocalRotatingColour.colour.a;
((Graphic)rotatingGrabColourPreviewImage).color = color;
}
private static void HandleHealingSkinMatchChange()
{
//IL_001e: 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_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: 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)
((Graphic)healingGrabColourPreviewImage).color = (CustomGrabBeamColour.LocalHealingColour.matchSkin ? CustomGrabBeamColour.GetLocalBodyColour(Color.black) : CustomGrabBeamColour.LocalHealingColour.colour);
Color color = ((Graphic)healingGrabColourPreviewImage).color;
color.a = CustomGrabBeamColour.LocalHealingColour.colour.a;
((Graphic)healingGrabColourPreviewImage).color = color;
}
private static void CreateBeamPreviewColourRectangle(Transform parent, Vector2 position, out GameObject colourPreviewParent, out Image colourPreviewImage)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Expected O, but got Unknown
//IL_00ad: 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_00c5: 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)
colourPreviewParent = new GameObject();
((Object)colourPreviewParent).name = "Grab Beam Colour Preview Rectangle Parent";
colourPreviewParent.transform.SetParent(parent);
Canvas val = colourPreviewParent.AddComponent<Canvas>();
((Component)val).transform.SetParent(colourPreviewParent.gameObject.transform.parent);
GameObject val2 = new GameObject();
val2.transform.SetParent(((Component)val).gameObject.transform.parent);
colourPreviewImage = val2.AddComponent<Image>();
((Object)colourPreviewImage).name = "Grab Beam Colour Preview Rectangle Image";
((Component)colourPreviewImage).transform.SetParent(val2.gameObject.transform.parent);
((Graphic)colourPreviewImage).color = new Color(1f, 0f, 0f);
((Component)colourPreviewImage).gameObject.transform.position = Vector2.op_Implicit(position);
((Component)colourPreviewImage).gameObject.transform.localScale = new Vector3(0.85f, 0.85f, 1f);
}
public static REPOSlider CreateColourSlider(string name, string desc, Action<float> onChange, float initial, float max, Transform parent, Vector2 localPosition)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
return MenuAPI.CreateREPOSlider(name, desc, onChange, parent, localPosition, 0f, max, 2, initial, "", "", (BarBehavior)0);
}
private static float getVerticalOffsetForScrollChildren(int index)
{
return 40 * index;
}
private static float getVerticalPos(int offset)
{
int num = -Math.Abs(-offset);
num += 3;
return -12f + (float)(110 * num);
}
}
internal class ConfigUtil
{
public static string ColorToString(Color color)
{
return color.r + ", " + color.g + ", " + color.b + ", " + color.a;
}
public static Color StringToColor(string color, Color defaultColour)
{
//IL_0042: 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_00b0: 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_00e8: 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_00e4: 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_00d9: Unknown result type (might be due to invalid IL or missing references)
//IL_00de: Unknown result type (might be due to invalid IL or missing references)
string[] array = color.Split(',');
if (array.Length == 3)
{
float[] array2 = new float[3];
for (int i = 0; i < array.Length; i++)
{
try
{
array2.SetValue(float.Parse(array[i].Trim()), i);
}
catch
{
return defaultColour;
}
}
return new Color(array2[0], array2[1], array2[2], CustomGrabColourConfig.DefaultOpacity);
}
if (array.Length == 4)
{
float[] array3 = new float[4];
for (int j = 0; j < array.Length; j++)
{
try
{
array3.SetValue(float.Parse(array[j].Trim()), j);
}
catch
{
return defaultColour;
}
}
return new Color(array3[0], array3[1], array3[2], array3[3]);
}
return defaultColour;
}
}
internal class CustomGrabColourConfig
{
public struct BeamConfigEntries
{
public ConfigEntry<string> beamColour;
public ConfigEntry<bool> matchSkin;
public BeamConfigEntries(ConfigEntry<string> beamColour, ConfigEntry<bool> matchSkin)
{
this.beamColour = beamColour;
this.matchSkin = matchSkin;
}
}
public static Dictionary<GrabBeamColourSettings.BeamType, BeamConfigEntries> BeamTypeToConfigEntries = new Dictionary<GrabBeamColourSettings.BeamType, BeamConfigEntries>();
public static readonly float DefaultOpacity = 0.2f;
public static readonly float MaxOpacity = 0.5f;
public static readonly Color NeutralDefaultColour = new Color(1f, 0.58f, 0.19f, 0.35f);
public static readonly Color HealingDefaultColour = new Color(0.17f, 1f, 0.17f, DefaultOpacity);
public static readonly Color RotatingDefaultColour = new Color(0.65f, 0.06f, 0.8f, DefaultOpacity);
public static BeamConfigEntries neutralGrabBeam;
public static BeamConfigEntries healingGrabBeam;
public static BeamConfigEntries rotatingGrabBeam;
public static ConfigEntry<bool> enableDebugLogs;
private static readonly string ColourNotes = "\nStored as R,G,B,A values in 0-1 range";
public static void Init(ConfigFile config)
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: 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)
ConfigEntry<string> beamColour = config.Bind<string>("General", "NeutralGrabBeamColour", ConfigUtil.ColorToString(NeutralDefaultColour), "The default colour of the grab beam when holding an item." + ColourNotes);
ConfigEntry<bool> matchSkin = config.Bind<bool>("General", "NeutralGrabBeamMatchSkin", true, "Should the neutral grab beam match the colour of your skin?");
neutralGrabBeam = new BeamConfigEntries(beamColour, matchSkin);
BeamTypeToConfigEntries.Add(GrabBeamColourSettings.BeamType.Neutral, neutralGrabBeam);
ConfigEntry<string> beamColour2 = config.Bind<string>("General", "RotatingGrabBeamColour", ConfigUtil.ColorToString(RotatingDefaultColour), "The colour of the grab beam when rotating an item or monster." + ColourNotes);
ConfigEntry<bool> matchSkin2 = config.Bind<bool>("General", "RotatingGrabBeamMatchSkin", false, "Should the rotating grab beam match the colour of your skin?");
rotatingGrabBeam = new BeamConfigEntries(beamColour2, matchSkin2);
BeamTypeToConfigEntries.Add(GrabBeamColourSettings.BeamType.Rotate, rotatingGrabBeam);
ConfigEntry<string> beamColour3 = config.Bind<string>("General", "HealingGrabBeamColour", ConfigUtil.ColorToString(HealingDefaultColour), "The colour of the grab beam when healing another player." + ColourNotes);
ConfigEntry<bool> matchSkin3 = config.Bind<bool>("General", "HealingGrabBeamMatchSkin", false, "Should the healing grab beam match the colour of your skin?");
healingGrabBeam = new BeamConfigEntries(beamColour3, matchSkin3);
BeamTypeToConfigEntries.Add(GrabBeamColourSettings.BeamType.Heal, healingGrabBeam);
enableDebugLogs = config.Bind<bool>("Debug", "EnableDebugLogs", false, "Outputs additional debugging information to the log");
LoadValuesFromConfig();
}
public static void LoadValuesFromConfig()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: 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)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: 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_006b: 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_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
Color val = ConfigUtil.StringToColor(neutralGrabBeam.beamColour.Value, NeutralDefaultColour);
val.a = Mathf.Clamp(val.a, 0f, MaxOpacity);
CustomGrabBeamColour.LocalNeutralColour = new GrabBeamColourSettings(val, neutralGrabBeam.matchSkin.Value, GrabBeamColourSettings.BeamType.Neutral);
Color val2 = ConfigUtil.StringToColor(rotatingGrabBeam.beamColour.Value, RotatingDefaultColour);
val2.a = Mathf.Clamp(val2.a, 0f, MaxOpacity);
CustomGrabBeamColour.LocalRotatingColour = new GrabBeamColourSettings(val2, rotatingGrabBeam.matchSkin.Value, GrabBeamColourSettings.BeamType.Rotate);
Color val3 = ConfigUtil.StringToColor(healingGrabBeam.beamColour.Value, HealingDefaultColour);
val3.a = Mathf.Clamp(val3.a, 0f, MaxOpacity);
CustomGrabBeamColour.LocalHealingColour = new GrabBeamColourSettings(val3, healingGrabBeam.matchSkin.Value, GrabBeamColourSettings.BeamType.Heal);
}
public static void SaveColour(GrabBeamColourSettings beamColourSettings)
{
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
Plugin.LogMessageIfDebug("Saving colour to config file: " + beamColourSettings);
beamColourSettings.a = Mathf.Clamp(beamColourSettings.a, 0f, MaxOpacity);
if (!BeamTypeToConfigEntries.TryGetValue(beamColourSettings.beamType, out var value))
{
Plugin.LogWarning("Unable to save colour value for beam type: " + beamColourSettings.beamType);
}
value.beamColour.Value = ConfigUtil.ColorToString(beamColourSettings.colour);
value.matchSkin.Value = beamColourSettings.matchSkin;
}
}
internal class PhysGrabberPatches
{
[HarmonyPatch(typeof(PhysGrabber))]
[HarmonyPatch("ColorStateSetColor")]
private class PhysGrabber_ColorState_Patch
{
private static FieldRef<PhysGrabber, int> prevColorStateRef = AccessTools.FieldRefAccess<PhysGrabber, int>("prevColorState");
private static void Prefix(PhysGrabber __instance, ref Color mainColor, ref Color emissionColor)
{
//IL_00c8: 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_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: 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_00d0: 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_00f4: Unknown result type (might be due to invalid IL or missing references)
//IL_0106: 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_0124: 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_01d0: Unknown result type (might be due to invalid IL or missing references)
int num = prevColorStateRef.Invoke(__instance);
bool flag = false;
CustomGrabBeamColour component = ((Component)__instance.playerAvatar).gameObject.GetComponent<CustomGrabBeamColour>();
if (!Object.op_Implicit((Object)(object)component))
{
Plugin.LogMessageIfDebug("Player has no custom beam colour");
ResetRotateBeamGridsColour(__instance);
return;
}
GrabBeamColourSettings grabBeamColourSettings;
switch (num)
{
case 0:
grabBeamColourSettings = component.currentNeutralColour;
break;
case 1:
grabBeamColourSettings = component.currentHealingColour;
break;
case 2:
grabBeamColourSettings = component.currentRotatingColour;
break;
default:
ResetRotateBeamGridsColour(__instance);
return;
}
Color val;
if (grabBeamColourSettings.matchSkin)
{
val = component.GetBodyColour(grabBeamColourSettings.colour);
val.a = grabBeamColourSettings.colour.a;
}
else
{
val = grabBeamColourSettings.colour;
}
mainColor.r = val.r / 3.5f;
mainColor.g = val.g / 4f;
mainColor.b = val.b / 3.5f;
mainColor.a = val.a;
emissionColor.r = val.r / 3.5f;
emissionColor.g = val.g / 4f;
emissionColor.b = val.b / 3.5f;
emissionColor.a = 0.1f;
Plugin.LogMessageIfDebug("Set player beam to: (" + mainColor.r + ", " + mainColor.g + ", " + mainColor.b + ", " + mainColor.a + "). colour state is " + num);
SetRotateBeamGridsColour(__instance, val);
}
}
[HarmonyPatch(typeof(PhysGrabber))]
[HarmonyPatch("ChangeBeamAlpha")]
private class PhysGrabber_ChangeBeamAlpha_Patch
{
private static bool Prefix()
{
return false;
}
}
[HarmonyPatch(typeof(PhysGrabber))]
[HarmonyPatch("PhysGrabBeamActivateRPC")]
private class PhysGrabber_PhysGrabBeamActivateRPC_Patch
{
private static void Postfix(PhysGrabber __instance)
{
GrabBeamUtil.TrySendBeamColourUpdateForAllBeams(__instance.playerAvatar);
}
}
[HarmonyPatch(typeof(PhysGrabber))]
[HarmonyPatch("PhysGrabBeamActivate")]
private class PhysGrabber_PhysGrabBeamActivate_Patch
{
private static async void Prefix(PhysGrabber __instance)
{
bool grabBeamActive = true;
try
{
FieldInfo grabBeamActiveField = ((object)__instance).GetType().GetField("physGrabBeamActive", BindingFlags.Instance | BindingFlags.NonPublic);
grabBeamActive = (bool)grabBeamActiveField.GetValue(__instance);
}
catch (Exception)
{
Plugin.LogMessageIfDebug("Failed to get value of PhysGrabber physGrabBeamActive field");
}
if (!grabBeamActive)
{
await Task.Delay(100);
Plugin.LogMessageIfDebug("PhysGrabBeamActivate called");
GrabBeamUtil.TrySendBeamColourUpdateForAllBeams(__instance.playerAvatar);
}
}
}
private static FieldRef<PhysGrabber, List<GameObject>> physGrabPointVisualGridObjectsRef = AccessTools.FieldRefAccess<PhysGrabber, List<GameObject>>("physGrabPointVisualGridObjects");
internal static void ResetRotateBeamGridsColour(PhysGrabber __instance)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
SetRotateBeamGridsColour(__instance, CustomGrabColourConfig.RotatingDefaultColour);
}
internal static void SetRotateBeamGridsColour(PhysGrabber __instance, Color gridColour)
{
//IL_0038: 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_0050: 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_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: 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_008a: 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)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: 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_0122: Unknown result type (might be due to invalid IL or missing references)
List<GameObject> list = physGrabPointVisualGridObjectsRef.Invoke(__instance);
Color color = default(Color);
Color val = default(Color);
for (int i = 0; i < list.Count; i++)
{
Material material = ((Renderer)list[i].GetComponent<MeshRenderer>()).material;
if (Object.op_Implicit((Object)(object)material))
{
((Color)(ref color))..ctor(gridColour.r / 3.5f, gridColour.g / 4f, gridColour.b / 3.5f, gridColour.a);
material.color = color;
((Color)(ref val))..ctor(gridColour.r / 3.5f, gridColour.g / 4f, gridColour.b / 3.5f, 0.1f);
material.SetColor("_EmissionColor", val);
Plugin.LogMessageIfDebug("Set grid mesh to: (" + material.color.r + ", " + material.color.g + ", " + material.color.b + ", " + material.color.a + ")");
}
}
}
}
internal class PlayerAvatarPatches
{
[HarmonyPatch(typeof(PlayerAvatar))]
[HarmonyPatch("Awake")]
private class PlayerAvatar_Awake_Patch
{
public static void Postfix(PlayerAvatar __instance)
{
((Component)__instance).gameObject.AddComponent<CustomGrabBeamColour>();
}
}
[HarmonyPatch(typeof(PlayerAvatar))]
[HarmonyPatch("PlayerAvatarSetColor")]
private class PlayerAvatar_PlayerAvatarSetColor_Patch
{
public static void Postfix(PlayerAvatar __instance, int colorIndex)
{
GrabBeamUtil.TrySendBeamColourUpdateForAllBeams(__instance);
}
}
}
public class CustomGrabBeamColour : MonoBehaviour, IPunObservable
{
internal static GrabBeamColourSettings LocalNeutralColour;
internal static GrabBeamColourSettings LocalHealingColour;
internal static GrabBeamColourSettings LocalRotatingColour;
internal GrabBeamColourSettings currentNeutralColour;
internal GrabBeamColourSettings currentHealingColour;
internal GrabBeamColourSettings currentRotatingColour;
public PlayerAvatar player;
internal Material bodyMaterialInternal;
public Material BodyMaterial
{
get
{
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Expected O, but got Unknown
if ((Object)(object)bodyMaterialInternal == (Object)null)
{
try
{
FieldInfo field = ((object)player.playerHealth).GetType().GetField("bodyMaterial", BindingFlags.Instance | BindingFlags.NonPublic);
bodyMaterialInternal = (Material)field.GetValue(player.playerHealth);
}
catch (Exception)
{
Plugin.LogMessageIfDebug("Failed to get value of PlayerHealth bodyMaterial field");
return null;
}
return bodyMaterialInternal;
}
return bodyMaterialInternal;
}
set
{
bodyMaterialInternal = value;
}
}
public static GrabBeamColourSettings LocalBeamColour
{
get
{
throw new NotImplementedException("Tried to get field LocalBeamColour, call GetLocalSettingsForBeamType instead");
}
set
{
switch (value.beamType)
{
case GrabBeamColourSettings.BeamType.Neutral:
LocalNeutralColour = value;
break;
case GrabBeamColourSettings.BeamType.Heal:
LocalHealingColour = value;
break;
case GrabBeamColourSettings.BeamType.Rotate:
LocalRotatingColour = value;
break;
}
}
}
public GrabBeamColourSettings CurrentBeamColour
{
get
{
throw new NotImplementedException("Tried to get field CurrentBeamColour, call GetSettingsForBeamType instead");
}
set
{
switch (value.beamType)
{
case GrabBeamColourSettings.BeamType.Neutral:
currentNeutralColour = value;
break;
case GrabBeamColourSettings.BeamType.Heal:
currentHealingColour = value;
break;
case GrabBeamColourSettings.BeamType.Rotate:
currentRotatingColour = value;
break;
}
}
}
public static GrabBeamColourSettings GetLocalSettingsForBeamType(GrabBeamColourSettings.BeamType beamType)
{
return beamType switch
{
GrabBeamColourSettings.BeamType.Heal => LocalHealingColour,
GrabBeamColourSettings.BeamType.Rotate => LocalRotatingColour,
_ => LocalNeutralColour,
};
}
public GrabBeamColourSettings GetSettingsForBeamType(GrabBeamColourSettings.BeamType beamType)
{
return beamType switch
{
GrabBeamColourSettings.BeamType.Heal => currentNeutralColour,
GrabBeamColourSettings.BeamType.Rotate => currentHealingColour,
_ => currentRotatingColour,
};
}
private void Awake()
{
player = ((Component)this).gameObject.GetComponent<PlayerAvatar>();
}
public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
{
throw new NotImplementedException();
}
public static void SaveLocalColoursToConfig()
{
CustomGrabColourConfig.SaveColour(LocalNeutralColour);
CustomGrabColourConfig.SaveColour(LocalHealingColour);
CustomGrabColourConfig.SaveColour(LocalRotatingColour);
}
public static void ResetBeamColours()
{
//IL_0001: 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)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
LocalNeutralColour = new GrabBeamColourSettings(CustomGrabColourConfig.NeutralDefaultColour, (bool)((ConfigEntryBase)CustomGrabColourConfig.neutralGrabBeam.matchSkin).DefaultValue, GrabBeamColourSettings.BeamType.Neutral);
LocalHealingColour = new GrabBeamColourSettings(CustomGrabColourConfig.HealingDefaultColour, (bool)((ConfigEntryBase)CustomGrabColourConfig.healingGrabBeam.matchSkin).DefaultValue, GrabBeamColourSettings.BeamType.Heal);
LocalRotatingColour = new GrabBeamColourSettings(CustomGrabColourConfig.RotatingDefaultColour, (bool)((ConfigEntryBase)CustomGrabColourConfig.rotatingGrabBeam.matchSkin).DefaultValue, GrabBeamColourSettings.BeamType.Rotate);
UpdateBeamColourForAllBeams();
}
public static void UpdateBeamColour(GrabBeamColourSettings newColour)
{
newColour.a = Mathf.Clamp(newColour.a, 0f, CustomGrabColourConfig.MaxOpacity);
LocalBeamColour = newColour;
UpdateBeamColour(newColour.beamType);
}
public static void UpdateBeamColourForAllBeams()
{
foreach (GrabBeamColourSettings.BeamType value in Enum.GetValues(typeof(GrabBeamColourSettings.BeamType)))
{
UpdateBeamColour(value);
}
}
public static void UpdateBeamColour(GrabBeamColourSettings.BeamType beamType)
{
GrabBeamColourSettings localSettingsForBeamType = GetLocalSettingsForBeamType(beamType);
if (GameManager.Multiplayer())
{
PlayerAvatar.instance.photonView.RPC("SetBeamColourRPC", (RpcTarget)3, GrabBeamColourSettings.ToRPCBuffer(localSettingsForBeamType));
}
else
{
((Component)PlayerAvatar.instance).GetComponent<CustomGrabBeamColour>().SetBeamColourRPC(GrabBeamColourSettings.ToRPCBuffer(localSettingsForBeamType));
}
}
[PunRPC]
public void SetBeamColourRPC(object[] beamColourParts)
{
GrabBeamColourSettings currentBeamColour = GrabBeamColourSettings.FromRPCBuffer(beamColourParts);
Plugin.LogMessageIfDebug("SetBeamColourRPC called with values: r:" + currentBeamColour.r + ", g:" + currentBeamColour.g + ", b:" + currentBeamColour.b + ", a:" + currentBeamColour.a + ", matchSkin:" + currentBeamColour.matchSkin + ", beamType:" + currentBeamColour.beamType);
currentBeamColour.a = Mathf.Clamp(currentBeamColour.a, 0f, CustomGrabColourConfig.MaxOpacity);
CurrentBeamColour = currentBeamColour;
if (currentBeamColour.beamType != 0)
{
return;
}
Type type = ((object)player.physGrabber).GetType();
try
{
FieldInfo field = type.GetField("prevColorState", BindingFlags.Instance | BindingFlags.NonPublic);
field.SetValue(player.physGrabber, -1);
}
catch (Exception ex)
{
Plugin.LogErrorIfDebug("Error while setting field 'prevColorState', this is probably harmless.\n" + ex);
}
try
{
MethodInfo method = type.GetMethod("ColorStates", BindingFlags.Instance | BindingFlags.NonPublic);
method.Invoke(player.physGrabber, null);
}
catch (Exception ex2)
{
Plugin.LogErrorIfDebug("Error while calling method 'ColorStates', this is probably harmless.\n" + ex2);
}
}
public Color GetBodyColour(Color fallbackColour)
{
//IL_0011: 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_001b: 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_001f: Unknown result type (might be due to invalid IL or missing references)
Color color = BodyMaterial.GetColor(Shader.PropertyToID("_AlbedoColor"));
bool flag = false;
return color;
}
public static Color GetLocalBodyColour(Color fallbackColour)
{
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: 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_0034: Expected O, but got Unknown
//IL_003f: 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_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: 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)
Color color;
try
{
FieldInfo field = ((object)PlayerAvatar.instance.playerHealth).GetType().GetField("bodyMaterial", BindingFlags.Instance | BindingFlags.NonPublic);
Material val = (Material)field.GetValue(PlayerAvatar.instance.playerHealth);
color = val.GetColor(Shader.PropertyToID("_AlbedoColor"));
}
catch (Exception)
{
Plugin.LogMessageIfDebug("Failed to get value of PlayerHealth bodyMaterial field in GetLocalBodyColour");
return fallbackColour;
}
bool flag = false;
return color;
}
}
public struct GrabBeamColourSettings
{
public enum BeamType : byte
{
Neutral,
Heal,
Rotate
}
public Color colour;
public bool matchSkin;
public BeamType beamType;
public float r
{
get
{
return colour.r;
}
set
{
colour.r = value;
}
}
public float g
{
get
{
return colour.g;
}
set
{
colour.g = value;
}
}
public float b
{
get
{
return colour.b;
}
set
{
colour.b = value;
}
}
public float a
{
get
{
return colour.a;
}
set
{
colour.a = value;
}
}
public GrabBeamColourSettings(Color colour, bool matchSkin, BeamType beamType)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
this.colour = colour;
this.matchSkin = matchSkin;
this.beamType = beamType;
}
public static object[] ToRPCBuffer(GrabBeamColourSettings beamColour)
{
//IL_0002: 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_0010: 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_002c: 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)
Color val = beamColour.colour;
return new object[6]
{
val.r,
val.g,
val.b,
val.a,
beamColour.matchSkin,
(byte)beamColour.beamType
};
}
public static GrabBeamColourSettings FromRPCBuffer(object[] rpcBuffer)
{
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
if (!(rpcBuffer[0] is float) || !(rpcBuffer[1] is float) || !(rpcBuffer[2] is float) || !(rpcBuffer[3] is float) || !(rpcBuffer[4] is bool) || !(rpcBuffer[5] is byte))
{
throw new ArgumentException("FromRPCBuffer recieved incorrect parameters");
}
Color val = default(Color);
((Color)(ref val))..ctor((float)rpcBuffer[0], (float)rpcBuffer[1], (float)rpcBuffer[2], (float)rpcBuffer[3]);
return new GrabBeamColourSettings(val, (bool)rpcBuffer[4], (BeamType)rpcBuffer[5]);
}
}
internal class GrabBeamUtil
{
public static void TrySendBeamColourUpdate(PlayerAvatar player, GrabBeamColourSettings.BeamType beamType)
{
CustomGrabBeamColour component = ((Component)player).GetComponent<CustomGrabBeamColour>();
if ((Object)(object)component != (Object)null)
{
CustomGrabBeamColour.UpdateBeamColour(beamType);
}
}
public static void TrySendBeamColourUpdateForAllBeams(PlayerAvatar player)
{
CustomGrabBeamColour component = ((Component)player).GetComponent<CustomGrabBeamColour>();
foreach (GrabBeamColourSettings.BeamType value in Enum.GetValues(typeof(GrabBeamColourSettings.BeamType)))
{
TrySendBeamColourUpdate(player, value);
}
}
}
namespace CustomGrabColour
{
public static class PluginInfo
{
public const string PLUGIN_ID = "CustomGrabColour";
public const string PLUGIN_NAME = "CustomGrabColour";
public const string PLUGIN_VERSION = "2.1.0";
public const string PLUGIN_GUID = "games.enchanted.CustomGrabColour";
}
[BepInPlugin("games.enchanted.CustomGrabColour", "CustomGrabColour", "2.1.0")]
public class Plugin : BaseUnityPlugin
{
public ManualLogSource PluginLogger;
public static ConfigEntry<bool> enableDebugLogs;
public static Plugin Instance { get; private set; }
public static void LogMessageIfDebug(object message)
{
if (CustomGrabColourConfig.enableDebugLogs.Value)
{
Instance.PluginLogger.LogMessage((object)("CustomGrabColour Debug: " + message));
}
}
public static void LogMessage(object message)
{
Instance.PluginLogger.LogMessage((object)("CustomGrabColour: " + message));
}
public static void LogError(object message)
{
Instance.PluginLogger.LogError((object)("CustomGrabColour Debug: " + message));
}
public static void LogErrorIfDebug(object message)
{
if (CustomGrabColourConfig.enableDebugLogs.Value)
{
Instance.PluginLogger.LogError((object)("CustomGrabColour: " + message));
}
}
public static void LogWarning(object message)
{
Instance.PluginLogger.LogWarning((object)("CustomGrabColour: " + message));
}
private void Awake()
{
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Expected O, but got Unknown
Instance = this;
PluginLogger = ((BaseUnityPlugin)this).Logger;
PluginLogger.LogInfo((object)"Loading plugin CustomGrabColour! (games.enchanted.CustomGrabColour)");
CustomGrabColourConfig.Init(((BaseUnityPlugin)this).Config);
Harmony val = new Harmony("games.enchanted.CustomGrabColour");
val.PatchAll();
ConfigMenu.Init();
PluginLogger.LogInfo((object)"Loading finished for CustomGrabColour! (games.enchanted.CustomGrabColour)");
}
}
}