From 52498fb221d68bc8d3c806b1f9a2ede9c625cde6 Mon Sep 17 00:00:00 2001 From: Arion-Kun Date: Sun, 13 Sep 2020 12:35:29 +0200 Subject: [PATCH] Zinna Release --- Toggle Post Processing.sln | 4 +- TogglePostProcessing/Custom/RubyButtonAPI.cs | 612 ++++++++++++++++++ .../Properties/AssemblyInfo.cs | 24 + .../Toggle Post Processing.cs | 69 +- .../Toggle Post Processing.csproj | 14 +- 5 files changed, 712 insertions(+), 11 deletions(-) create mode 100644 TogglePostProcessing/Custom/RubyButtonAPI.cs create mode 100644 TogglePostProcessing/Properties/AssemblyInfo.cs diff --git a/Toggle Post Processing.sln b/Toggle Post Processing.sln index e3c8261..7e0c584 100644 --- a/Toggle Post Processing.sln +++ b/Toggle Post Processing.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.30503.244 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Toggle Post Processing", "Toggle Post Processing\Toggle Post Processing.csproj", "{D3359F93-F373-4E70-9788-2E6B95F667ED}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Toggle Post Processing", "TogglePostProcessing\Toggle Post Processing.csproj", "{D3359F93-F373-4E70-9788-2E6B95F667ED}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -20,6 +20,6 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {D093CFA4-4056-465E-B1C1-38E8595ACBBB} + SolutionGuid = {AA192B54-B293-47BA-A867-3A5EEA63B743} EndGlobalSection EndGlobal diff --git a/TogglePostProcessing/Custom/RubyButtonAPI.cs b/TogglePostProcessing/Custom/RubyButtonAPI.cs new file mode 100644 index 0000000..241501a --- /dev/null +++ b/TogglePostProcessing/Custom/RubyButtonAPI.cs @@ -0,0 +1,612 @@ +using System; +using Il2CppSystem.Reflection; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using UnityEngine.UI; +using UnityEngine.Events; +using UnhollowerRuntimeLib; +using Button = UnityEngine.UI.Button; + +namespace RubyButtonAPI +{ + //Firstly, thanks to Emilia for helping me update this to the unhollower. + //This adds a couple of new functions compared to the old one, however, + //like the last one, I will not be providing any support as I will + //personally not be using melonloader/unhollower in the near future. + + //Look here for a useful example guide: + //https://github.com/DubyaDude/RubyButtonAPI/blob/master/RubyButtonAPI_Old.cs + + public static class QMButtonAPI + { + //REPLACE THIS STRING SO YOUR MENU DOESNT COLLIDE WITH OTHER MENUS + public static string identifier = "TPP"; + public static Color mBackground = Color.red; + public static Color mForeground = Color.white; + public static Color bBackground = Color.red; + public static Color bForeground = Color.yellow; + public static List allSingleButtons = new List(); + public static List allToggleButtons = new List(); + public static List allNestedButtons = new List(); + } + public static class Arion + { + //Added by Arion + public static void SetSizeButtonfor(GameObject Button, float xSize, float ySize) + { + Button.GetComponent().sizeDelta /= new Vector2(xSize, ySize); + } + } + + public class QMButtonBase + { + protected GameObject button; + protected string btnQMLoc; + protected string btnType; + protected string btnTag; + protected int[] initShift = { 0, 0 }; + protected Color OrigBackground; + protected Color OrigText; + + public GameObject getGameObject() + { + return button; + } + + public void setActive(bool isActive) + { + button.gameObject.SetActive(isActive); + } + + public void setIntractable(bool isIntractable) + { + if (isIntractable) + { + setBackgroundColor(OrigBackground, false); + setTextColor(OrigText, false); + } + else + { + setBackgroundColor(new Color(0.5f, 0.5f, 0.5f, 1), false); + setTextColor(new Color(0.7f, 0.7f, 0.7f, 1), false); ; + } + button.gameObject.GetComponent