Revert colorblock changes

This commit is contained in:
Sinai 2021-03-30 19:55:18 +11:00
parent 0555a644b7
commit 40f698122d
5 changed files with 9 additions and 32 deletions

View File

@ -121,23 +121,6 @@ namespace UnityExplorer.Core.Runtime.Il2Cpp
.Invoke(handle);
}
// ColorBlock set
public override void SetColorBlockColors(ref ColorBlock colorBlock, Color? normal, Color? highlighted, Color? pressed)
{
if (normal != null)
{
colorBlock.m_NormalColor = (Color)normal;
colorBlock.m_SelectedColor = (Color)normal;
}
if (highlighted != null)
colorBlock.m_HighlightedColor = (Color)highlighted;
if (pressed != null)
colorBlock.m_PressedColor = (Color)pressed;
}
// Custom check for il2cpp input pointer event
public override void CheckInputPointerEvent()

View File

@ -108,6 +108,7 @@ namespace UnityExplorer.Core.Runtime.Il2Cpp
Type ret = Type.GetType(name);
// Thanks to Slaynash for this deobfuscation snippet!
if (ret == null)
{
string baseName = cppType.FullName;

View File

@ -60,18 +60,6 @@ namespace UnityExplorer.Core.Runtime.Mono
return scene.rootCount;
}
public override void SetColorBlockColors(ref ColorBlock block, Color? normal, Color? highlighted, Color? pressed)
{
if (normal != null)
block.normalColor = (Color)normal;
if (highlighted != null)
block.highlightedColor = (Color)highlighted;
if (pressed != null)
block.pressedColor = (Color)pressed;
}
public override void CheckInputPointerEvent()
{
// Not necessary afaik

View File

@ -52,8 +52,6 @@ namespace UnityExplorer.Core.Runtime
public abstract int GetRootCount(Scene scene);
public abstract void SetColorBlockColors(ref ColorBlock block, Color? normal, Color? highlight, Color? pressed);
public abstract void CheckInputPointerEvent();
}
}

View File

@ -64,7 +64,14 @@ namespace UnityExplorer.UI
public static void SetColorBlockValues(ref this ColorBlock colorBlock, Color? normal = null, Color? highlighted = null,
Color? pressed = null)
{
RuntimeProvider.Instance.SetColorBlockColors(ref colorBlock, normal, highlighted, pressed);
if (normal != null)
colorBlock.normalColor = (Color)normal;
if (highlighted != null)
colorBlock.highlightedColor = (Color)highlighted;
if (pressed != null)
colorBlock.pressedColor = (Color)pressed;
}
/// <summary>