├── Source ├── Images │ ├── Geo.png │ ├── Flower.png │ ├── HelpBG.png │ ├── SlyKey.png │ ├── AddEntry.png │ ├── BlueGlow.png │ ├── ButtonDel.png │ ├── ButtonInf.png │ ├── CityKey.png │ ├── ConsoleBg.png │ ├── DreamGate.png │ ├── EnemiesBg.png │ ├── Essence.png │ ├── Essence2.png │ ├── IsmasTear.png │ ├── Lantern.png │ ├── LoveKey.png │ ├── MapQuill.png │ ├── PaleOre.png │ ├── RancidEgg.png │ ├── SimpleKey.png │ ├── TramPass.png │ ├── ButtonPlus.png │ ├── ButtonRect.png │ ├── DreamNail1.png │ ├── DreamNail2.png │ ├── DropdownBG.png │ ├── ElegantKey.png │ ├── EnemiesPBg.png │ ├── Kingsbrand.png │ ├── MantisClaw.png │ ├── ShadeCloak.png │ ├── ButtonsMenuBG.png │ ├── CrystalHeart.png │ ├── MonarchWings.png │ ├── MothwingCloak.png │ ├── StatusPanelBG.png │ ├── scrollbar_mid.png │ ├── ButtonRectEmpty.png │ ├── ScrollBarArrowUp.png │ ├── Scrollbar_point.png │ ├── DreamGateDropdownBG.png │ ├── NailArt_DashSlash.png │ ├── NailArt_GreatSlash.png │ ├── ScrollBarArrowDown.png │ └── NailArt_CycloneSlash.png ├── Pair.cs ├── BindableMethod.cs ├── PlayerDeathWatcher.cs ├── Settings.cs ├── EnemyData.cs ├── Properties │ ├── Resources.Designer.cs │ └── Resources.resx ├── CanvasText.cs ├── CanvasImage.cs ├── Console.cs ├── KeyBindPanel.cs ├── CanvasButton.cs ├── DebugMod.csproj ├── CanvasPanel.cs ├── BossHandler.cs ├── DreamGate.cs ├── DebugMod.cs ├── GUIController.cs ├── InfoPanel.cs ├── EnemiesPanel.cs └── TopMenu.cs ├── DebugMod.sln ├── README.md └── .gitignore /Source/Images/Geo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/Geo.png -------------------------------------------------------------------------------- /Source/Images/Flower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/Flower.png -------------------------------------------------------------------------------- /Source/Images/HelpBG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/HelpBG.png -------------------------------------------------------------------------------- /Source/Images/SlyKey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/SlyKey.png -------------------------------------------------------------------------------- /Source/Images/AddEntry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/AddEntry.png -------------------------------------------------------------------------------- /Source/Images/BlueGlow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/BlueGlow.png -------------------------------------------------------------------------------- /Source/Images/ButtonDel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/ButtonDel.png -------------------------------------------------------------------------------- /Source/Images/ButtonInf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/ButtonInf.png -------------------------------------------------------------------------------- /Source/Images/CityKey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/CityKey.png -------------------------------------------------------------------------------- /Source/Images/ConsoleBg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/ConsoleBg.png -------------------------------------------------------------------------------- /Source/Images/DreamGate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/DreamGate.png -------------------------------------------------------------------------------- /Source/Images/EnemiesBg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/EnemiesBg.png -------------------------------------------------------------------------------- /Source/Images/Essence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/Essence.png -------------------------------------------------------------------------------- /Source/Images/Essence2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/Essence2.png -------------------------------------------------------------------------------- /Source/Images/IsmasTear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/IsmasTear.png -------------------------------------------------------------------------------- /Source/Images/Lantern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/Lantern.png -------------------------------------------------------------------------------- /Source/Images/LoveKey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/LoveKey.png -------------------------------------------------------------------------------- /Source/Images/MapQuill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/MapQuill.png -------------------------------------------------------------------------------- /Source/Images/PaleOre.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/PaleOre.png -------------------------------------------------------------------------------- /Source/Images/RancidEgg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/RancidEgg.png -------------------------------------------------------------------------------- /Source/Images/SimpleKey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/SimpleKey.png -------------------------------------------------------------------------------- /Source/Images/TramPass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/TramPass.png -------------------------------------------------------------------------------- /Source/Images/ButtonPlus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/ButtonPlus.png -------------------------------------------------------------------------------- /Source/Images/ButtonRect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/ButtonRect.png -------------------------------------------------------------------------------- /Source/Images/DreamNail1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/DreamNail1.png -------------------------------------------------------------------------------- /Source/Images/DreamNail2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/DreamNail2.png -------------------------------------------------------------------------------- /Source/Images/DropdownBG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/DropdownBG.png -------------------------------------------------------------------------------- /Source/Images/ElegantKey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/ElegantKey.png -------------------------------------------------------------------------------- /Source/Images/EnemiesPBg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/EnemiesPBg.png -------------------------------------------------------------------------------- /Source/Images/Kingsbrand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/Kingsbrand.png -------------------------------------------------------------------------------- /Source/Images/MantisClaw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/MantisClaw.png -------------------------------------------------------------------------------- /Source/Images/ShadeCloak.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/ShadeCloak.png -------------------------------------------------------------------------------- /Source/Images/ButtonsMenuBG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/ButtonsMenuBG.png -------------------------------------------------------------------------------- /Source/Images/CrystalHeart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/CrystalHeart.png -------------------------------------------------------------------------------- /Source/Images/MonarchWings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/MonarchWings.png -------------------------------------------------------------------------------- /Source/Images/MothwingCloak.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/MothwingCloak.png -------------------------------------------------------------------------------- /Source/Images/StatusPanelBG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/StatusPanelBG.png -------------------------------------------------------------------------------- /Source/Images/scrollbar_mid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/scrollbar_mid.png -------------------------------------------------------------------------------- /Source/Images/ButtonRectEmpty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/ButtonRectEmpty.png -------------------------------------------------------------------------------- /Source/Images/ScrollBarArrowUp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/ScrollBarArrowUp.png -------------------------------------------------------------------------------- /Source/Images/Scrollbar_point.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/Scrollbar_point.png -------------------------------------------------------------------------------- /Source/Images/DreamGateDropdownBG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/DreamGateDropdownBG.png -------------------------------------------------------------------------------- /Source/Images/NailArt_DashSlash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/NailArt_DashSlash.png -------------------------------------------------------------------------------- /Source/Images/NailArt_GreatSlash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/NailArt_GreatSlash.png -------------------------------------------------------------------------------- /Source/Images/ScrollBarArrowDown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/ScrollBarArrowDown.png -------------------------------------------------------------------------------- /Source/Images/NailArt_CycloneSlash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seresharp/DebugMod/HEAD/Source/Images/NailArt_CycloneSlash.png -------------------------------------------------------------------------------- /Source/Pair.cs: -------------------------------------------------------------------------------- 1 | namespace DebugMod 2 | { 3 | public class Pair 4 | { 5 | public object First; 6 | public object Second; 7 | 8 | public Pair(object x, object y) 9 | { 10 | First = x; 11 | Second = y; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Source/BindableMethod.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DebugMod 4 | { 5 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] 6 | public class BindableMethod : Attribute 7 | { 8 | public string name; 9 | public string category; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DebugMod.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 12.00 2 | # Visual Studio Express 2013 for Windows Desktop 3 | VisualStudioVersion = 12.0.21005.1 4 | MinimumVisualStudioVersion = 10.0.40219.1 5 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DebugMod", "Source\DebugMod.csproj", "{E3E4D0B7-656C-6C50-7567-696E2E57696E}" 6 | EndProject 7 | Global 8 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 9 | Debug|Any CPU = Debug|Any CPU 10 | Release|Any CPU = Release|Any CPU 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {E3E4D0B7-656C-6C50-7567-696E2E57696E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 14 | {E3E4D0B7-656C-6C50-7567-696E2E57696E}.Debug|Any CPU.Build.0 = Debug|Any CPU 15 | {E3E4D0B7-656C-6C50-7567-696E2E57696E}.Release|Any CPU.ActiveCfg = Release|Any CPU 16 | {E3E4D0B7-656C-6C50-7567-696E2E57696E}.Release|Any CPU.Build.0 = Release|Any CPU 17 | EndGlobalSection 18 | GlobalSection(SolutionProperties) = preSolution 19 | HideSolutionNode = FALSE 20 | EndGlobalSection 21 | EndGlobal 22 | -------------------------------------------------------------------------------- /Source/PlayerDeathWatcher.cs: -------------------------------------------------------------------------------- 1 | namespace DebugMod 2 | { 3 | public static class PlayerDeathWatcher 4 | { 5 | private static bool playerDead; 6 | 7 | public static void Reset() 8 | { 9 | playerDead = false; 10 | } 11 | 12 | public static bool PlayerDied() 13 | { 14 | return (!playerDead && PlayerData.instance.health <= 0 && DebugMod.GM.IsGameplayScene()); 15 | } 16 | 17 | public static void LogDeathDetails() 18 | { 19 | playerDead = true; 20 | Console.AddLine(string.Concat(new string[] 21 | { 22 | "Hero death detected. Game playtime: ", 23 | PlayerData.instance.playTime.ToString(), 24 | " Shade Zone: ", 25 | PlayerData.instance.shadeMapZone.ToString(), 26 | " Shade Geo: ", 27 | PlayerData.instance.geoPool.ToString(), 28 | " Respawn scene: ", 29 | PlayerData.instance.respawnScene.ToString() 30 | })); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/Settings.cs: -------------------------------------------------------------------------------- 1 | using Modding; 2 | 3 | namespace DebugMod 4 | { 5 | //Empty class required for DebugMod class definition 6 | public class SaveSettings : IModSettings { } 7 | 8 | public class GlobalSettings : IModSettings 9 | { 10 | //Save members 11 | public SerializableIntDictionary binds = new SerializableIntDictionary(); 12 | 13 | public bool ConsoleVisible 14 | { 15 | get => GetBool(true); 16 | set => SetBool(value); 17 | } 18 | 19 | public bool EnemiesPanelVisible 20 | { 21 | get => GetBool(true); 22 | set => SetBool(value); 23 | } 24 | 25 | public bool HelpPanelVisible 26 | { 27 | get => GetBool(true); 28 | set => SetBool(value); 29 | } 30 | 31 | public bool InfoPanelVisible 32 | { 33 | get => GetBool(true); 34 | set => SetBool(value); 35 | } 36 | 37 | public bool TopMenuVisible 38 | { 39 | get => GetBool(true); 40 | set => SetBool(value); 41 | } 42 | 43 | public bool FirstRun 44 | { 45 | get => GetBool(true); 46 | set => SetBool(value); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Source/EnemyData.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace DebugMod 4 | { 5 | public struct EnemyData 6 | { 7 | public int HP; 8 | public int maxHP; 9 | // public PlayMakerFSM FSM; 10 | public HealthManager HM; 11 | public Component Spr; 12 | public CanvasPanel hpBar; 13 | public CanvasPanel hitbox; 14 | public GameObject gameObject; 15 | 16 | public EnemyData(int hp, HealthManager hm, Component spr, GameObject parent = null, GameObject go = null) 17 | { 18 | HP = hp; 19 | maxHP = hp; 20 | HM = hm; 21 | Spr = spr; 22 | gameObject = go; 23 | 24 | Texture2D tex = new Texture2D(120, 40); 25 | 26 | for (int x = 0; x < 120; x++) 27 | { 28 | for (int y = 0; y < 40; y++) 29 | { 30 | if (x < 3 || x > 116 || y < 3 || y > 36) 31 | { 32 | tex.SetPixel(x, y, Color.black); 33 | } 34 | else 35 | { 36 | tex.SetPixel(x, y, Color.red); 37 | } 38 | } 39 | } 40 | 41 | tex.Apply(); 42 | 43 | Texture2D tex2 = new Texture2D(1, 1); 44 | Color yellow = Color.yellow; 45 | yellow.a = .7f; 46 | tex2.SetPixel(1, 1, yellow); 47 | 48 | hpBar = new CanvasPanel(parent, tex, Vector2.zero, Vector2.zero, new Rect(0, 0, 120, 40)); 49 | hpBar.AddText("HP", "", Vector2.zero, new Vector2(120, 40), GUIController.Instance.arial, 20, FontStyle.Normal, TextAnchor.MiddleCenter); 50 | hpBar.FixRenderOrder(); 51 | 52 | hitbox = new CanvasPanel(parent, tex2, Vector2.zero, Vector2.zero, new Rect(0, 0, 1, 1)); 53 | 54 | hpBar.SetActive(false, true); 55 | hitbox.SetActive(false, true); 56 | } 57 | 58 | public void SetHP(int health) 59 | { 60 | HP = health; 61 | HM.hp = health; 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------------------------------------------- 2 | FEATURES 3 | ---------------------------------------------------------------------------------------- 4 | * A completely new toggleable UI in game that provides the following functions: 5 | * Cheats such as invincibility and noclip 6 | * The ability to unlock all charms or repair broken ones 7 | * Change which skills the player has 8 | * Change which items the player has 9 | * Give the player more of consumable resources such as geo and essence 10 | * Respawn bosses 11 | * Hold multiple dream gate positions 12 | * Change the player's respawn point to anywhere in the current scene 13 | * Recall to the set respawn point 14 | * Kill all enemies 15 | * Add HP bars to enemies 16 | * Draw collision boxes for enemies 17 | * Clone or delete any enemy 18 | * Set an enemy's health to 9999 19 | * Change the player's nail damage 20 | * Damage the player 21 | * Change the camera zoom level 22 | * Disable the in game HUD 23 | * Make the player invisible 24 | * Disable the lighting around the player 25 | * Disable the vignette drawn around the player 26 | * Change the time scale of the game 27 | ---------------------------------------------------------------------------------------- 28 | INSTALLATION (STEAM, WINDOWS) 29 | ---------------------------------------------------------------------------------------- 30 | 1) Download the modding API from here: https://drive.google.com/open?id=0B_b9PFqx_PR9X1ZrWGFxUGdydTg 31 | 2) Right click Hollow Knight in Steam -> Properties -> Local Files -> Browse Local Files 32 | 3) Create a backup of the game files located here 33 | 4) Copy the contents of the modding API zip into this folder (Overwrite files when asked) 34 | 5) Copy the contents of this zip into the folder (Overwrite files when asked) 35 | 6) This mod should not affect saves negatively, but it is a good idea to back them up anyway. 36 | Saves are located at %AppData%\..\LocalLow\Team Cherry\Hollow Knight\ 37 | ---------------------------------------------------------------------------------------- 38 | CREDITS 39 | ---------------------------------------------------------------------------------------- 40 | Coding - Seanpr 41 | UI design and graphics - The Embraced One 42 | Assistance with canvas - KDT 43 | -------------------------------------------------------------------------------- /Source/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace DebugMod.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DebugMod.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Source/CanvasText.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | 4 | namespace DebugMod 5 | { 6 | public class CanvasText 7 | { 8 | private GameObject textObj; 9 | private Vector2 size; 10 | 11 | public bool active; 12 | 13 | public CanvasText(GameObject parent, Vector2 pos, Vector2 sz, Font font, string text, int fontSize = 13, FontStyle style = FontStyle.Normal, TextAnchor alignment = TextAnchor.UpperLeft) 14 | { 15 | if (sz.x == 0 || sz.y == 0) 16 | { 17 | size = new Vector2(1920f, 1080f); 18 | } 19 | else 20 | { 21 | size = sz; 22 | } 23 | 24 | textObj = new GameObject(); 25 | textObj.AddComponent(); 26 | RectTransform textTransform = textObj.AddComponent(); 27 | textTransform.sizeDelta = size; 28 | 29 | CanvasGroup group = textObj.AddComponent(); 30 | group.interactable = false; 31 | group.blocksRaycasts = false; 32 | 33 | Text t = textObj.AddComponent(); 34 | t.text = text; 35 | t.font = font; 36 | t.fontSize = fontSize; 37 | t.fontStyle = style; 38 | t.alignment = alignment; 39 | 40 | textObj.transform.SetParent(parent.transform, false); 41 | 42 | Vector2 position = new Vector2((pos.x + size.x / 2f) / 1920f, (1080f - (pos.y + size.y / 2f)) / 1080f); 43 | textTransform.anchorMin = position; 44 | textTransform.anchorMax = position; 45 | 46 | Object.DontDestroyOnLoad(textObj); 47 | 48 | active = true; 49 | } 50 | 51 | public void SetPosition(Vector2 pos) 52 | { 53 | if (textObj != null) 54 | { 55 | RectTransform textTransform = textObj.GetComponent(); 56 | 57 | Vector2 position = new Vector2((pos.x + size.x / 2f) / 1920f, (1080f - (pos.y + size.y / 2f)) / 1080f); 58 | textTransform.anchorMin = position; 59 | textTransform.anchorMax = position; 60 | } 61 | } 62 | 63 | public Vector2 GetPosition() 64 | { 65 | if (textObj != null) 66 | { 67 | Vector2 anchor = textObj.GetComponent().anchorMin; 68 | 69 | return new Vector2(anchor.x * 1920f - size.x / 2f, 1080f - anchor.y * 1080f - size.y / 2f); 70 | } 71 | 72 | return Vector2.zero; 73 | } 74 | 75 | public void UpdateText(string text) 76 | { 77 | if (textObj != null) 78 | { 79 | textObj.GetComponent().text = text; 80 | } 81 | } 82 | 83 | public void SetActive(bool a) 84 | { 85 | active = a; 86 | 87 | if (textObj != null) 88 | { 89 | textObj.SetActive(active); 90 | } 91 | } 92 | 93 | public void MoveToTop() 94 | { 95 | if (textObj != null) 96 | { 97 | textObj.transform.SetAsLastSibling(); 98 | } 99 | } 100 | 101 | public void SetTextColor(Color color) 102 | { 103 | if (textObj != null) 104 | { 105 | Text t = textObj.GetComponent(); 106 | t.color = color; 107 | } 108 | } 109 | 110 | public void Destroy() 111 | { 112 | Object.Destroy(textObj); 113 | } 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /Source/CanvasImage.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | 4 | namespace DebugMod 5 | { 6 | public class CanvasImage 7 | { 8 | private GameObject imageObj; 9 | private Vector2 sz; 10 | private Rect sub; 11 | 12 | public bool active; 13 | 14 | public CanvasImage(GameObject parent, Texture2D tex, Vector2 pos, Vector2 size, Rect subSprite) 15 | { 16 | if (size.x == 0 || size.y == 0) 17 | { 18 | size = new Vector2(subSprite.width, subSprite.height); 19 | } 20 | 21 | sz = size; 22 | sub = subSprite; 23 | 24 | imageObj = new GameObject(); 25 | imageObj.AddComponent(); 26 | RectTransform imageTransform = imageObj.AddComponent(); 27 | imageTransform.sizeDelta = new Vector2(subSprite.width, subSprite.height); 28 | imageObj.AddComponent().sprite = Sprite.Create(tex, new Rect(subSprite.x, tex.height - subSprite.height, subSprite.width, subSprite.height), Vector2.zero); 29 | 30 | CanvasGroup group = imageObj.AddComponent(); 31 | group.interactable = false; 32 | group.blocksRaycasts = false; 33 | 34 | imageObj.transform.SetParent(parent.transform, false); 35 | 36 | Vector2 position = new Vector2((pos.x + ((size.x / subSprite.width) * subSprite.width) / 2f) / 1920f, (1080f - (pos.y + ((size.y / subSprite.height) * subSprite.height) / 2f)) / 1080f); 37 | imageTransform.anchorMin = position; 38 | imageTransform.anchorMax = position; 39 | imageTransform.SetScaleX(size.x / subSprite.width); 40 | imageTransform.SetScaleY(size.y / subSprite.height); 41 | 42 | Object.DontDestroyOnLoad(imageObj); 43 | 44 | active = true; 45 | } 46 | 47 | public void UpdateImage(Texture2D tex, Rect subSection) 48 | { 49 | if (imageObj != null) 50 | { 51 | imageObj.GetComponent().sprite = Sprite.Create(tex, new Rect(subSection.x, tex.height - subSection.height, subSection.width, subSection.height), Vector2.zero); 52 | } 53 | } 54 | 55 | public void SetWidth(float width) 56 | { 57 | if (imageObj != null) 58 | { 59 | sz = new Vector2(width, sz.y); 60 | imageObj.GetComponent().SetScaleX(width / imageObj.GetComponent().sizeDelta.x); 61 | } 62 | } 63 | 64 | public void SetHeight(float height) 65 | { 66 | if (imageObj != null) 67 | { 68 | sz = new Vector2(sz.x, height); 69 | imageObj.GetComponent().SetScaleY(height / imageObj.GetComponent().sizeDelta.y); 70 | } 71 | } 72 | 73 | public void SetPosition(Vector2 pos) 74 | { 75 | if (imageObj != null) 76 | { 77 | Vector2 position = new Vector2((pos.x + ((sz.x / sub.width) * sub.width) / 2f) / 1920f, (1080f - (pos.y + ((sz.y / sub.height) * sub.height) / 2f)) / 1080f); 78 | imageObj.GetComponent().anchorMin = position; 79 | imageObj.GetComponent().anchorMax = position; 80 | } 81 | } 82 | 83 | public void SetActive(bool b) 84 | { 85 | if (imageObj != null) 86 | { 87 | imageObj.SetActive(b); 88 | active = b; 89 | } 90 | } 91 | 92 | public void SetRenderIndex(int idx) 93 | { 94 | imageObj.transform.SetSiblingIndex(idx); 95 | } 96 | 97 | public void Destroy() 98 | { 99 | Object.Destroy(imageObj); ; 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /Source/Console.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using UnityEngine; 5 | 6 | namespace DebugMod 7 | { 8 | public static class Console 9 | { 10 | private static CanvasPanel panel; 11 | private static List history = new List(); 12 | private static Vector2 scrollPosition = Vector2.zero; 13 | 14 | public static void BuildMenu(GameObject canvas) 15 | { 16 | panel = new CanvasPanel(canvas, GUIController.Instance.images["ConsoleBg"], new Vector2(1275, 800), Vector2.zero, new Rect(0, 0, GUIController.Instance.images["ConsoleBg"].width, GUIController.Instance.images["ConsoleBg"].height)); 17 | panel.AddText("Console", "", new Vector2(10f, 25f), Vector2.zero, GUIController.Instance.arial); 18 | panel.FixRenderOrder(); 19 | 20 | GUIController.Instance.arial.RequestCharactersInTexture("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890`~!@#$%^&*()-_=+[{]}\\|;:'\",<.>/? ", 13); 21 | } 22 | 23 | public static void Update() 24 | { 25 | if (panel == null) 26 | { 27 | return; 28 | } 29 | 30 | if (DebugMod.GM.IsNonGameplayScene()) 31 | { 32 | if (panel.active) 33 | { 34 | panel.SetActive(false, true); 35 | } 36 | 37 | return; 38 | } 39 | 40 | if (DebugMod.settings.ConsoleVisible && !panel.active) 41 | { 42 | panel.SetActive(true, false); 43 | } 44 | else if (!DebugMod.settings.ConsoleVisible && panel.active) 45 | { 46 | panel.SetActive(false, true); 47 | } 48 | 49 | if (panel.active) 50 | { 51 | string consoleString = ""; 52 | int lineCount = 0; 53 | 54 | for (int i = history.Count - 1; i >= 0; i--) 55 | { 56 | if (lineCount >= 8) break; 57 | consoleString = history[i] + "\n" + consoleString; 58 | lineCount++; 59 | } 60 | 61 | panel.GetText("Console").UpdateText(consoleString); 62 | } 63 | } 64 | 65 | public static void Reset() 66 | { 67 | history.Clear(); 68 | scrollPosition = Vector2.zero; 69 | } 70 | 71 | public static void AddLine(string chatLine) 72 | { 73 | while (history.Count > 1000) 74 | { 75 | history.RemoveAt(0); 76 | } 77 | 78 | int wrap = WrapIndex(GUIController.Instance.arial, 13, chatLine); 79 | 80 | while (wrap != -1) 81 | { 82 | int index = chatLine.LastIndexOf(' ', wrap, wrap); 83 | 84 | if (index != -1) 85 | { 86 | history.Add(chatLine.Substring(0, index)); 87 | chatLine = chatLine.Substring(index + 1); 88 | wrap = WrapIndex(GUIController.Instance.arial, 13, chatLine); 89 | } 90 | else 91 | { 92 | break; 93 | } 94 | } 95 | 96 | history.Add(chatLine); 97 | 98 | scrollPosition.y = scrollPosition.y + 50f; 99 | } 100 | 101 | public static void SaveHistory() 102 | { 103 | try 104 | { 105 | File.WriteAllLines("console.txt", history.ToArray()); 106 | AddLine("Written history to console.txt"); 107 | } 108 | catch (Exception arg) 109 | { 110 | DebugMod.instance.LogError("[CONSOLE] Unable to write console history: " + arg); 111 | AddLine("Unable to write console history"); 112 | } 113 | } 114 | 115 | private static int WrapIndex(Font font, int fontSize, string message) 116 | { 117 | int totalLength = 0; 118 | 119 | char[] arr = message.ToCharArray(); 120 | 121 | for (int i = 0; i < arr.Length; i++) 122 | { 123 | char c = arr[i]; 124 | font.GetCharacterInfo(c, out CharacterInfo characterInfo, fontSize); 125 | totalLength += characterInfo.advance; 126 | 127 | if (totalLength >= 564) return i; 128 | } 129 | 130 | return -1; 131 | } 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /Source/KeyBindPanel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using UnityEngine; 5 | 6 | namespace DebugMod 7 | { 8 | public static class KeyBindPanel 9 | { 10 | private static CanvasPanel panel; 11 | private static int page = 0; 12 | 13 | private static Dictionary> bindPages = new Dictionary>(); 14 | private static List pageKeys; 15 | 16 | public static KeyCode keyWarning = KeyCode.None; 17 | 18 | public static void BuildMenu(GameObject canvas) 19 | { 20 | panel = new CanvasPanel(canvas, GUIController.Instance.images["HelpBG"], new Vector2(1123, 456), Vector2.zero, new Rect(0, 0, GUIController.Instance.images["HelpBG"].width, GUIController.Instance.images["HelpBG"].height)); 21 | panel.AddText("Label", "Binds", new Vector2(130f, -25f), Vector2.zero, GUIController.Instance.trajanBold, 30); 22 | 23 | panel.AddText("Category", "", new Vector2(25f, 25f), Vector2.zero, GUIController.Instance.trajanNormal, 20); 24 | panel.AddText("Help", "", new Vector2(25f, 50f), Vector2.zero, GUIController.Instance.arial, 15); 25 | panel.AddButton("Next", GUIController.Instance.images["ButtonRect"], new Vector2(125, 250), Vector2.zero, NextClicked, new Rect(0, 0, GUIController.Instance.images["ButtonRect"].width, GUIController.Instance.images["ButtonRect"].height), GUIController.Instance.trajanBold, "# / #"); 26 | 27 | for (int i = 0; i < 11; i++) 28 | { 29 | panel.AddButton(i.ToString(), GUIController.Instance.images["Scrollbar_point"], new Vector2(300f, 45f + 17.5f * i), Vector2.zero, ChangeBind, new Rect(0, 0, GUIController.Instance.images["Scrollbar_point"].width, GUIController.Instance.images["Scrollbar_point"].height)); 30 | } 31 | 32 | //Build pages based on categories 33 | foreach (KeyValuePair bindable in DebugMod.bindMethods) 34 | { 35 | string name = bindable.Key; 36 | string cat = (string)bindable.Value.First; 37 | 38 | if (!bindPages.ContainsKey(cat)) bindPages.Add(cat, new List()); 39 | bindPages[cat].Add(name); 40 | } 41 | 42 | pageKeys = bindPages.Keys.ToList(); 43 | 44 | panel.GetText("Category").UpdateText(pageKeys[page]); 45 | panel.GetButton("Next").UpdateText((page + 1) + " / " + pageKeys.Count); 46 | UpdateHelpText(); 47 | } 48 | 49 | public static void UpdateHelpText() 50 | { 51 | if (page < 0 || page >= pageKeys.Count) return; 52 | 53 | string cat = pageKeys[page]; 54 | List helpPage = bindPages[cat]; 55 | 56 | string updatedText = ""; 57 | 58 | foreach (string bindStr in helpPage) 59 | { 60 | updatedText += bindStr + " - "; 61 | 62 | if (DebugMod.settings.binds.ContainsKey(bindStr)) 63 | { 64 | KeyCode code = ((KeyCode)DebugMod.settings.binds[bindStr]); 65 | 66 | if (code != KeyCode.None) 67 | { 68 | updatedText += ((KeyCode)DebugMod.settings.binds[bindStr]).ToString(); 69 | } 70 | else 71 | { 72 | updatedText += "WAITING"; 73 | } 74 | } 75 | else 76 | { 77 | updatedText += "UNBOUND"; 78 | } 79 | 80 | updatedText += "\n"; 81 | } 82 | 83 | panel.GetText("Help").UpdateText(updatedText); 84 | } 85 | 86 | private static void NextClicked(string buttonName) 87 | { 88 | page++; 89 | if (page >= pageKeys.Count) page = 0; 90 | 91 | panel.GetText("Category").UpdateText(pageKeys[page]); 92 | panel.GetButton("Next").UpdateText((page + 1) + " / " + pageKeys.Count); 93 | UpdateHelpText(); 94 | } 95 | 96 | private static void ChangeBind(string buttonName) 97 | { 98 | int num = Convert.ToInt32(buttonName); 99 | 100 | if (num < 0 || num >= bindPages[pageKeys[page]].Count) 101 | { 102 | DebugMod.instance.LogWarn("Invalid bind change button clicked. Should not be possible"); 103 | return; 104 | } 105 | 106 | string bindName = bindPages[pageKeys[page]][num]; 107 | 108 | if (DebugMod.settings.binds.ContainsKey(bindName)) 109 | { 110 | DebugMod.settings.binds[bindName] = (int)KeyCode.None; 111 | } 112 | else 113 | { 114 | DebugMod.settings.binds.Add(bindName, (int)KeyCode.None); 115 | } 116 | 117 | UpdateHelpText(); 118 | } 119 | 120 | public static void Update() 121 | { 122 | if (panel == null) 123 | { 124 | return; 125 | } 126 | 127 | if (DebugMod.GM.IsNonGameplayScene()) 128 | { 129 | if (panel.active) 130 | { 131 | panel.SetActive(false, true); 132 | } 133 | 134 | return; 135 | } 136 | 137 | if (DebugMod.settings.HelpPanelVisible && !panel.active) 138 | { 139 | panel.SetActive(true, false); 140 | } 141 | else if (!DebugMod.settings.HelpPanelVisible && panel.active) 142 | { 143 | panel.SetActive(false, true); 144 | } 145 | 146 | if (panel.active && page >= 0 && page < pageKeys.Count) 147 | { 148 | for (int i = 0; i < 11; i++) 149 | { 150 | panel.GetButton(i.ToString()).SetActive(bindPages[pageKeys[page]].Count > i); 151 | } 152 | } 153 | } 154 | } 155 | } 156 | -------------------------------------------------------------------------------- /Source/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # MSTest test Results 33 | [Tt]est[Rr]esult*/ 34 | [Bb]uild[Ll]og.* 35 | 36 | # NUNIT 37 | *.VisualState.xml 38 | TestResult.xml 39 | 40 | # Build Results of an ATL Project 41 | [Dd]ebugPS/ 42 | [Rr]eleasePS/ 43 | dlldata.c 44 | 45 | # .NET Core 46 | project.lock.json 47 | project.fragment.lock.json 48 | artifacts/ 49 | **/Properties/launchSettings.json 50 | 51 | *_i.c 52 | *_p.c 53 | *_i.h 54 | *.ilk 55 | *.meta 56 | *.obj 57 | *.pch 58 | *.pdb 59 | *.pgc 60 | *.pgd 61 | *.rsp 62 | *.sbr 63 | *.tlb 64 | *.tli 65 | *.tlh 66 | *.tmp 67 | *.tmp_proj 68 | *.log 69 | *.vspscc 70 | *.vssscc 71 | .builds 72 | *.pidb 73 | *.svclog 74 | *.scc 75 | 76 | # Chutzpah Test files 77 | _Chutzpah* 78 | 79 | # Visual C++ cache files 80 | ipch/ 81 | *.aps 82 | *.ncb 83 | *.opendb 84 | *.opensdf 85 | *.sdf 86 | *.cachefile 87 | *.VC.db 88 | *.VC.VC.opendb 89 | 90 | # Visual Studio profiler 91 | *.psess 92 | *.vsp 93 | *.vspx 94 | *.sap 95 | 96 | # TFS 2012 Local Workspace 97 | $tf/ 98 | 99 | # Guidance Automation Toolkit 100 | *.gpState 101 | 102 | # ReSharper is a .NET coding add-in 103 | _ReSharper*/ 104 | *.[Rr]e[Ss]harper 105 | *.DotSettings.user 106 | 107 | # JustCode is a .NET coding add-in 108 | .JustCode 109 | 110 | # TeamCity is a build add-in 111 | _TeamCity* 112 | 113 | # DotCover is a Code Coverage Tool 114 | *.dotCover 115 | 116 | # Visual Studio code coverage results 117 | *.coverage 118 | *.coveragexml 119 | 120 | # NCrunch 121 | _NCrunch_* 122 | .*crunch*.local.xml 123 | nCrunchTemp_* 124 | 125 | # MightyMoose 126 | *.mm.* 127 | AutoTest.Net/ 128 | 129 | # Web workbench (sass) 130 | .sass-cache/ 131 | 132 | # Installshield output folder 133 | [Ee]xpress/ 134 | 135 | # DocProject is a documentation generator add-in 136 | DocProject/buildhelp/ 137 | DocProject/Help/*.HxT 138 | DocProject/Help/*.HxC 139 | DocProject/Help/*.hhc 140 | DocProject/Help/*.hhk 141 | DocProject/Help/*.hhp 142 | DocProject/Help/Html2 143 | DocProject/Help/html 144 | 145 | # Click-Once directory 146 | publish/ 147 | 148 | # Publish Web Output 149 | *.[Pp]ublish.xml 150 | *.azurePubxml 151 | # TODO: Comment the next line if you want to checkin your web deploy settings 152 | # but database connection strings (with potential passwords) will be unencrypted 153 | *.pubxml 154 | *.publishproj 155 | 156 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 157 | # checkin your Azure Web App publish settings, but sensitive information contained 158 | # in these scripts will be unencrypted 159 | PublishScripts/ 160 | 161 | # NuGet Packages 162 | *.nupkg 163 | # The packages folder can be ignored because of Package Restore 164 | **/packages/* 165 | # except build/, which is used as an MSBuild target. 166 | !**/packages/build/ 167 | # Uncomment if necessary however generally it will be regenerated when needed 168 | #!**/packages/repositories.config 169 | # NuGet v3's project.json files produces more ignorable files 170 | *.nuget.props 171 | *.nuget.targets 172 | 173 | # Microsoft Azure Build Output 174 | csx/ 175 | *.build.csdef 176 | 177 | # Microsoft Azure Emulator 178 | ecf/ 179 | rcf/ 180 | 181 | # Windows Store app package directories and files 182 | AppPackages/ 183 | BundleArtifacts/ 184 | Package.StoreAssociation.xml 185 | _pkginfo.txt 186 | 187 | # Visual Studio cache files 188 | # files ending in .cache can be ignored 189 | *.[Cc]ache 190 | # but keep track of directories ending in .cache 191 | !*.[Cc]ache/ 192 | 193 | # Others 194 | ClientBin/ 195 | ~$* 196 | *~ 197 | *.dbmdl 198 | *.dbproj.schemaview 199 | *.jfm 200 | *.pfx 201 | *.publishsettings 202 | orleans.codegen.cs 203 | 204 | # Since there are multiple workflows, uncomment next line to ignore bower_components 205 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 206 | #bower_components/ 207 | 208 | # RIA/Silverlight projects 209 | Generated_Code/ 210 | 211 | # Backup & report files from converting an old project file 212 | # to a newer Visual Studio version. Backup files are not needed, 213 | # because we have git ;-) 214 | _UpgradeReport_Files/ 215 | Backup*/ 216 | UpgradeLog*.XML 217 | UpgradeLog*.htm 218 | 219 | # SQL Server files 220 | *.mdf 221 | *.ldf 222 | *.ndf 223 | 224 | # Business Intelligence projects 225 | *.rdl.data 226 | *.bim.layout 227 | *.bim_*.settings 228 | 229 | # Microsoft Fakes 230 | FakesAssemblies/ 231 | 232 | # GhostDoc plugin setting file 233 | *.GhostDoc.xml 234 | 235 | # Node.js Tools for Visual Studio 236 | .ntvs_analysis.dat 237 | node_modules/ 238 | 239 | # Typescript v1 declaration files 240 | typings/ 241 | 242 | # Visual Studio 6 build log 243 | *.plg 244 | 245 | # Visual Studio 6 workspace options file 246 | *.opt 247 | 248 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 249 | *.vbw 250 | 251 | # Visual Studio LightSwitch build output 252 | **/*.HTMLClient/GeneratedArtifacts 253 | **/*.DesktopClient/GeneratedArtifacts 254 | **/*.DesktopClient/ModelManifest.xml 255 | **/*.Server/GeneratedArtifacts 256 | **/*.Server/ModelManifest.xml 257 | _Pvt_Extensions 258 | 259 | # Paket dependency manager 260 | .paket/paket.exe 261 | paket-files/ 262 | 263 | # FAKE - F# Make 264 | .fake/ 265 | 266 | # JetBrains Rider 267 | .idea/ 268 | *.sln.iml 269 | 270 | # CodeRush 271 | .cr/ 272 | 273 | # Python Tools for Visual Studio (PTVS) 274 | __pycache__/ 275 | *.pyc 276 | 277 | # Cake - Uncomment if you are using it 278 | # tools/** 279 | # !tools/packages.config 280 | 281 | # Telerik's JustMock configuration file 282 | *.jmconfig 283 | 284 | # BizTalk build output 285 | *.btp.cs 286 | *.btm.cs 287 | *.odx.cs 288 | *.xsd.cs 289 | -------------------------------------------------------------------------------- /Source/CanvasButton.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | using UnityEngine.Events; 4 | 5 | namespace DebugMod 6 | { 7 | public class CanvasButton 8 | { 9 | private GameObject buttonObj; 10 | private GameObject textObj; 11 | private Button button; 12 | private UnityAction clicked; 13 | private string buttonName; 14 | 15 | public bool active; 16 | 17 | public CanvasButton(GameObject parent, string name, Texture2D tex, Vector2 pos, Vector2 size, Rect bgSubSection, Font font = null, string text = null, int fontSize = 13) 18 | { 19 | if (size.x == 0 || size.y == 0) 20 | { 21 | size = new Vector2(bgSubSection.width, bgSubSection.height); 22 | } 23 | 24 | buttonName = name; 25 | 26 | buttonObj = new GameObject(); 27 | buttonObj.AddComponent(); 28 | RectTransform buttonTransform = buttonObj.AddComponent(); 29 | buttonTransform.sizeDelta = new Vector2(bgSubSection.width, bgSubSection.height); 30 | buttonObj.AddComponent().sprite = Sprite.Create(tex, new Rect(bgSubSection.x, tex.height - bgSubSection.height, bgSubSection.width, bgSubSection.height), Vector2.zero); 31 | button = buttonObj.AddComponent