using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Threading;
using BepInEx;
using HandPaint.Components;
using HandPaint.Scripts;
using HarmonyLib;
using PluginConfig.API;
using PluginConfig.API.Fields;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("HandPaint")]
[assembly: AssemblyDescription("ULTRAKILL plugin enabling custom arms colors")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HandPaint")]
[assembly: AssemblyCopyright("Copyright © 2024 Flazhik")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("D79551C3-9E3E-46FF-95A5-029A9093600A")]
[assembly: AssemblyFileVersion("1.0.4.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.4.0")]
namespace HandPaint
{
public class AssetsManager : MonoSingleton<AssetsManager>
{
private const BindingFlags Flags = BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
private static readonly Dictionary<string, Object> Prefabs = new Dictionary<string, Object>();
private AssetBundle _bundle;
public void LoadAssets()
{
_bundle = AssetBundle.LoadFromMemory(Resources.HandPaint);
}
public void RegisterPrefabs()
{
string[] allAssetNames = _bundle.GetAllAssetNames();
foreach (string text in allAssetNames)
{
Prefabs.Add(text, _bundle.LoadAsset<Object>(text));
}
Type[] types = Assembly.GetExecutingAssembly().GetTypes();
for (int i = 0; i < types.Length; i++)
{
CheckType(types[i]);
}
}
private static void CheckType(IReflect type)
{
type.GetFields(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).ToList().ForEach(ProcessField);
}
private static void ProcessField(FieldInfo field)
{
if (!field.FieldType.IsArray && field.IsStatic)
{
PrefabAsset customAttribute = field.GetCustomAttribute<PrefabAsset>();
if (customAttribute != null)
{
field.SetValue(null, Prefabs[customAttribute.Path]);
}
}
}
public static Object GetAsset(string assetName)
{
return Prefabs[assetName];
}
}
public static class HandPaintConfig
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static BoolValueChangeEventDelegate <>9__25_0;
public static BoolValueChangeEventDelegate <>9__25_1;
public static BoolValueChangeEventDelegate <>9__25_2;
public static BoolValueChangeEventDelegate <>9__25_3;
internal void <Init>b__25_0(BoolValueChangeEvent v)
{
bool flag = !v.value || SkittlePoxIsActive();
((ConfigField)EasterEggConfig.Panel).hidden = !SkittlePoxIsActive();
((ConfigField)FeedbackerPanelDivision).hidden = flag;
((ConfigField)RightFeedbackerPanelDivision).hidden = flag;
((ConfigField)RightFeedbackerPanel).hidden = flag || !PaintFeedbackerSeparately.value;
}
internal void <Init>b__25_1(BoolValueChangeEvent v)
{
bool hidden = !v.value || SkittlePoxIsActive();
((ConfigField)EasterEggConfig.Panel).hidden = !SkittlePoxIsActive();
((ConfigField)KnuckleblasterPanelDivision).hidden = hidden;
}
internal void <Init>b__25_2(BoolValueChangeEvent v)
{
bool hidden = !v.value || SkittlePoxIsActive();
((ConfigField)EasterEggConfig.Panel).hidden = !SkittlePoxIsActive();
((ConfigField)WhiplashPanelDivision).hidden = hidden;
}
internal void <Init>b__25_3(BoolValueChangeEvent v)
{
((ConfigField)RightFeedbackerPanel).hidden = !v.value || !RepaintFeedbacker.value;
}
}
public static readonly BoolField PaintFeedbackerSeparately;
public static readonly BoolField RepaintWhiplash;
public static readonly ColorAlphaField[] WhiplashColors;
public static ColorAlphaField WhiplashRopeColorField;
public static readonly BoolField RepaintKnuckleblaster;
public static readonly ColorAlphaField[] KnuckleblasterColors;
public static ColorAlphaField KnuckleblasterShellColorField;
public static readonly BoolField RepaintFeedbacker;
public static readonly ColorAlphaField[] FeedbackerColors;
public static readonly ColorAlphaField[] RightFeedbackerColors;
public static readonly EasterEggConfig EasterEggConfig;
private static readonly ConfigPanel FeedbackerPanel;
private static readonly ConfigPanel RightFeedbackerPanel;
private static readonly ConfigPanel KnuckleblasterPanel;
private static readonly ConfigPanel WhiplashPanel;
private static readonly ConfigDivision FeedbackerPanelDivision;
private static readonly ConfigDivision RightFeedbackerPanelDivision;
private static readonly ConfigDivision KnuckleblasterPanelDivision;
private static readonly ConfigDivision WhiplashPanelDivision;
private static readonly Color[] BaseFeedbackerColors;
private static readonly Color[] BaseKnuckleblasterColors;
private static readonly Color[] BaseWhiplashColors;
private static readonly Color BaseWhiplashRopeColor;
private static readonly Color BaseKnuckleblasterShellColor;
static HandPaintConfig()
{
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: 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_00d8: Unknown result type (might be due to invalid IL or missing references)
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
//IL_011e: 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_013e: 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_015e: 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_017c: 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_019a: Unknown result type (might be due to invalid IL or missing references)
//IL_019f: Unknown result type (might be due to invalid IL or missing references)
//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
//IL_01ce: Expected O, but got Unknown
//IL_01de: Unknown result type (might be due to invalid IL or missing references)
//IL_01e8: Expected O, but got Unknown
//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
//IL_0202: Expected O, but got Unknown
//IL_0212: Unknown result type (might be due to invalid IL or missing references)
//IL_021c: Expected O, but got Unknown
//IL_022c: Unknown result type (might be due to invalid IL or missing references)
//IL_0236: Expected O, but got Unknown
//IL_0246: Unknown result type (might be due to invalid IL or missing references)
//IL_0250: Expected O, but got Unknown
//IL_0260: Unknown result type (might be due to invalid IL or missing references)
//IL_026a: Expected O, but got Unknown
//IL_027a: Unknown result type (might be due to invalid IL or missing references)
//IL_0284: Expected O, but got Unknown
//IL_028e: Unknown result type (might be due to invalid IL or missing references)
//IL_0298: Expected O, but got Unknown
//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
//IL_02ac: Expected O, but got Unknown
//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
//IL_02c0: Expected O, but got Unknown
//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
//IL_02d4: Expected O, but got Unknown
WhiplashColors = new ColorAlphaField[3];
KnuckleblasterColors = new ColorAlphaField[3];
FeedbackerColors = new ColorAlphaField[3];
RightFeedbackerColors = new ColorAlphaField[3];
BaseFeedbackerColors = (Color[])(object)new Color[3]
{
new Color(0.251f, 0.439f, 0.933f, 1f),
new Color(0.392f, 0.392f, 0.392f, 1f),
new Color(0.251f, 0.439f, 0.933f, 1f)
};
BaseKnuckleblasterColors = (Color[])(object)new Color[3]
{
new Color(0.859f, 0.09f, 0.09f, 1f),
new Color(0.498f, 0.314f, 0.251f, 1f),
new Color(0.878f, 0.686f, 0.514f, 1f)
};
BaseWhiplashColors = (Color[])(object)new Color[3]
{
new Color(0.486f, 0.612f, 0.153f, 1f),
new Color(0.843f, 0.686f, 0.498f, 1f),
new Color(0.409f, 0.345f, 0.282f, 1f)
};
BaseWhiplashRopeColor = new Color(0.25f, 0.25f, 0.25f);
BaseKnuckleblasterShellColor = new Color(1f, 0f, 0f, 1f);
PluginConfigurator obj = PluginConfigurator.Create("HandPaint", "dev.flazhik.handpaint");
PaintFeedbackerSeparately = new BoolField(obj.rootPanel, "Paint feedbacker arms separately", "handpaint.paint-feedbacker-separately", false);
FeedbackerPanel = new ConfigPanel(obj.rootPanel, "Feedbacker config", "handpaint.feedbacker-colors");
RightFeedbackerPanel = new ConfigPanel(obj.rootPanel, "Feedbacker right arm config", "handpaint.feedbacker-r-colors");
KnuckleblasterPanel = new ConfigPanel(obj.rootPanel, "Knuckleblaster config", "handpaint.knuckleblaster-colors");
WhiplashPanel = new ConfigPanel(obj.rootPanel, "Whiplash config", "handpaint.whiplash-colors");
RepaintFeedbacker = new BoolField(FeedbackerPanel, "Repaint feedbacker", "handpaint.repaint-feedbacker", true);
RepaintKnuckleblaster = new BoolField(KnuckleblasterPanel, "Repaint knuckleblaster", "handpaint.repaint-knuckleblaster", true);
RepaintWhiplash = new BoolField(WhiplashPanel, "Repaint whiplash", "handpaint.repaint-whiplash", true);
FeedbackerPanelDivision = new ConfigDivision(FeedbackerPanel, "feedbacker-division");
RightFeedbackerPanelDivision = new ConfigDivision(RightFeedbackerPanel, "feedbacker-r-division");
KnuckleblasterPanelDivision = new ConfigDivision(KnuckleblasterPanel, "knuckleblaster-division");
WhiplashPanelDivision = new ConfigDivision(WhiplashPanel, "whiplash-division");
EasterEggConfig = new EasterEggConfig(obj);
obj.SetIconWithURL("file://" + Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty, "icon.png"));
Init();
}
private static void Init()
{
//IL_003c: 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_00bc: 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_0121: Unknown result type (might be due to invalid IL or missing references)
//IL_013f: Unknown result type (might be due to invalid IL or missing references)
//IL_0167: Unknown result type (might be due to invalid IL or missing references)
//IL_016c: Unknown result type (might be due to invalid IL or missing references)
//IL_0172: Expected O, but got Unknown
//IL_0190: Unknown result type (might be due to invalid IL or missing references)
//IL_0195: Unknown result type (might be due to invalid IL or missing references)
//IL_019b: Expected O, but got Unknown
//IL_01b9: 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_01c4: Expected O, but got Unknown
//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
//IL_01ed: Expected O, but got Unknown
for (int i = 0; i < 3; i++)
{
WhiplashColors[i] = new ColorAlphaField((ConfigPanel)(object)WhiplashPanelDivision, $"Whiplash color {i + 1}", $"handpaint.whiplash-color-{i + 1}", BaseWhiplashColors[i]);
KnuckleblasterColors[i] = new ColorAlphaField((ConfigPanel)(object)KnuckleblasterPanelDivision, $"Knuckleblaster color {i + 1}", $"handpaint.knuckleblaster-color-{i + 1}", BaseKnuckleblasterColors[i]);
FeedbackerColors[i] = new ColorAlphaField((ConfigPanel)(object)FeedbackerPanelDivision, $"Feedbacker color {i + 1}", $"handpaint.feedbacker-l-color-{i + 1}", BaseFeedbackerColors[i]);
RightFeedbackerColors[i] = new ColorAlphaField((ConfigPanel)(object)RightFeedbackerPanelDivision, $"Feedbacker right arm color {i + 1}", $"handpaint.feedbacker-r-color-{i + 1}", BaseFeedbackerColors[i]);
}
WhiplashRopeColorField = new ColorAlphaField((ConfigPanel)(object)WhiplashPanelDivision, "Whiplash rope color", "handpaint.whiplash-rope-color", BaseWhiplashRopeColor);
KnuckleblasterShellColorField = new ColorAlphaField((ConfigPanel)(object)KnuckleblasterPanelDivision, "Knuckleblaster shell color", "handpaint.knuckleblaster-shell-color", BaseKnuckleblasterShellColor);
BoolField repaintFeedbacker = RepaintFeedbacker;
object obj = <>c.<>9__25_0;
if (obj == null)
{
BoolValueChangeEventDelegate val = delegate(BoolValueChangeEvent v)
{
bool flag = !v.value || SkittlePoxIsActive();
((ConfigField)EasterEggConfig.Panel).hidden = !SkittlePoxIsActive();
((ConfigField)FeedbackerPanelDivision).hidden = flag;
((ConfigField)RightFeedbackerPanelDivision).hidden = flag;
((ConfigField)RightFeedbackerPanel).hidden = flag || !PaintFeedbackerSeparately.value;
};
<>c.<>9__25_0 = val;
obj = (object)val;
}
repaintFeedbacker.onValueChange += (BoolValueChangeEventDelegate)obj;
BoolField repaintKnuckleblaster = RepaintKnuckleblaster;
object obj2 = <>c.<>9__25_1;
if (obj2 == null)
{
BoolValueChangeEventDelegate val2 = delegate(BoolValueChangeEvent v)
{
bool hidden2 = !v.value || SkittlePoxIsActive();
((ConfigField)EasterEggConfig.Panel).hidden = !SkittlePoxIsActive();
((ConfigField)KnuckleblasterPanelDivision).hidden = hidden2;
};
<>c.<>9__25_1 = val2;
obj2 = (object)val2;
}
repaintKnuckleblaster.onValueChange += (BoolValueChangeEventDelegate)obj2;
BoolField repaintWhiplash = RepaintWhiplash;
object obj3 = <>c.<>9__25_2;
if (obj3 == null)
{
BoolValueChangeEventDelegate val3 = delegate(BoolValueChangeEvent v)
{
bool hidden = !v.value || SkittlePoxIsActive();
((ConfigField)EasterEggConfig.Panel).hidden = !SkittlePoxIsActive();
((ConfigField)WhiplashPanelDivision).hidden = hidden;
};
<>c.<>9__25_2 = val3;
obj3 = (object)val3;
}
repaintWhiplash.onValueChange += (BoolValueChangeEventDelegate)obj3;
BoolField paintFeedbackerSeparately = PaintFeedbackerSeparately;
object obj4 = <>c.<>9__25_3;
if (obj4 == null)
{
BoolValueChangeEventDelegate val4 = delegate(BoolValueChangeEvent v)
{
((ConfigField)RightFeedbackerPanel).hidden = !v.value || !RepaintFeedbacker.value;
};
<>c.<>9__25_3 = val4;
obj4 = (object)val4;
}
paintFeedbackerSeparately.onValueChange += (BoolValueChangeEventDelegate)obj4;
TriggerValueChangeEvent();
}
public static void TriggerValueChangeEvent()
{
RepaintFeedbacker.TriggerValueChangeEvent();
RepaintKnuckleblaster.TriggerValueChangeEvent();
RepaintKnuckleblaster.TriggerValueChangeEvent();
}
private static bool SkittlePoxIsActive()
{
return MonoSingleton<SkittlesPox>.Instance.activated;
}
}
[BepInProcess("ULTRAKILL.exe")]
[BepInPlugin("dev.flazhik.handpaint", "HandPaint", "1.0.4")]
public class HandPaint : BaseUnityPlugin
{
private Harmony _harmony;
private void Awake()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
MonoSingleton<AssetsManager>.Instance.LoadAssets();
MonoSingleton<AssetsManager>.Instance.RegisterPrefabs();
_harmony = new Harmony("dev.flazhik.handpaint");
_harmony.PatchAll();
}
}
internal static class PluginInfo
{
public const string GUID = "dev.flazhik.handpaint";
public const string NAME = "HandPaint";
public const string VERSION = "1.0.4";
}
[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[DebuggerNonUserCode]
[CompilerGenerated]
internal class Resources
{
private static ResourceManager resourceMan;
private static CultureInfo resourceCulture;
[EditorBrowsable(EditorBrowsableState.Advanced)]
internal static ResourceManager ResourceManager
{
get
{
if (resourceMan == null)
{
resourceMan = new ResourceManager("HandPaint.Resources", typeof(Resources).Assembly);
}
return resourceMan;
}
}
[EditorBrowsable(EditorBrowsableState.Advanced)]
internal static CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
internal static byte[] HandPaint => (byte[])ResourceManager.GetObject("HandPaint", resourceCulture);
internal Resources()
{
}
}
public class EasterEggConfig
{
public readonly FloatSliderField Frequency;
public readonly FloatSliderField[] Phases = (FloatSliderField[])(object)new FloatSliderField[3];
public readonly ConfigPanel Panel;
private static readonly float[] PhasesDefaultValues = new float[3] { 0.41f, 0.6f, 0.79f };
public EasterEggConfig(PluginConfigurator config)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Expected O, but got Unknown
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Expected O, but got Unknown
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Expected O, but got Unknown
Panel = new ConfigPanel(config.rootPanel, "SKITTLES POX", "handpaint.easter");
Frequency = new FloatSliderField(Panel, "Hue shift frequency (cycles per minute)", "handpaint.easter.frequency", new Tuple<float, float>(0f, 120f), 30f, 0);
for (int i = 0; i < Phases.Length; i++)
{
Phases[i] = new FloatSliderField(Panel, $"Phase of color {i + 1}", $"handpaint.easter.frequency.color-{i + 1}-phase", new Tuple<float, float>(0f, 1f), PhasesDefaultValues[i], 2);
}
((ConfigField)Panel).hidden = true;
}
}
}
namespace HandPaint.Scripts
{
public class ColorAlphaField : CustomConfigValueField
{
[PrefabAsset("assets/ui/coloralphafield.prefab")]
private static GameObject fieldPrefab;
private readonly Color _defaultValue;
private ConfigColorAlphaField _currentUi;
private Color _value;
private string _lastRed = "0";
private string _lastGreen = "0";
private string _lastBlue = "0";
private string _lastAlpha = "0";
[CompilerGenerated]
private ColorValueChangeEventDelegate m_onValueChange;
[CompilerGenerated]
private PostColorValueChangeEvent m_postValueChangeEvent;
public Color Value
{
get
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
return _value;
}
private set
{
//IL_0016: 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_001d: 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)
if ((Object)(object)_currentUi != (Object)null)
{
SetSliders(value);
}
_value = value;
((CustomConfigValueField)this).fieldValue = StringifyColor(value);
}
}
public event ColorValueChangeEventDelegate onValueChange
{
[CompilerGenerated]
add
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Expected O, but got Unknown
ColorValueChangeEventDelegate val = this.m_onValueChange;
ColorValueChangeEventDelegate val2;
do
{
val2 = val;
ColorValueChangeEventDelegate value2 = (ColorValueChangeEventDelegate)Delegate.Combine((Delegate?)(object)val2, (Delegate?)(object)value);
val = Interlocked.CompareExchange(ref this.m_onValueChange, value2, val2);
}
while (val != val2);
}
[CompilerGenerated]
remove
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Expected O, but got Unknown
ColorValueChangeEventDelegate val = this.m_onValueChange;
ColorValueChangeEventDelegate val2;
do
{
val2 = val;
ColorValueChangeEventDelegate value2 = (ColorValueChangeEventDelegate)Delegate.Remove((Delegate?)(object)val2, (Delegate?)(object)value);
val = Interlocked.CompareExchange(ref this.m_onValueChange, value2, val2);
}
while (val != val2);
}
}
public event PostColorValueChangeEvent postValueChangeEvent
{
[CompilerGenerated]
add
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Expected O, but got Unknown
PostColorValueChangeEvent val = this.m_postValueChangeEvent;
PostColorValueChangeEvent val2;
do
{
val2 = val;
PostColorValueChangeEvent value2 = (PostColorValueChangeEvent)Delegate.Combine((Delegate?)(object)val2, (Delegate?)(object)value);
val = Interlocked.CompareExchange(ref this.m_postValueChangeEvent, value2, val2);
}
while (val != val2);
}
[CompilerGenerated]
remove
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Expected O, but got Unknown
PostColorValueChangeEvent val = this.m_postValueChangeEvent;
PostColorValueChangeEvent val2;
do
{
val2 = val;
PostColorValueChangeEvent value2 = (PostColorValueChangeEvent)Delegate.Remove((Delegate?)(object)val2, (Delegate?)(object)value);
val = Interlocked.CompareExchange(ref this.m_postValueChangeEvent, value2, val2);
}
while (val != val2);
}
}
public void TriggerValueChangeEvent()
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_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_001b: Expected O, but got Unknown
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
if (this.onValueChange != null)
{
ColorValueChangeEvent val = new ColorValueChangeEvent
{
value = _value
};
this.onValueChange.Invoke(val);
if (!val.canceled && val.value != _value)
{
Value = val.value;
}
}
}
public override void OnDisplayNameChange(string newName)
{
if ((Object)(object)_currentUi != (Object)null)
{
((TMP_Text)_currentUi.nameText).text = ((ConfigField)this).displayName;
}
}
private void SetSliders(Color c)
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: 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)
//IL_005c: 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_009c: 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_00f0: 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_011b: 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_0127: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)_currentUi == (Object)null))
{
_currentUi.red.SetValueWithoutNotify(c.r);
_currentUi.green.SetValueWithoutNotify(c.g);
_currentUi.blue.SetValueWithoutNotify(c.b);
_currentUi.alpha.SetValueWithoutNotify(c.a);
_currentUi.redInput.SetTextWithoutNotify(((int)((double)c.r * 255.0)).ToString());
_currentUi.greenInput.SetTextWithoutNotify(((int)((double)c.g * 255.0)).ToString());
_currentUi.blueInput.SetTextWithoutNotify(((int)((double)c.b * 255.0)).ToString());
_currentUi.alphaInput.SetTextWithoutNotify(((int)((double)c.a * 255.0)).ToString());
_currentUi.SetColor(c.r, c.g, c.b, c.a);
}
}
internal Color GetColorFromSliders()
{
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
return new Color(_currentUi.red.normalizedValue, _currentUi.green.normalizedValue, _currentUi.blue.normalizedValue, _currentUi.alpha.normalizedValue);
}
protected override GameObject CreateUI(Transform content)
{
//IL_0254: Unknown result type (might be due to invalid IL or missing references)
//IL_0269: Unknown result type (might be due to invalid IL or missing references)
//IL_0273: Expected O, but got Unknown
//IL_028a: Unknown result type (might be due to invalid IL or missing references)
//IL_0294: Expected O, but got Unknown
GameObject val2 = Object.Instantiate<GameObject>(fieldPrefab, content);
_currentUi = val2.GetComponent<ConfigColorAlphaField>();
((TMP_Text)_currentUi.nameText).text = ((ConfigField)this).displayName;
((Selectable)_currentUi.red).interactable = ((ConfigField)this).interactable;
((Component)_currentUi.red).gameObject.AddComponent<ColorFieldSliderComponent>().callback = this;
((Selectable)_currentUi.green).interactable = ((ConfigField)this).interactable;
((Component)_currentUi.green).gameObject.AddComponent<ColorFieldSliderComponent>().callback = this;
((Selectable)_currentUi.blue).interactable = ((ConfigField)this).interactable;
((Component)_currentUi.blue).gameObject.AddComponent<ColorFieldSliderComponent>().callback = this;
((Selectable)_currentUi.alpha).interactable = ((ConfigField)this).interactable;
((Component)_currentUi.alpha).gameObject.AddComponent<ColorFieldSliderComponent>().callback = this;
((Selectable)_currentUi.redInput).interactable = ((ConfigField)this).interactable;
((UnityEvent<string>)(object)_currentUi.redInput.onValueChanged).AddListener((UnityAction<string>)delegate(string val)
{
if (!_currentUi.redInput.wasCanceled)
{
_lastRed = val;
}
});
((UnityEvent<string>)(object)_currentUi.redInput.onEndEdit).AddListener((UnityAction<string>)delegate
{
OnInputFieldChange(_currentUi.redInput, _currentUi.red, ref _lastRed);
});
((Selectable)_currentUi.greenInput).interactable = ((ConfigField)this).interactable;
((UnityEvent<string>)(object)_currentUi.greenInput.onValueChanged).AddListener((UnityAction<string>)delegate(string val)
{
if (!_currentUi.greenInput.wasCanceled)
{
_lastGreen = val;
}
});
((UnityEvent<string>)(object)_currentUi.greenInput.onEndEdit).AddListener((UnityAction<string>)delegate
{
OnInputFieldChange(_currentUi.greenInput, _currentUi.green, ref _lastGreen);
});
((Selectable)_currentUi.blueInput).interactable = ((ConfigField)this).interactable;
((UnityEvent<string>)(object)_currentUi.blueInput.onValueChanged).AddListener((UnityAction<string>)delegate(string val)
{
if (!_currentUi.blueInput.wasCanceled)
{
_lastBlue = val;
}
});
((UnityEvent<string>)(object)_currentUi.blueInput.onEndEdit).AddListener((UnityAction<string>)delegate
{
OnInputFieldChange(_currentUi.blueInput, _currentUi.blue, ref _lastBlue);
});
((Selectable)_currentUi.alphaInput).interactable = ((ConfigField)this).interactable;
((UnityEvent<string>)(object)_currentUi.alphaInput.onValueChanged).AddListener((UnityAction<string>)delegate(string val)
{
if (!_currentUi.alphaInput.wasCanceled)
{
_lastAlpha = val;
}
});
((UnityEvent<string>)(object)_currentUi.alphaInput.onEndEdit).AddListener((UnityAction<string>)delegate
{
OnInputFieldChange(_currentUi.alphaInput, _currentUi.alpha, ref _lastAlpha);
});
SetSliders(_value);
_currentUi.resetButton.onClick = new ButtonClickedEvent();
((UnityEvent)_currentUi.resetButton.onClick).AddListener(new UnityAction(OnReset));
((Component)_currentUi.resetButton).gameObject.SetActive(false);
ScrollRect componentInParent = ((Component)content).gameObject.GetComponentInParent<ScrollRect>();
Utils.SetupResetButton(val2, componentInParent, (UnityAction<BaseEventData>)delegate
{
if (((ConfigField)this).interactable)
{
((Component)_currentUi.resetButton).gameObject.SetActive(true);
}
}, (UnityAction<BaseEventData>)delegate
{
((Component)_currentUi.resetButton).gameObject.SetActive(false);
});
Utils.AddScrollEvents(((Component)_currentUi.redInput).gameObject.AddComponent<EventTrigger>(), componentInParent);
Utils.AddScrollEvents(((Component)_currentUi.greenInput).gameObject.AddComponent<EventTrigger>(), componentInParent);
Utils.AddScrollEvents(((Component)_currentUi.blueInput).gameObject.AddComponent<EventTrigger>(), componentInParent);
Utils.AddScrollEvents(((Component)_currentUi.alphaInput).gameObject.AddComponent<EventTrigger>(), componentInParent);
val2.SetActive(!((ConfigField)this).hidden);
SetInteractableColor(((ConfigField)this).interactable);
return val2;
}
internal void OnValueChange(Color newColor)
{
//IL_0000: 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)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: 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_0028: Expected O, but got Unknown
//IL_0010: 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_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
if (newColor == _value)
{
Value = _value;
return;
}
ColorValueChangeEvent val = new ColorValueChangeEvent
{
value = newColor
};
if (this.onValueChange != null)
{
try
{
this.onValueChange.Invoke(val);
}
catch (Exception arg)
{
Debug.LogError((object)$"Value change event for {((ConfigField)this).guid} threw an error: {arg}");
}
}
Value = (val.canceled ? _value : val.value);
if (this.postValueChangeEvent == null)
{
return;
}
try
{
this.postValueChangeEvent.Invoke(_value);
}
catch (Exception arg2)
{
Debug.LogError((object)$"Post value change event for {((ConfigField)this).guid} threw an error: {arg2}");
}
}
private void OnInputFieldChange(TMP_InputField field, Slider targetSlider, ref string lastValue)
{
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
if (field.wasCanceled)
{
return;
}
int num = (int)((double)targetSlider.normalizedValue * 255.0);
if (!int.TryParse(field.text, out var result))
{
field.SetTextWithoutNotify(num.ToString());
return;
}
int num2 = Mathf.Clamp(result, 0, 255);
field.SetTextWithoutNotify(num2.ToString());
if (num != num2)
{
targetSlider.SetNormalizedValueWithoutNotify((float)num2 / 255f);
OnValueChange(new Color(_currentUi.red.normalizedValue, _currentUi.green.normalizedValue, _currentUi.blue.normalizedValue, _currentUi.alpha.normalizedValue));
}
}
private void OnReset()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
SetSliders(_defaultValue);
OnValueChange(_defaultValue);
}
protected override void LoadDefaultValue()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
Value = _defaultValue;
}
protected sealed override void LoadFromString(string data)
{
//IL_00bf: 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_008c: Unknown result type (might be due to invalid IL or missing references)
string[] array = data.Split(new char[1] { ',' });
bool flag = array.Length == 4;
if (flag)
{
if (!float.TryParse(array[0], NumberStyles.Float, CultureInfo.InvariantCulture, out var result))
{
flag = false;
}
if (!float.TryParse(array[1], NumberStyles.Float, CultureInfo.InvariantCulture, out var result2))
{
flag = false;
}
if (!float.TryParse(array[2], NumberStyles.Float, CultureInfo.InvariantCulture, out var result3))
{
flag = false;
}
if (!float.TryParse(array[3], NumberStyles.Float, CultureInfo.InvariantCulture, out var result4))
{
flag = false;
}
if (flag)
{
_value = new Color(result, result2, result3, result4);
}
else
{
OnValueChange(new Color(_defaultValue.r, _defaultValue.g, _defaultValue.b, _defaultValue.a));
}
}
}
private static string StringifyColor(Color c)
{
return c.r.ToString(CultureInfo.InvariantCulture) + "," + c.g.ToString(CultureInfo.InvariantCulture) + "," + c.b.ToString(CultureInfo.InvariantCulture) + "," + c.a.ToString(CultureInfo.InvariantCulture);
}
private void SetInteractableColor(bool interactable)
{
//IL_0024: 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)
if (!((Object)(object)_currentUi == (Object)null))
{
((Graphic)_currentUi.nameText).color = (interactable ? Color.white : Color.gray);
}
}
public ColorAlphaField(ConfigPanel parentPanel, string displayName, string guid, Color defaultValue)
: base(parentPanel, guid, displayName)
{
//IL_0036: 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_0046: Unknown result type (might be due to invalid IL or missing references)
_defaultValue = defaultValue;
if (((CustomConfigValueField)this).fieldValue == null)
{
Value = defaultValue;
}
else
{
((CustomConfigValueField)this).LoadFromString(((CustomConfigValueField)this).fieldValue);
}
}
}
internal class ColorFieldSliderComponent : MonoBehaviour, IPointerUpHandler, IEventSystemHandler
{
public ColorAlphaField callback;
public void OnPointerUp(PointerEventData data)
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
callback?.OnValueChange(callback.GetColorFromSliders());
}
}
public class ConfigColorAlphaField : MonoBehaviour
{
[SerializeField]
public TextMeshProUGUI nameText;
public Image image;
public Image metallicPreview;
public Slider red;
public Slider green;
public Slider blue;
public Slider alpha;
public TMP_InputField redInput;
public TMP_InputField greenInput;
public TMP_InputField blueInput;
public TMP_InputField alphaInput;
public Button resetButton;
public void SliderSetR(float newR)
{
redInput.SetTextWithoutNotify(((int)((double)red.normalizedValue * 255.0)).ToString());
SetColor();
}
public void SliderSetG(float newG)
{
greenInput.SetTextWithoutNotify(((int)((double)green.normalizedValue * 255.0)).ToString());
SetColor();
}
public void SliderSetB(float newB)
{
blueInput.SetTextWithoutNotify(((int)((double)blue.normalizedValue * 255.0)).ToString());
SetColor();
}
public void SliderSetA(float newA)
{
alphaInput.SetTextWithoutNotify(((int)((double)alpha.normalizedValue * 255.0)).ToString());
SetColor();
}
public void SetColor()
{
SetColor(red.value, green.value, blue.value, alpha.value);
}
public void SetColor(float newR, float newG, float newB, float newA)
{
//IL_0009: 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_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
((Graphic)image).color = new Color(newR, newG, newB);
float num = (((double)Vector3.Dot(Vector3.one, new Vector3(newR, newG, newB)) / 3.0 < 0.9) ? 1f : 0.7f);
((Graphic)metallicPreview).color = new Color(num, num, num, newA);
}
}
[AttributeUsage(AttributeTargets.Field)]
public class PrefabAsset : Attribute
{
public string Path { get; }
public PrefabAsset(string path = "")
{
Path = path;
}
}
public static class SliderExtensions
{
public static void SetNormalizedValueWithoutNotify(this Slider slider, float normalized)
{
slider.SetValueWithoutNotify(slider.minValue + normalized * (slider.maxValue - slider.minValue));
}
}
}
namespace HandPaint.Patches
{
[HarmonyPatch(typeof(FishingRodWeapon))]
public class FishingRodWeaponPatch
{
[HarmonyPrefix]
[HarmonyPatch(typeof(FishingRodWeapon), "Awake")]
public static bool FishingRodWeapon_Awake_Prefix(FishingRodWeapon __instance)
{
((Component)((Component)((Component)__instance).GetComponentInChildren<FishingRodAnimEvents>()).transform.Find("RightArm")).gameObject.AddComponent<ColoredFeedbackerR>();
return true;
}
}
[HarmonyPatch(typeof(RevolverAnimationReceiver))]
public class RevolverAnimationReceiverPatch
{
[HarmonyPrefix]
[HarmonyPatch(typeof(RevolverAnimationReceiver), "Start")]
public static bool RevolverAnimationReceiver_Start_Prefix(RevolverAnimationReceiver __instance)
{
((Component)((Component)__instance).transform.Find("RightArm")).gameObject.AddComponent<ColoredFeedbackerR>();
return true;
}
}
[HarmonyPatch(typeof(HookArm))]
public class HookArmPatch
{
[HarmonyPostfix]
[HarmonyPatch(typeof(HookArm), "Start")]
public static void HookArm_Start_Postfix(HookArm __instance)
{
((Component)__instance).gameObject.AddComponent<ColoredWhiplash>();
}
}
[HarmonyPatch(typeof(Punch))]
public class PunchPatch
{
[HarmonyPostfix]
[HarmonyPatch(typeof(Punch), "Awake")]
public static void Punch_Awake_Postfix(Punch __instance, SkinnedMeshRenderer ___smr)
{
if (((Object)__instance).name.StartsWith("Arm Red"))
{
((Component)__instance).gameObject.AddComponent<ColoredKnuckleblaster>().shell = __instance.shell;
}
else if (((Object)__instance).name.StartsWith("Arm Blue"))
{
((Component)__instance).gameObject.AddComponent<ColoredFeedbacker>();
}
else
{
Debug.LogWarning((object)"GameObject has a Punch component but it's neither blue nor red hand");
}
}
}
}
namespace HandPaint.Components
{
public abstract class AbstractColoredArm : MonoBehaviour
{
protected static readonly int IdTex = Shader.PropertyToID("_IDTex");
protected static readonly int Cube = Shader.PropertyToID("_Cube");
protected static readonly int[] ColorProperties = new int[3]
{
Shader.PropertyToID("_CustomColor1"),
Shader.PropertyToID("_CustomColor2"),
Shader.PropertyToID("_CustomColor3")
};
protected Shader CustomColorsShader;
protected MaterialPropertyBlock MaterialBlock;
private readonly ColorValueChangeEventDelegate[] _colorHandlers = (ColorValueChangeEventDelegate[])(object)new ColorValueChangeEventDelegate[3];
private bool _skittlesPoxActive;
private Color _skittlesPoxValue = new Color(1f, 0f, 0f, 1f);
private SkittlesPox _skittlesPox;
protected void Start()
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Expected O, but got Unknown
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Expected O, but got Unknown
_skittlesPox = MonoSingleton<SkittlesPox>.Instance;
MaterialBlock = new MaterialPropertyBlock();
CustomColorsShader = Addressables.LoadAssetAsync<Shader>((object)"Assets/Shaders/Special/ULTRAKILL-vertexlit-customcolors-emissive.shader").WaitForCompletion();
BindHandlers();
EnableRepaintingField().onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent v)
{
if (v.value)
{
Repaint();
}
else
{
RestoreVanillaMaterials();
}
};
}
private void FixedUpdate()
{
//IL_008a: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
if (!_skittlesPox.activated)
{
if (_skittlesPoxActive)
{
_skittlesPoxActive = false;
BindHandlers();
}
return;
}
if (!_skittlesPoxActive)
{
UnbindHandlers();
_skittlesPoxActive = true;
return;
}
for (int i = 0; i < 3; i++)
{
float num = (_skittlesPox.hue + Time.fixedDeltaTime * HandPaintConfig.EasterEggConfig.Frequency.value / 60f + HandPaintConfig.EasterEggConfig.Phases[i].value) % 1f;
_skittlesPoxValue = Color.HSVToRGB(num, 1f, 1f);
MaterialBlock.SetColor(ColorProperties[i], _skittlesPoxValue);
SetPropertyBlock();
}
}
protected void BindHandlers()
{
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
ColorAlphaField[] array = ColorFields();
for (int i = 0; i < 3; i++)
{
int num = i;
_colorHandlers[i] = (ColorValueChangeEventDelegate)delegate(ColorValueChangeEvent v)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
MaterialBlock.SetColor(ColorProperties[num], v.value);
SetPropertyBlock();
};
array[i].onValueChange += _colorHandlers[i];
array[i].TriggerValueChangeEvent();
}
}
protected void UnbindHandlers()
{
ColorAlphaField[] array = ColorFields();
for (int i = 0; i < array.Length; i++)
{
array[i].onValueChange -= _colorHandlers[i];
}
}
protected abstract void RestoreVanillaMaterials();
protected abstract void Repaint();
protected abstract BoolField EnableRepaintingField();
protected abstract ColorAlphaField[] ColorFields();
protected abstract void SetPropertyBlock();
protected virtual void OnDestroy()
{
UnbindHandlers();
}
}
public class ColoredFeedbacker : AbstractColoredArm
{
[PrefabAsset("assets/textures/feedbacker_mask.png")]
private static Texture _mask;
[PrefabAsset("assets/textures/cube.png")]
private static Texture _cube;
private Material _coloredMaterial;
private Material _originalMaterial;
private SkinnedMeshRenderer _armRenderer;
private new void Start()
{
_armRenderer = ((Component)((Component)this).transform.GetChild(0).GetChild(1)).GetComponent<SkinnedMeshRenderer>();
base.Start();
_originalMaterial = Object.Instantiate<Material>(((Renderer)_armRenderer).material);
_coloredMaterial = ((Renderer)_armRenderer).material;
_coloredMaterial.shader = CustomColorsShader;
MaterialBlock.SetTexture(AbstractColoredArm.IdTex, _mask);
MaterialBlock.SetTexture(AbstractColoredArm.Cube, _cube);
SetPropertyBlock();
HandPaintConfig.RepaintFeedbacker.TriggerValueChangeEvent();
}
protected override void RestoreVanillaMaterials()
{
if (!((Object)(object)_armRenderer == (Object)null))
{
((Renderer)_armRenderer).material = _originalMaterial;
}
}
protected override void Repaint()
{
if (!((Object)(object)_armRenderer == (Object)null))
{
((Renderer)_armRenderer).material = _coloredMaterial;
}
}
protected override void SetPropertyBlock()
{
((Renderer)_armRenderer).SetPropertyBlock(MaterialBlock);
}
protected override BoolField EnableRepaintingField()
{
return HandPaintConfig.RepaintFeedbacker;
}
protected override ColorAlphaField[] ColorFields()
{
return HandPaintConfig.FeedbackerColors;
}
}
public class ColoredFeedbackerR : AbstractColoredArm
{
[PrefabAsset("assets/textures/feedbacker_mask.png")]
private static Texture _mask;
[PrefabAsset("assets/textures/cube.png")]
private static Texture _cube;
private Material _coloredMaterial;
private Material _originalMaterial;
private SkinnedMeshRenderer _armRenderer;
private ColorAlphaField[] _colorFields;
private new void Start()
{
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Expected O, but got Unknown
_armRenderer = ((Component)((Component)this).transform).GetComponent<SkinnedMeshRenderer>();
_colorFields = HandPaintConfig.FeedbackerColors;
base.Start();
_originalMaterial = Object.Instantiate<Material>(((Renderer)_armRenderer).material);
_coloredMaterial = ((Renderer)_armRenderer).material;
_coloredMaterial.shader = CustomColorsShader;
MaterialBlock.SetTexture(AbstractColoredArm.IdTex, _mask);
MaterialBlock.SetTexture(AbstractColoredArm.Cube, _cube);
SetPropertyBlock();
HandPaintConfig.PaintFeedbackerSeparately.onValueChange += new BoolValueChangeEventDelegate(OnSeparatePaint);
HandPaintConfig.PaintFeedbackerSeparately.TriggerValueChangeEvent();
HandPaintConfig.RepaintFeedbacker.TriggerValueChangeEvent();
}
public void OnSeparatePaint(BoolValueChangeEvent v)
{
UnbindHandlers();
_colorFields = (v.value ? HandPaintConfig.RightFeedbackerColors : HandPaintConfig.FeedbackerColors);
BindHandlers();
}
protected override void RestoreVanillaMaterials()
{
if (!((Object)(object)_armRenderer == (Object)null))
{
((Renderer)_armRenderer).material = _originalMaterial;
}
}
protected override void Repaint()
{
if (!((Object)(object)_armRenderer == (Object)null))
{
((Renderer)_armRenderer).material = _coloredMaterial;
}
}
protected override void SetPropertyBlock()
{
((Renderer)_armRenderer).SetPropertyBlock(MaterialBlock);
}
protected override BoolField EnableRepaintingField()
{
return HandPaintConfig.RepaintFeedbacker;
}
protected override ColorAlphaField[] ColorFields()
{
return _colorFields;
}
protected override void OnDestroy()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
base.OnDestroy();
HandPaintConfig.PaintFeedbackerSeparately.onValueChange -= new BoolValueChangeEventDelegate(OnSeparatePaint);
}
}
public class ColoredKnuckleblaster : AbstractColoredArm
{
[PrefabAsset("assets/textures/knuckleblaster_mask.png")]
private static Texture _mask;
[PrefabAsset("assets/textures/shell_mask.png")]
private static Texture _shellMask;
[PrefabAsset("assets/textures/cube.png")]
private static Texture _cube;
public GameObject shell;
private Material _coloredArmMaterial;
private Material _coloredShellMaterial;
private Material _originalArmMaterial;
private Material _originalShellMaterial;
private SkinnedMeshRenderer _armRenderer;
private MeshRenderer _shellRenderer;
private new void Start()
{
//IL_0121: Unknown result type (might be due to invalid IL or missing references)
//IL_012b: Expected O, but got Unknown
_armRenderer = ((Component)((Component)this).transform.GetChild(0)).GetComponent<SkinnedMeshRenderer>();
_shellRenderer = ((Component)shell.transform.GetChild(0)).GetComponent<MeshRenderer>();
base.Start();
_originalArmMaterial = Object.Instantiate<Material>(((Renderer)_armRenderer).material);
_originalShellMaterial = Object.Instantiate<Material>(((Renderer)_shellRenderer).material);
_coloredArmMaterial = ((Renderer)_armRenderer).material;
_coloredArmMaterial.shader = CustomColorsShader;
_coloredShellMaterial = ((Renderer)_shellRenderer).material;
_coloredShellMaterial.shader = CustomColorsShader;
((Renderer)_armRenderer).material = _coloredArmMaterial;
((Renderer)_shellRenderer).material = _coloredShellMaterial;
MaterialBlock.SetTexture(AbstractColoredArm.IdTex, _mask);
MaterialBlock.SetTexture(AbstractColoredArm.Cube, _cube);
((Renderer)_shellRenderer).material.SetTexture(AbstractColoredArm.IdTex, _shellMask);
SetPropertyBlock();
HandPaintConfig.KnuckleblasterShellColorField.onValueChange += new ColorValueChangeEventDelegate(OnShellColor);
HandPaintConfig.KnuckleblasterShellColorField.TriggerValueChangeEvent();
HandPaintConfig.RepaintKnuckleblaster.TriggerValueChangeEvent();
}
protected override void RestoreVanillaMaterials()
{
if (!((Object)(object)_armRenderer == (Object)null) && !((Object)(object)_shellRenderer == (Object)null))
{
((Renderer)_armRenderer).material = _originalArmMaterial;
((Renderer)_shellRenderer).material = _originalShellMaterial;
}
}
protected override void Repaint()
{
if (!((Object)(object)_armRenderer == (Object)null) && !((Object)(object)_shellRenderer == (Object)null))
{
((Renderer)_armRenderer).material = _coloredArmMaterial;
((Renderer)_shellRenderer).material = _coloredShellMaterial;
}
}
public void OnShellColor(ColorValueChangeEvent e)
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
((Renderer)_shellRenderer).material.SetColor(AbstractColoredArm.ColorProperties[0], e.value);
}
protected override void SetPropertyBlock()
{
((Renderer)_armRenderer).SetPropertyBlock(MaterialBlock);
}
protected override BoolField EnableRepaintingField()
{
return HandPaintConfig.RepaintKnuckleblaster;
}
protected override ColorAlphaField[] ColorFields()
{
return HandPaintConfig.KnuckleblasterColors;
}
protected override void OnDestroy()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
base.OnDestroy();
HandPaintConfig.KnuckleblasterShellColorField.onValueChange -= new ColorValueChangeEventDelegate(OnShellColor);
}
}
public class ColoredWhiplash : AbstractColoredArm
{
[PrefabAsset("assets/textures/whiplash_mask.png")]
private static Texture _mask;
[PrefabAsset("assets/textures/cube.png")]
private static Texture _cube;
private Material _coloredMaterial;
private Material _originalMaterial;
private Color _originalRopeColor;
private SkinnedMeshRenderer _armRenderer;
private SkinnedMeshRenderer _hookRenderer;
private LineRenderer _ropeRenderer;
private new void Start()
{
//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_0074: 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_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: Expected O, but got Unknown
_armRenderer = ((Component)((Component)this).transform.GetChild(0).GetChild(0)).GetComponent<SkinnedMeshRenderer>();
_hookRenderer = ((Component)((Component)this).transform.GetChild(0).GetChild(2)).GetComponent<SkinnedMeshRenderer>();
_ropeRenderer = ((Component)((Component)this).transform).GetComponent<LineRenderer>();
base.Start();
Color startColor = _ropeRenderer.startColor;
_originalMaterial = Object.Instantiate<Material>(((Renderer)_armRenderer).material);
_originalRopeColor = new Color(startColor.r, startColor.g, startColor.b);
_coloredMaterial = ((Renderer)_armRenderer).material;
_coloredMaterial.shader = CustomColorsShader;
((Renderer)_hookRenderer).material = _coloredMaterial;
MaterialBlock.SetTexture(AbstractColoredArm.IdTex, _mask);
MaterialBlock.SetTexture(AbstractColoredArm.Cube, _cube);
SetPropertyBlock();
HandPaintConfig.WhiplashRopeColorField.onValueChange += new ColorValueChangeEventDelegate(OnRopeColor);
HandPaintConfig.WhiplashRopeColorField.TriggerValueChangeEvent();
HandPaintConfig.RepaintWhiplash.TriggerValueChangeEvent();
}
protected override void RestoreVanillaMaterials()
{
//IL_0046: 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)
if (!((Object)(object)_armRenderer == (Object)null) && !((Object)(object)_hookRenderer == (Object)null))
{
((Renderer)_armRenderer).material = _originalMaterial;
((Renderer)_hookRenderer).material = _originalMaterial;
_ropeRenderer.startColor = _originalRopeColor;
_ropeRenderer.endColor = _originalRopeColor;
}
}
protected override void Repaint()
{
//IL_004a: 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)
if (!((Object)(object)_armRenderer == (Object)null) && !((Object)(object)_hookRenderer == (Object)null))
{
((Renderer)_armRenderer).material = _coloredMaterial;
((Renderer)_hookRenderer).material = _coloredMaterial;
_ropeRenderer.startColor = HandPaintConfig.WhiplashRopeColorField.Value;
_ropeRenderer.endColor = HandPaintConfig.WhiplashRopeColorField.Value;
}
}
public void OnRopeColor(ColorValueChangeEvent e)
{
//IL_0007: 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)
_ropeRenderer.startColor = e.value;
_ropeRenderer.endColor = e.value;
}
protected override void SetPropertyBlock()
{
((Renderer)_armRenderer).SetPropertyBlock(MaterialBlock);
((Renderer)_hookRenderer).SetPropertyBlock(MaterialBlock);
}
protected override void OnDestroy()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
base.OnDestroy();
HandPaintConfig.WhiplashRopeColorField.onValueChange -= new ColorValueChangeEventDelegate(OnRopeColor);
}
protected override BoolField EnableRepaintingField()
{
return HandPaintConfig.RepaintWhiplash;
}
protected override ColorAlphaField[] ColorFields()
{
return HandPaintConfig.WhiplashColors;
}
}
[ConfigureSingleton(/*Could not decode attribute arguments.*/)]
public class SkittlesPox : MonoSingleton<SkittlesPox>
{
private static readonly List<string> Tantrums = new List<string>
{
"<color=red>YOU SHOULDN'T HAVE TASTED THE RAINBOW FROM AN UNRELIABLE DEALER</color>\nYou are now infected with <color=red>S</color><color=orange>K</color><color=yellow>I</color><color=green>T</color><color=#00ffff>T</color><color=blue>L</color><color=purple>E</color><color=red>S</color> POX", "<color=red>HA-HA, YOU WISH!</color>\nYOU CAN ONLY CURE <color=red>S</color><color=orange>K</color><color=yellow>I</color><color=green>T</color><color=#00ffff>T</color><color=blue>L</color><color=purple>E</color><color=red>S</color> POX BY RESTARTING!", "Maybe I didn't make myself clear.\nYou can only cure <color=red>S</color><color=orange>K</color><color=yellow>I</color><color=green>T</color><color=#00ffff>T</color><color=blue>L</color><color=purple>E</color><color=red>S</color> pox by restarting the scene.", "Hello? Nothing happens until you restart the scene!", "You know what? You're right, I shouldn't have used such a demanding tone with you. It's just...", "...it would be really cool if you just restarted the scene instead. How does that sound?", "...okay, let's take another approach.\n¡Solo puedes curar la viruela de Skittles reiniciando la escena!", "¿No hablas español? All right, let's see...", "Вылечить скитлстрянку можно только перезагрузив сцену!", "Skittles poxu se můžeš zbavit pouze restartováním scény!",
"Okay, you're either really dumb or really curious", "And I'm, like, 95% positive you're just dumb", "Maybe 85%, but the point stands", "All I know you're 100% getting on my nerves!", "Look, I'm not even telling you to accept the consequences of your actions. I've literally just told you how to fix this! RESTART THE SCENE!", "<color=red>TYPE IT IN ONE MORE TIME, I DARE YOU! THEN WE WILL SEE HOW MUCH BLOOD THIS LITTLE BLUE BODY OF YOURS CAN FIT!</color>", "..."
};
private const string Skittles = "<color=red>S</color><color=orange>K</color><color=yellow>I</color><color=green>T</color><color=#00ffff>T</color><color=blue>L</color><color=purple>E</color><color=red>S</color>";
private List<KeyControl> _easterSequence;
public bool activated;
public float hue;
private int _sequenceIndex;
private int _tantrumIndex;
protected IEnumerator Start()
{
SceneManager.sceneLoaded += delegate
{
activated = false;
HandPaintConfig.TriggerValueChangeEvent();
};
yield return ((MonoBehaviour)this).StartCoroutine(WaitForTheKeyboard());
_easterSequence = new List<KeyControl>
{
Keyboard.current.digit0Key,
Keyboard.current.digit4Key,
Keyboard.current.digit5Key,
Keyboard.current.digit1Key
};
}
private void Update()
{
if (Keyboard.current == null || !((ButtonControl)Keyboard.current.anyKey).wasPressedThisFrame)
{
return;
}
if (_easterSequence != null && ((ButtonControl)_easterSequence[_sequenceIndex]).wasPressedThisFrame)
{
_sequenceIndex++;
if (_sequenceIndex != _easterSequence.Count)
{
return;
}
_sequenceIndex = 0;
if (_tantrumIndex < Tantrums.Count)
{
if (_tantrumIndex == 0)
{
activated = true;
HandPaintConfig.TriggerValueChangeEvent();
}
DisplayMessage(Tantrums[_tantrumIndex]);
_tantrumIndex++;
}
else
{
activated = false;
HandPaintConfig.TriggerValueChangeEvent();
DisplayMessage("Fine, FINE! IT'S OFF! HAPPY NOW?!\nGET LOST!!!");
_tantrumIndex = 0;
}
}
else
{
_sequenceIndex = 0;
}
}
private void FixedUpdate()
{
if (activated)
{
hue = (hue + Time.fixedDeltaTime * HandPaintConfig.EasterEggConfig.Frequency.value / 60f) % 1f;
}
}
private static IEnumerator WaitForTheKeyboard()
{
yield return (object)new WaitUntil((Func<bool>)(() => Keyboard.current != null));
}
private static void DisplayMessage(string msg)
{
MonoSingleton<HudMessageReceiver>.Instance.SendHudMessage(msg, "", "", 0, false);
}
}
}