From a73e992a0c9871971d3b042d4e4c36153ef527ad Mon Sep 17 00:00:00 2001 From: Sinai <49360850+sinai-dev@users.noreply.github.com> Date: Mon, 17 Jan 2022 19:42:05 +1100 Subject: [PATCH] Remove "Core" namespace, move everything in it up one level --- src/CSConsole/ScriptInteraction.cs | 2 +- src/CacheObject/CacheConfigEntry.cs | 2 +- src/CacheObject/CacheMember.cs | 2 +- src/CacheObject/CacheObjectBase.cs | 2 +- src/CacheObject/IValues/InteractiveString.cs | 2 +- src/CacheObject/Views/CacheMemberCell.cs | 15 ----------- src/CacheObject/Views/CacheObjectCell.cs | 13 +++++----- src/{Core => }/Config/ConfigElement.cs | 2 +- src/{Core => }/Config/ConfigHandler.cs | 2 +- src/{Core => }/Config/ConfigManager.cs | 2 +- src/{Core => }/Config/IConfigElement.cs | 2 +- .../Config/InternalConfigHandler.cs | 2 +- src/{Core => }/ExplorerBehaviour.cs | 0 src/ExplorerCore.cs | 6 ++--- src/Hooks/HookManager.cs | 2 +- src/Inspectors/InspectUnderMouse.cs | 3 +-- src/Inspectors/ReflectionInspector.cs | 4 +-- src/Loader/BepInEx/BepInExConfigHandler.cs | 2 +- src/Loader/BepInEx/ExplorerBepInPlugin.cs | 3 +-- src/Loader/IExplorerLoader.cs | 2 +- src/Loader/MelonLoader/ExplorerMelonMod.cs | 2 +- .../MelonLoader/MelonLoaderConfigHandler.cs | 2 +- src/Loader/Standalone/ExplorerStandalone.cs | 2 +- .../Standalone/StandaloneConfigHandler.cs | 2 +- src/ObjectExplorer/SceneExplorer.cs | 1 - src/ObjectExplorer/SearchProvider.cs | 3 +-- src/{Core => }/Runtime/Il2CppProvider.cs | 2 +- src/{Core => }/Runtime/MonoProvider.cs | 2 +- src/{Core => }/Runtime/RuntimeHelper.cs | 4 +-- src/{Core => }/Tests/TestClass.cs | 26 ++++++++----------- src/UI/Panels/CSConsolePanel.cs | 2 +- src/UI/Panels/HookManagerPanel.cs | 2 +- src/UI/Panels/InspectorPanel.cs | 2 +- src/UI/Panels/LogPanel.cs | 2 +- src/UI/Panels/ObjectExplorerPanel.cs | 3 +-- src/UI/Panels/OptionsPanel.cs | 2 +- src/UI/Panels/UIPanel.cs | 2 +- src/UI/UIManager.cs | 26 ++++++++++--------- .../Widgets/AutoComplete/AutoCompleteModal.cs | 2 +- src/UI/Widgets/AutoComplete/Suggestion.cs | 1 - src/UnityExplorer.csproj | 20 +++++++------- 41 files changed, 78 insertions(+), 102 deletions(-) rename src/{Core => }/Config/ConfigElement.cs (98%) rename src/{Core => }/Config/ConfigHandler.cs (93%) rename src/{Core => }/Config/ConfigManager.cs (99%) rename src/{Core => }/Config/IConfigElement.cs (91%) rename src/{Core => }/Config/InternalConfigHandler.cs (98%) rename src/{Core => }/ExplorerBehaviour.cs (100%) rename src/{Core => }/Runtime/Il2CppProvider.cs (99%) rename src/{Core => }/Runtime/MonoProvider.cs (94%) rename src/{Core => }/Runtime/RuntimeHelper.cs (97%) rename src/{Core => }/Tests/TestClass.cs (95%) diff --git a/src/CSConsole/ScriptInteraction.cs b/src/CSConsole/ScriptInteraction.cs index c8b1bda..2352188 100644 --- a/src/CSConsole/ScriptInteraction.cs +++ b/src/CSConsole/ScriptInteraction.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using UnityEngine; -using UnityExplorer.Core.Runtime; +using UnityExplorer.Runtime; using UniverseLib; namespace UnityExplorer.CSConsole diff --git a/src/CacheObject/CacheConfigEntry.cs b/src/CacheObject/CacheConfigEntry.cs index ffce9ae..84f59d1 100644 --- a/src/CacheObject/CacheConfigEntry.cs +++ b/src/CacheObject/CacheConfigEntry.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using UnityExplorer.Core.Config; +using UnityExplorer.Config; using UnityExplorer.CacheObject.Views; namespace UnityExplorer.CacheObject diff --git a/src/CacheObject/CacheMember.cs b/src/CacheObject/CacheMember.cs index e2bffb0..fdaa67d 100644 --- a/src/CacheObject/CacheMember.cs +++ b/src/CacheObject/CacheMember.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Reflection; using System.Text; using UnityEngine; -using UnityExplorer.Core.Runtime; +using UnityExplorer.Runtime; using UnityExplorer.CacheObject.Views; using UnityExplorer.Inspectors; using UniverseLib.UI.Models; diff --git a/src/CacheObject/CacheObjectBase.cs b/src/CacheObject/CacheObjectBase.cs index 434affb..569f521 100644 --- a/src/CacheObject/CacheObjectBase.cs +++ b/src/CacheObject/CacheObjectBase.cs @@ -6,7 +6,7 @@ using System.Reflection; using System.Text; using UnityEngine; using UnityEngine.UI; -using UnityExplorer.Core.Runtime; +using UnityExplorer.Runtime; using UnityExplorer.CacheObject.IValues; using UnityExplorer.CacheObject.Views; using UniverseLib.UI.Models; diff --git a/src/CacheObject/IValues/InteractiveString.cs b/src/CacheObject/IValues/InteractiveString.cs index 90bb003..afc3e78 100644 --- a/src/CacheObject/IValues/InteractiveString.cs +++ b/src/CacheObject/IValues/InteractiveString.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Text; using UnityEngine; using UnityEngine.UI; -using UnityExplorer.Core.Config; +using UnityExplorer.Config; using UnityExplorer.CacheObject; using UnityExplorer.UI.Widgets; using UnityExplorer.UI; diff --git a/src/CacheObject/Views/CacheMemberCell.cs b/src/CacheObject/Views/CacheMemberCell.cs index 1a1f695..ae65e14 100644 --- a/src/CacheObject/Views/CacheMemberCell.cs +++ b/src/CacheObject/Views/CacheMemberCell.cs @@ -12,15 +12,11 @@ namespace UnityExplorer.CacheObject.Views { public class CacheMemberCell : CacheObjectCell { - //public ReflectionInspector Owner { get; set; } - public CacheMember MemberOccupant => Occupant as CacheMember; public GameObject EvaluateHolder; public ButtonRef EvaluateButton; - //public Toggle UpdateToggle; - protected virtual void EvaluateClicked() { this.MemberOccupant.OnEvaluateClicked(); @@ -38,16 +34,5 @@ namespace UnityExplorer.CacheObject.Views UIFactory.SetLayoutElement(EvaluateButton.Component.gameObject, minWidth: 100, minHeight: 25); EvaluateButton.OnClick += EvaluateClicked; } - - //protected override void ConstructUpdateToggle(GameObject parent) - //{ - // // Auto-update toggle - // - // var updateToggle = UIFactory.CreateToggle(parent, "AutoUpdate", out UpdateToggle, out Text autoText); - // UIFactory.SetLayoutElement(updateToggle, minHeight: 25, minWidth: 30, flexibleWidth: 0, flexibleHeight: 0); - // GameObject.Destroy(autoText); - // UpdateToggle.isOn = false; - // UpdateToggle.onValueChanged.AddListener((bool val) => { MemberOccupant.AutoUpdateWanted = val; }); - //} } } diff --git a/src/CacheObject/Views/CacheObjectCell.cs b/src/CacheObject/Views/CacheObjectCell.cs index 75f8fca..485c2bf 100644 --- a/src/CacheObject/Views/CacheObjectCell.cs +++ b/src/CacheObject/Views/CacheObjectCell.cs @@ -45,6 +45,7 @@ namespace UnityExplorer.CacheObject.Views public bool SubContentActive => SubContentHolder.activeSelf; public LayoutElement NameLayout; + public GameObject RightGroupContent; public LayoutElement RightGroupLayout; public Text NameLabel; @@ -136,16 +137,16 @@ namespace UnityExplorer.CacheObject.Views // Right vertical group - var rightGroupHolder = UIFactory.CreateUIObject("RightGroup", horiRow); - UIFactory.SetLayoutGroup(rightGroupHolder, false, false, true, true, 4, childAlignment: TextAnchor.UpperLeft); - UIFactory.SetLayoutElement(rightGroupHolder, minHeight: 25, minWidth: 200, flexibleWidth: 9999, flexibleHeight: 800); - RightGroupLayout = rightGroupHolder.GetComponent(); + RightGroupContent = UIFactory.CreateUIObject("RightGroup", horiRow); + UIFactory.SetLayoutGroup(RightGroupContent, false, false, true, true, 4, childAlignment: TextAnchor.UpperLeft); + UIFactory.SetLayoutElement(RightGroupContent, minHeight: 25, minWidth: 200, flexibleWidth: 9999, flexibleHeight: 800); + RightGroupLayout = RightGroupContent.GetComponent(); - ConstructEvaluateHolder(rightGroupHolder); + ConstructEvaluateHolder(RightGroupContent); // Right horizontal group - var rightHoriGroup = UIFactory.CreateUIObject("RightHoriGroup", rightGroupHolder); + var rightHoriGroup = UIFactory.CreateUIObject("RightHoriGroup", RightGroupContent); UIFactory.SetLayoutGroup(rightHoriGroup, false, false, true, true, 4, childAlignment: TextAnchor.UpperLeft); UIFactory.SetLayoutElement(rightHoriGroup, minHeight: 25, minWidth: 200, flexibleWidth: 9999, flexibleHeight: 800); diff --git a/src/Core/Config/ConfigElement.cs b/src/Config/ConfigElement.cs similarity index 98% rename from src/Core/Config/ConfigElement.cs rename to src/Config/ConfigElement.cs index d92a465..b843696 100644 --- a/src/Core/Config/ConfigElement.cs +++ b/src/Config/ConfigElement.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace UnityExplorer.Core.Config +namespace UnityExplorer.Config { public class ConfigElement : IConfigElement { diff --git a/src/Core/Config/ConfigHandler.cs b/src/Config/ConfigHandler.cs similarity index 93% rename from src/Core/Config/ConfigHandler.cs rename to src/Config/ConfigHandler.cs index 70c79ee..5b640e4 100644 --- a/src/Core/Config/ConfigHandler.cs +++ b/src/Config/ConfigHandler.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace UnityExplorer.Core.Config +namespace UnityExplorer.Config { public abstract class ConfigHandler { diff --git a/src/Core/Config/ConfigManager.cs b/src/Config/ConfigManager.cs similarity index 99% rename from src/Core/Config/ConfigManager.cs rename to src/Config/ConfigManager.cs index bd6b87e..f919aad 100644 --- a/src/Core/Config/ConfigManager.cs +++ b/src/Config/ConfigManager.cs @@ -8,7 +8,7 @@ using System.Text; using UnityEngine; using UnityExplorer.UI; -namespace UnityExplorer.Core.Config +namespace UnityExplorer.Config { public static class ConfigManager { diff --git a/src/Core/Config/IConfigElement.cs b/src/Config/IConfigElement.cs similarity index 91% rename from src/Core/Config/IConfigElement.cs rename to src/Config/IConfigElement.cs index 4a4075c..cc5bda1 100644 --- a/src/Core/Config/IConfigElement.cs +++ b/src/Config/IConfigElement.cs @@ -1,6 +1,6 @@ using System; -namespace UnityExplorer.Core.Config +namespace UnityExplorer.Config { public interface IConfigElement { diff --git a/src/Core/Config/InternalConfigHandler.cs b/src/Config/InternalConfigHandler.cs similarity index 98% rename from src/Core/Config/InternalConfigHandler.cs rename to src/Config/InternalConfigHandler.cs index e73e1ae..cedb154 100644 --- a/src/Core/Config/InternalConfigHandler.cs +++ b/src/Config/InternalConfigHandler.cs @@ -7,7 +7,7 @@ using System.Text; using UnityEngine; using UnityExplorer.UI; -namespace UnityExplorer.Core.Config +namespace UnityExplorer.Config { public class InternalConfigHandler : ConfigHandler { diff --git a/src/Core/ExplorerBehaviour.cs b/src/ExplorerBehaviour.cs similarity index 100% rename from src/Core/ExplorerBehaviour.cs rename to src/ExplorerBehaviour.cs diff --git a/src/ExplorerCore.cs b/src/ExplorerCore.cs index 97ab89c..469c00d 100644 --- a/src/ExplorerCore.cs +++ b/src/ExplorerCore.cs @@ -4,11 +4,11 @@ using System.Collections.Generic; using System.IO; using UnityEngine; using UnityEngine.UI; -using UnityExplorer.Core.Config; +using UnityExplorer.Config; using UnityExplorer.UI; using UnityExplorer.ObjectExplorer; using UnityExplorer.UI.Panels; -using UnityExplorer.Core.Runtime; +using UnityExplorer.Runtime; using UniverseLib.Input; namespace UnityExplorer @@ -51,8 +51,6 @@ namespace UnityExplorer Force_Unlock_Mouse = ConfigManager.Force_Unlock_Mouse.Value, Unhollowed_Modules_Folder = loader.UnhollowedModulesFolder }); - - Log($"Finished core setup, waiting for late setup..."); } // Do a delayed setup so that objects aren't destroyed instantly. diff --git a/src/Hooks/HookManager.cs b/src/Hooks/HookManager.cs index 4c7886b..28fcb0a 100644 --- a/src/Hooks/HookManager.cs +++ b/src/Hooks/HookManager.cs @@ -6,7 +6,7 @@ using System.Reflection; using System.Text; using HarmonyLib; using UnityEngine; -using UnityExplorer.Core.Runtime; +using UnityExplorer.Runtime; using UnityExplorer.CSConsole; using UnityExplorer.UI; using UnityExplorer.UI.Panels; diff --git a/src/Inspectors/InspectUnderMouse.cs b/src/Inspectors/InspectUnderMouse.cs index 00a3d97..c5e7476 100644 --- a/src/Inspectors/InspectUnderMouse.cs +++ b/src/Inspectors/InspectUnderMouse.cs @@ -5,9 +5,8 @@ using System.Text; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; -using UnityExplorer.Core; using UniverseLib.Input; -using UnityExplorer.Core.Runtime; +using UnityExplorer.Runtime; using UnityExplorer.Inspectors.MouseInspectors; using UnityExplorer.UI; using UnityExplorer.UI.Panels; diff --git a/src/Inspectors/ReflectionInspector.cs b/src/Inspectors/ReflectionInspector.cs index 9ca73c8..6a4d3f2 100644 --- a/src/Inspectors/ReflectionInspector.cs +++ b/src/Inspectors/ReflectionInspector.cs @@ -8,8 +8,8 @@ using System.Reflection.Emit; using System.Text; using UnityEngine; using UnityEngine.UI; -using UnityExplorer.Core.Config; -using UnityExplorer.Core.Runtime; +using UnityExplorer.Config; +using UnityExplorer.Runtime; using UnityExplorer.CacheObject; using UnityExplorer.CacheObject.Views; using UnityExplorer.UI.Panels; diff --git a/src/Loader/BepInEx/BepInExConfigHandler.cs b/src/Loader/BepInEx/BepInExConfigHandler.cs index c968e6a..360de84 100644 --- a/src/Loader/BepInEx/BepInExConfigHandler.cs +++ b/src/Loader/BepInEx/BepInExConfigHandler.cs @@ -4,7 +4,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; -using UnityExplorer.Core.Config; +using UnityExplorer.Config; namespace UnityExplorer.Loader.BIE { diff --git a/src/Loader/BepInEx/ExplorerBepInPlugin.cs b/src/Loader/BepInEx/ExplorerBepInPlugin.cs index 88e0468..0c0ae6e 100644 --- a/src/Loader/BepInEx/ExplorerBepInPlugin.cs +++ b/src/Loader/BepInEx/ExplorerBepInPlugin.cs @@ -9,8 +9,7 @@ using System.Linq; using System.Text; using UnityEngine; using UnityEngine.EventSystems; -using UnityExplorer.Core; -using UnityExplorer.Core.Config; +using UnityExplorer.Config; using UniverseLib.Input; using UnityExplorer.Loader.BIE; #if CPP diff --git a/src/Loader/IExplorerLoader.cs b/src/Loader/IExplorerLoader.cs index 9a51826..cc7c741 100644 --- a/src/Loader/IExplorerLoader.cs +++ b/src/Loader/IExplorerLoader.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using UnityExplorer.Core.Config; +using UnityExplorer.Config; namespace UnityExplorer { diff --git a/src/Loader/MelonLoader/ExplorerMelonMod.cs b/src/Loader/MelonLoader/ExplorerMelonMod.cs index bc2a0f3..a588218 100644 --- a/src/Loader/MelonLoader/ExplorerMelonMod.cs +++ b/src/Loader/MelonLoader/ExplorerMelonMod.cs @@ -3,7 +3,7 @@ using System; using System.IO; using MelonLoader; using UnityExplorer; -using UnityExplorer.Core.Config; +using UnityExplorer.Config; using UnityExplorer.Loader.ML; [assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.UNIVERSAL)] diff --git a/src/Loader/MelonLoader/MelonLoaderConfigHandler.cs b/src/Loader/MelonLoader/MelonLoaderConfigHandler.cs index fabb63c..a4a9094 100644 --- a/src/Loader/MelonLoader/MelonLoaderConfigHandler.cs +++ b/src/Loader/MelonLoader/MelonLoaderConfigHandler.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using UnityEngine; using UnityExplorer.Core; -using UnityExplorer.Core.Config; +using UnityExplorer.Config; namespace UnityExplorer.Loader.ML { diff --git a/src/Loader/Standalone/ExplorerStandalone.cs b/src/Loader/Standalone/ExplorerStandalone.cs index cbefb96..8ac87c3 100644 --- a/src/Loader/Standalone/ExplorerStandalone.cs +++ b/src/Loader/Standalone/ExplorerStandalone.cs @@ -4,7 +4,7 @@ using System; using System.IO; using System.Reflection; using UnityEngine; -using UnityExplorer.Core.Config; +using UnityExplorer.Config; using UnityExplorer.Loader.STANDALONE; using UnityEngine.EventSystems; using UniverseLib.Input; diff --git a/src/Loader/Standalone/StandaloneConfigHandler.cs b/src/Loader/Standalone/StandaloneConfigHandler.cs index f8d4615..22df2f5 100644 --- a/src/Loader/Standalone/StandaloneConfigHandler.cs +++ b/src/Loader/Standalone/StandaloneConfigHandler.cs @@ -3,7 +3,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; -using UnityExplorer.Core.Config; +using UnityExplorer.Config; using IniParser.Parser; using System.IO; using UnityEngine; diff --git a/src/ObjectExplorer/SceneExplorer.cs b/src/ObjectExplorer/SceneExplorer.cs index c1c8041..db896b9 100644 --- a/src/ObjectExplorer/SceneExplorer.cs +++ b/src/ObjectExplorer/SceneExplorer.cs @@ -7,7 +7,6 @@ using System.Text; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; -using UnityExplorer.Core; using UnityExplorer.UI; using UniverseLib.UI.Models; using UnityExplorer.UI.Panels; diff --git a/src/ObjectExplorer/SearchProvider.cs b/src/ObjectExplorer/SearchProvider.cs index 1e2e185..030f2f2 100644 --- a/src/ObjectExplorer/SearchProvider.cs +++ b/src/ObjectExplorer/SearchProvider.cs @@ -5,8 +5,7 @@ using System.Reflection; using System.Text; using UnityEngine; using UnityEngine.SceneManagement; -using UnityExplorer.Core; -using UnityExplorer.Core.Runtime; +using UnityExplorer.Runtime; using UniverseLib; namespace UnityExplorer.ObjectExplorer diff --git a/src/Core/Runtime/Il2CppProvider.cs b/src/Runtime/Il2CppProvider.cs similarity index 99% rename from src/Core/Runtime/Il2CppProvider.cs rename to src/Runtime/Il2CppProvider.cs index feca0a8..9129edb 100644 --- a/src/Core/Runtime/Il2CppProvider.cs +++ b/src/Runtime/Il2CppProvider.cs @@ -14,7 +14,7 @@ using System.Collections; using UnityEngine.UI; using UnityEngine.EventSystems; -namespace UnityExplorer.Core.Runtime +namespace UnityExplorer.Runtime { public class Il2CppProvider : RuntimeHelper { diff --git a/src/Core/Runtime/MonoProvider.cs b/src/Runtime/MonoProvider.cs similarity index 94% rename from src/Core/Runtime/MonoProvider.cs rename to src/Runtime/MonoProvider.cs index ed1562b..2c17a7b 100644 --- a/src/Core/Runtime/MonoProvider.cs +++ b/src/Runtime/MonoProvider.cs @@ -12,7 +12,7 @@ using UnityEngine.SceneManagement; using UnityEngine.UI; using UnityExplorer; -namespace UnityExplorer.Core.Runtime +namespace UnityExplorer.Runtime { public class MonoProvider : RuntimeHelper { diff --git a/src/Core/Runtime/RuntimeHelper.cs b/src/Runtime/RuntimeHelper.cs similarity index 97% rename from src/Core/Runtime/RuntimeHelper.cs rename to src/Runtime/RuntimeHelper.cs index d6166d9..b5a27ee 100644 --- a/src/Core/Runtime/RuntimeHelper.cs +++ b/src/Runtime/RuntimeHelper.cs @@ -8,10 +8,10 @@ using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.SceneManagement; using UnityEngine.UI; -using UnityExplorer.Core.Config; +using UnityExplorer.Config; using UniverseLib; -namespace UnityExplorer.Core.Runtime +namespace UnityExplorer.Runtime { public abstract class RuntimeHelper { diff --git a/src/Core/Tests/TestClass.cs b/src/Tests/TestClass.cs similarity index 95% rename from src/Core/Tests/TestClass.cs rename to src/Tests/TestClass.cs index ccec61d..9522c3b 100644 --- a/src/Core/Tests/TestClass.cs +++ b/src/Tests/TestClass.cs @@ -30,7 +30,7 @@ namespace UnityExplorer.Tests public static IDictionary MixedDictionary; public static Hashtable Hashtable; public static byte[] ByteArray = new byte[16]; - public static List ABigList = new List(10000); + public static List ABigList = new(10000); // Test const behaviour (should be a readonly field) public const int ConstantInt5 = 5; @@ -64,21 +64,17 @@ namespace UnityExplorer.Tests private static object GetRandomObject() { - object ret = null; - - int ran = UnityEngine.Random.Range(0, 7); - switch (ran) + return UnityEngine.Random.Range(0, 7) switch { - case 0: return null; - case 1: return 123; - case 2: return true; - case 3: return "hello"; - case 4: return 50.5f; - case 5: return CameraClearFlags.Color; - case 6: return new List { "one", "two" }; - } - - return ret; + 0 => null, + 1 => 123, + 2 => true, + 3 => "hello", + 4 => 50.5f, + 5 => CameraClearFlags.Color, + 6 => new List { "one", "two" }, + _ => null, + }; } public static void TestComponent() where T : Component diff --git a/src/UI/Panels/CSConsolePanel.cs b/src/UI/Panels/CSConsolePanel.cs index c45e109..4d2176c 100644 --- a/src/UI/Panels/CSConsolePanel.cs +++ b/src/UI/Panels/CSConsolePanel.cs @@ -6,7 +6,7 @@ using System.Text; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; -using UnityExplorer.Core.Config; +using UnityExplorer.Config; using UnityExplorer.CSConsole; using UnityExplorer.UI.Widgets; using UniverseLib; diff --git a/src/UI/Panels/HookManagerPanel.cs b/src/UI/Panels/HookManagerPanel.cs index 6ee8f10..9643835 100644 --- a/src/UI/Panels/HookManagerPanel.cs +++ b/src/UI/Panels/HookManagerPanel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using UnityEngine; using UnityEngine.UI; -using UnityExplorer.Core.Config; +using UnityExplorer.Config; using UnityExplorer.Hooks; using UnityExplorer.UI.Widgets; using UnityExplorer.UI.Widgets.AutoComplete; diff --git a/src/UI/Panels/InspectorPanel.cs b/src/UI/Panels/InspectorPanel.cs index e095b25..32e27c7 100644 --- a/src/UI/Panels/InspectorPanel.cs +++ b/src/UI/Panels/InspectorPanel.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Text; using UnityEngine; using UnityEngine.UI; -using UnityExplorer.Core.Config; +using UnityExplorer.Config; using UnityExplorer.Inspectors; using UniverseLib.UI; diff --git a/src/UI/Panels/LogPanel.cs b/src/UI/Panels/LogPanel.cs index 04970f6..c619855 100644 --- a/src/UI/Panels/LogPanel.cs +++ b/src/UI/Panels/LogPanel.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using UnityEngine; using UnityEngine.UI; -using UnityExplorer.Core.Config; +using UnityExplorer.Config; using UnityExplorer.UI.Widgets; using UniverseLib; using UniverseLib.UI; diff --git a/src/UI/Panels/ObjectExplorerPanel.cs b/src/UI/Panels/ObjectExplorerPanel.cs index f2eb508..638266c 100644 --- a/src/UI/Panels/ObjectExplorerPanel.cs +++ b/src/UI/Panels/ObjectExplorerPanel.cs @@ -8,8 +8,7 @@ using System.Text; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; -using UnityExplorer.Core; -using UnityExplorer.Core.Config; +using UnityExplorer.Config; using UniverseLib.UI.Models; using UnityExplorer.ObjectExplorer; using UnityExplorer.UI.Widgets; diff --git a/src/UI/Panels/OptionsPanel.cs b/src/UI/Panels/OptionsPanel.cs index c60fa3a..a457468 100644 --- a/src/UI/Panels/OptionsPanel.cs +++ b/src/UI/Panels/OptionsPanel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using UnityEngine; using UnityEngine.UI; -using UnityExplorer.Core.Config; +using UnityExplorer.Config; using UnityExplorer.CacheObject; using UnityExplorer.CacheObject.Views; using UnityExplorer.UI.Widgets; diff --git a/src/UI/Panels/UIPanel.cs b/src/UI/Panels/UIPanel.cs index 525830e..59c75f2 100644 --- a/src/UI/Panels/UIPanel.cs +++ b/src/UI/Panels/UIPanel.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Text; using UnityEngine; using UnityEngine.UI; -using UnityExplorer.Core.Config; +using UnityExplorer.Config; using UniverseLib.Input; using UnityExplorer.UI.Widgets; using UniverseLib.UI.Models; diff --git a/src/UI/UIManager.cs b/src/UI/UIManager.cs index e70bfc3..8dd2992 100644 --- a/src/UI/UIManager.cs +++ b/src/UI/UIManager.cs @@ -9,7 +9,7 @@ using System.Text; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; -using UnityExplorer.Core.Config; +using UnityExplorer.Config; using UnityExplorer.CSConsole; using UnityExplorer.Inspectors; using UnityExplorer.UI.Panels; @@ -81,10 +81,12 @@ namespace UnityExplorer.UI { uiBase = UniversalUI.RegisterUI(ExplorerCore.GUID, Update); + lastScreenWidth = Screen.width; + lastScreenHeight = Screen.height; + + // Create UI CreatePanelHolder(); - CreateTopNavBar(); - UIPanels.Add(Panels.AutoCompleter, new AutoCompleteModal()); UIPanels.Add(Panels.ObjectExplorer, new ObjectExplorerPanel()); UIPanels.Add(Panels.Inspector, new InspectorPanel()); @@ -98,20 +100,18 @@ namespace UnityExplorer.UI foreach (var panel in UIPanels.Values) panel.ConstructUI(); + // Call some initialize methods ConsoleController.Init(); + // Add this listener to prevent ScrollPool doing anything while we are resizing panels + ScrollPool.writingLockedListeners.Add(() => !PanelDragger.Resizing); + + // Set default menu visibility ShowMenu = !ConfigManager.Hide_On_Startup.Value; - lastScreenWidth = Screen.width; - lastScreenHeight = Screen.height; - - // Failsafe fix + // Failsafe fix, in some games all dropdowns displayed values are blank on startup for some reason. foreach (var dropdown in UIRoot.GetComponentsInChildren(true)) dropdown.RefreshShownValue(); - timeInput.Text = string.Empty; - timeInput.Text = Time.timeScale.ToString(); - - ScrollPool.writingLockedListeners.Add(() => !PanelDragger.Resizing); Initializing = false; } @@ -328,9 +328,11 @@ namespace UnityExplorer.UI timeInput = UIFactory.CreateInputField(navbarPanel, "TimeInput", "timeScale"); UIFactory.SetLayoutElement(timeInput.Component.gameObject, minHeight: 25, minWidth: 40); - timeInput.Text = Time.timeScale.ToString("F2"); timeInput.Component.GetOnEndEdit().AddListener(OnTimeInputEndEdit); + timeInput.Text = string.Empty; + timeInput.Text = Time.timeScale.ToString(); + pauseBtn = UIFactory.CreateButton(navbarPanel, "PauseButton", "||", new Color(0.2f, 0.2f, 0.2f)); UIFactory.SetLayoutElement(pauseBtn.Component.gameObject, minHeight: 25, minWidth: 25); pauseBtn.OnClick += OnPauseButtonClicked; diff --git a/src/UI/Widgets/AutoComplete/AutoCompleteModal.cs b/src/UI/Widgets/AutoComplete/AutoCompleteModal.cs index 9a1b0de..b542dc7 100644 --- a/src/UI/Widgets/AutoComplete/AutoCompleteModal.cs +++ b/src/UI/Widgets/AutoComplete/AutoCompleteModal.cs @@ -5,7 +5,7 @@ using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; using UniverseLib.Input; -using UnityExplorer.Core.Runtime; +using UnityExplorer.Runtime; using UnityExplorer.UI; using UnityExplorer.UI.Panels; using UniverseLib.UI.Widgets; diff --git a/src/UI/Widgets/AutoComplete/Suggestion.cs b/src/UI/Widgets/AutoComplete/Suggestion.cs index a25dbb8..07055d3 100644 --- a/src/UI/Widgets/AutoComplete/Suggestion.cs +++ b/src/UI/Widgets/AutoComplete/Suggestion.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; using UnityEngine; -using UnityExplorer.Core; namespace UnityExplorer.UI.Widgets.AutoComplete { diff --git a/src/UnityExplorer.csproj b/src/UnityExplorer.csproj index 9fe309f..ab5612f 100644 --- a/src/UnityExplorer.csproj +++ b/src/UnityExplorer.csproj @@ -225,7 +225,7 @@ - + @@ -238,7 +238,7 @@ - + @@ -281,16 +281,16 @@ - - - - - - - + + + + + + + - +