Remove "Core" namespace, move everything in it up one level

This commit is contained in:
Sinai 2022-01-17 19:42:05 +11:00
parent 3984550bb6
commit a73e992a0c
41 changed files with 78 additions and 102 deletions

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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; });
//}
}
}

View File

@ -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<VerticalLayoutGroup>(rightGroupHolder, false, false, true, true, 4, childAlignment: TextAnchor.UpperLeft);
UIFactory.SetLayoutElement(rightGroupHolder, minHeight: 25, minWidth: 200, flexibleWidth: 9999, flexibleHeight: 800);
RightGroupLayout = rightGroupHolder.GetComponent<LayoutElement>();
RightGroupContent = UIFactory.CreateUIObject("RightGroup", horiRow);
UIFactory.SetLayoutGroup<VerticalLayoutGroup>(RightGroupContent, false, false, true, true, 4, childAlignment: TextAnchor.UpperLeft);
UIFactory.SetLayoutElement(RightGroupContent, minHeight: 25, minWidth: 200, flexibleWidth: 9999, flexibleHeight: 800);
RightGroupLayout = RightGroupContent.GetComponent<LayoutElement>();
ConstructEvaluateHolder(rightGroupHolder);
ConstructEvaluateHolder(RightGroupContent);
// Right horizontal group
var rightHoriGroup = UIFactory.CreateUIObject("RightHoriGroup", rightGroupHolder);
var rightHoriGroup = UIFactory.CreateUIObject("RightHoriGroup", RightGroupContent);
UIFactory.SetLayoutGroup<HorizontalLayoutGroup>(rightHoriGroup, false, false, true, true, 4, childAlignment: TextAnchor.UpperLeft);
UIFactory.SetLayoutElement(rightHoriGroup, minHeight: 25, minWidth: 200, flexibleWidth: 9999, flexibleHeight: 800);

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace UnityExplorer.Core.Config
namespace UnityExplorer.Config
{
public class ConfigElement<T> : IConfigElement
{

View File

@ -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
{

View File

@ -8,7 +8,7 @@ using System.Text;
using UnityEngine;
using UnityExplorer.UI;
namespace UnityExplorer.Core.Config
namespace UnityExplorer.Config
{
public static class ConfigManager
{

View File

@ -1,6 +1,6 @@
using System;
namespace UnityExplorer.Core.Config
namespace UnityExplorer.Config
{
public interface IConfigElement
{

View File

@ -7,7 +7,7 @@ using System.Text;
using UnityEngine;
using UnityExplorer.UI;
namespace UnityExplorer.Core.Config
namespace UnityExplorer.Config
{
public class InternalConfigHandler : ConfigHandler
{

View File

@ -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.

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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
{

View File

@ -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

View File

@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityExplorer.Core.Config;
using UnityExplorer.Config;
namespace UnityExplorer
{

View File

@ -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)]

View File

@ -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
{

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -14,7 +14,7 @@ using System.Collections;
using UnityEngine.UI;
using UnityEngine.EventSystems;
namespace UnityExplorer.Core.Runtime
namespace UnityExplorer.Runtime
{
public class Il2CppProvider : RuntimeHelper
{

View File

@ -12,7 +12,7 @@ using UnityEngine.SceneManagement;
using UnityEngine.UI;
using UnityExplorer;
namespace UnityExplorer.Core.Runtime
namespace UnityExplorer.Runtime
{
public class MonoProvider : RuntimeHelper
{

View File

@ -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
{

View File

@ -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<short> ABigList = new List<short>(10000);
public static List<short> 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<string> { "one", "two" };
}
return ret;
0 => null,
1 => 123,
2 => true,
3 => "hello",
4 => 50.5f,
5 => CameraClearFlags.Color,
6 => new List<string> { "one", "two" },
_ => null,
};
}
public static void TestComponent<T>() where T : Component

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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<ICell>.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<Dropdown>(true))
dropdown.RefreshShownValue();
timeInput.Text = string.Empty;
timeInput.Text = Time.timeScale.ToString();
ScrollPool<ICell>.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;

View File

@ -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;

View File

@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using UnityEngine;
using UnityExplorer.Core;
namespace UnityExplorer.UI.Widgets.AutoComplete
{

View File

@ -225,7 +225,7 @@
<Compile Include="Hooks\HookCell.cs" />
<Compile Include="Hooks\HookInstance.cs" />
<Compile Include="Hooks\HookManager.cs" />
<Compile Include="Core\Config\InternalConfigHandler.cs" />
<Compile Include="Config\InternalConfigHandler.cs" />
<Compile Include="CacheObject\CacheConfigEntry.cs" />
<Compile Include="CacheObject\Views\CacheConfigCell.cs" />
<Compile Include="CSConsole\CSAutoCompleter.cs" />
@ -238,7 +238,7 @@
<Compile Include="CSConsole\Lexers\SymbolLexer.cs" />
<Compile Include="CSConsole\ScriptEvaluator.cs" />
<Compile Include="CSConsole\ScriptInteraction.cs" />
<Compile Include="Core\ExplorerBehaviour.cs" />
<Compile Include="ExplorerBehaviour.cs" />
<Compile Include="Hooks\AddHookCell.cs" />
<Compile Include="Inspectors\GameObjectWidgets\ComponentCell.cs" />
<Compile Include="Inspectors\GameObjectWidgets\ComponentList.cs" />
@ -281,16 +281,16 @@
<Compile Include="UI\Panels\OptionsPanel.cs" />
<Compile Include="UI\Widgets\AutoComplete\ISuggestionProvider.cs" />
<Compile Include="UI\Widgets\AutoComplete\Suggestion.cs" />
<Compile Include="Core\Config\ConfigElement.cs" />
<Compile Include="Core\Config\ConfigHandler.cs" />
<Compile Include="Core\Config\ConfigManager.cs" />
<Compile Include="Core\Config\IConfigElement.cs" />
<Compile Include="Core\Runtime\Il2CppProvider.cs" />
<Compile Include="Core\Runtime\MonoProvider.cs" />
<Compile Include="Core\Runtime\RuntimeHelper.cs" />
<Compile Include="Config\ConfigElement.cs" />
<Compile Include="Config\ConfigHandler.cs" />
<Compile Include="Config\ConfigManager.cs" />
<Compile Include="Config\IConfigElement.cs" />
<Compile Include="Runtime\Il2CppProvider.cs" />
<Compile Include="Runtime\MonoProvider.cs" />
<Compile Include="Runtime\RuntimeHelper.cs" />
<Compile Include="ObjectExplorer\SceneHandler.cs" />
<Compile Include="ObjectExplorer\SearchProvider.cs" />
<Compile Include="Core\Tests\TestClass.cs" />
<Compile Include="Tests\TestClass.cs" />
<Compile Include="ExplorerCore.cs" />
<Compile Include="Loader\BepInEx\BepInExConfigHandler.cs" />
<Compile Include="Loader\BepInEx\ExplorerBepInPlugin.cs" />