mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-22 08:32:51 +08:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
4f0553d293 | |||
9f0f7f9b57 | |||
383c6f19e8 | |||
428fab28f9 | |||
760b2981ad | |||
eee7d6bcc4 | |||
e270f205a1 |
@ -17,6 +17,7 @@
|
|||||||
| [BepInEx](https://github.com/BepInEx/BepInEx) 6.X | ✅ [link](https://github.com/sinai-dev/UnityExplorer/releases/latest/download/UnityExplorer.BepInEx.Il2Cpp.zip) | ✅ [link](https://github.com/sinai-dev/UnityExplorer/releases/latest/download/UnityExplorer.BepInEx6.Mono.zip) |
|
| [BepInEx](https://github.com/BepInEx/BepInEx) 6.X | ✅ [link](https://github.com/sinai-dev/UnityExplorer/releases/latest/download/UnityExplorer.BepInEx.Il2Cpp.zip) | ✅ [link](https://github.com/sinai-dev/UnityExplorer/releases/latest/download/UnityExplorer.BepInEx6.Mono.zip) |
|
||||||
| [BepInEx](https://github.com/BepInEx/BepInEx) 5.X | ✖️ n/a | ✅ [link](https://github.com/sinai-dev/UnityExplorer/releases/latest/download/UnityExplorer.BepInEx5.Mono.zip) |
|
| [BepInEx](https://github.com/BepInEx/BepInEx) 5.X | ✖️ n/a | ✅ [link](https://github.com/sinai-dev/UnityExplorer/releases/latest/download/UnityExplorer.BepInEx5.Mono.zip) |
|
||||||
| [MelonLoader](https://github.com/HerpDerpinstine/MelonLoader) 0.3.1 | ✅ [link](https://github.com/sinai-dev/UnityExplorer/releases/latest/download/UnityExplorer.MelonLoader.Il2Cpp.zip) | ✅ [link](https://github.com/sinai-dev/UnityExplorer/releases/latest/download/UnityExplorer.MelonLoader.Mono.zip) |
|
| [MelonLoader](https://github.com/HerpDerpinstine/MelonLoader) 0.3.1 | ✅ [link](https://github.com/sinai-dev/UnityExplorer/releases/latest/download/UnityExplorer.MelonLoader.Il2Cpp.zip) | ✅ [link](https://github.com/sinai-dev/UnityExplorer/releases/latest/download/UnityExplorer.MelonLoader.Mono.zip) |
|
||||||
|
| [MelonLoader](https://github.com/HerpDerpinstine/MelonLoader) 0.3.0 | ✅ [link](https://github.com/sinai-dev/UnityExplorer/releases/latest/download/UnityExplorer.MelonLoader_Legacy.Il2Cpp.zip) | ✅ [link](https://github.com/sinai-dev/UnityExplorer/releases/latest/download/UnityExplorer.MelonLoader_Legacy.Mono.zip) |
|
||||||
| Standalone | ✅ [link](https://github.com/sinai-dev/UnityExplorer/releases/latest/download/UnityExplorer.Standalone.Il2Cpp.zip) | ✅ [link](https://github.com/sinai-dev/UnityExplorer/releases/latest/download/UnityExplorer.Standalone.Mono.zip) |
|
| Standalone | ✅ [link](https://github.com/sinai-dev/UnityExplorer/releases/latest/download/UnityExplorer.Standalone.Il2Cpp.zip) | ✅ [link](https://github.com/sinai-dev/UnityExplorer/releases/latest/download/UnityExplorer.Standalone.Mono.zip) |
|
||||||
|
|
||||||
### Known issues
|
### Known issues
|
||||||
@ -36,7 +37,7 @@
|
|||||||
|
|
||||||
### MelonLoader
|
### MelonLoader
|
||||||
|
|
||||||
1. Install [MelonLoader](https://github.com/HerpDerpinstine/MelonLoader) 0.3.1+ for your game. This version can currently be obtained from [here](https://github.com/LavaGang/MelonLoader/actions).
|
1. Install [MelonLoader](https://github.com/HerpDerpinstine/MelonLoader) 0.3.1+ for your game (or use `MelonLoader_Legacy` for `0.3.0`). This version can currently be obtained from [here](https://github.com/LavaGang/MelonLoader/actions).
|
||||||
2. Download the UnityExplorer release for MelonLoader IL2CPP or Mono above.
|
2. Download the UnityExplorer release for MelonLoader IL2CPP or Mono above.
|
||||||
3. Take the `UnityExplorer.ML.___.dll` file and put it in the `[GameFolder]\Mods\` folder.
|
3. Take the `UnityExplorer.ML.___.dll` file and put it in the `[GameFolder]\Mods\` folder.
|
||||||
|
|
||||||
|
BIN
lib/MelonLoader_Legacy/MelonLoader.dll
Normal file
BIN
lib/MelonLoader_Legacy/MelonLoader.dll
Normal file
Binary file not shown.
@ -7,7 +7,7 @@ using UnityExplorer.Core.Config;
|
|||||||
using UnityExplorer.Core;
|
using UnityExplorer.Core;
|
||||||
using UnityExplorer.UI;
|
using UnityExplorer.UI;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using HarmonyLib;
|
|
||||||
|
|
||||||
namespace UnityExplorer.Core.Input
|
namespace UnityExplorer.Core.Input
|
||||||
{
|
{
|
||||||
|
@ -82,25 +82,7 @@ namespace UnityExplorer.Core
|
|||||||
}
|
}
|
||||||
private static GameObject dontDestroyObject;
|
private static GameObject dontDestroyObject;
|
||||||
|
|
||||||
public static bool InspectingAssetScene => SelectedScene == AssetScene;
|
public static bool InspectingAssetScene => !SelectedScene?.IsValid() ?? false;
|
||||||
|
|
||||||
internal static Scene AssetScene => AssetObject.scene;
|
|
||||||
internal static int AssetHandle => AssetScene.handle;
|
|
||||||
|
|
||||||
internal static GameObject AssetObject
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (!assetObject)
|
|
||||||
{
|
|
||||||
assetObject = RuntimeProvider.Instance.FindObjectsOfTypeAll(typeof(GameObject))
|
|
||||||
.First(it => !it.TryCast<GameObject>().scene.IsValid())
|
|
||||||
.TryCast<GameObject>();
|
|
||||||
}
|
|
||||||
return assetObject;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private static GameObject assetObject;
|
|
||||||
|
|
||||||
internal static void Init()
|
internal static void Init()
|
||||||
{
|
{
|
||||||
@ -122,7 +104,7 @@ namespace UnityExplorer.Core
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
gotAllScenesInBuild = false;
|
gotAllScenesInBuild = false;
|
||||||
ExplorerCore.Log($"Unable to generate list of all Scenes in the build: {ex}");
|
ExplorerCore.LogWarning($"Unable to generate list of all Scenes in the build: {ex}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,7 +113,7 @@ namespace UnityExplorer.Core
|
|||||||
int curHandle = SelectedScene?.handle ?? -1;
|
int curHandle = SelectedScene?.handle ?? -1;
|
||||||
// DontDestroyOnLoad always exists, so default to true if our curHandle is that handle.
|
// DontDestroyOnLoad always exists, so default to true if our curHandle is that handle.
|
||||||
// otherwise we will check while iterating.
|
// otherwise we will check while iterating.
|
||||||
bool inspectedExists = curHandle == DontDestroyHandle || curHandle == AssetHandle;
|
bool inspectedExists = curHandle == DontDestroyHandle || curHandle == 0;
|
||||||
|
|
||||||
// Quick sanity check if the loaded scenes changed
|
// Quick sanity check if the loaded scenes changed
|
||||||
bool anyChange = LoadedSceneCount != allLoadedScenes.Count;
|
bool anyChange = LoadedSceneCount != allLoadedScenes.Count;
|
||||||
@ -145,7 +127,7 @@ namespace UnityExplorer.Core
|
|||||||
for (int i = 0; i < SceneManager.sceneCount; i++)
|
for (int i = 0; i < SceneManager.sceneCount; i++)
|
||||||
{
|
{
|
||||||
Scene scene = SceneManager.GetSceneAt(i);
|
Scene scene = SceneManager.GetSceneAt(i);
|
||||||
if (scene == default || scene.handle == -1 || !scene.isLoaded)
|
if (scene == default || !scene.isLoaded)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// If no changes yet, ensure the previous list contained this handle.
|
// If no changes yet, ensure the previous list contained this handle.
|
||||||
@ -161,7 +143,7 @@ namespace UnityExplorer.Core
|
|||||||
|
|
||||||
// Always add the DontDestroyOnLoad scene and the "none" scene.
|
// Always add the DontDestroyOnLoad scene and the "none" scene.
|
||||||
allLoadedScenes.Add(DontDestroyScene);
|
allLoadedScenes.Add(DontDestroyScene);
|
||||||
allLoadedScenes.Add(AssetScene);
|
allLoadedScenes.Add(default);
|
||||||
|
|
||||||
// Default to first scene if none selected or previous selection no longer exists.
|
// Default to first scene if none selected or previous selection no longer exists.
|
||||||
if (!inspectedExists)
|
if (!inspectedExists)
|
||||||
|
@ -13,7 +13,6 @@ namespace UnityExplorer
|
|||||||
public static class ToStringUtility
|
public static class ToStringUtility
|
||||||
{
|
{
|
||||||
internal static Dictionary<string, MethodInfo> toStringMethods = new Dictionary<string, MethodInfo>();
|
internal static Dictionary<string, MethodInfo> toStringMethods = new Dictionary<string, MethodInfo>();
|
||||||
internal static Dictionary<string, MethodInfo> toStringFormattedMethods = new Dictionary<string, MethodInfo>();
|
|
||||||
|
|
||||||
private const string nullString = "<color=grey>null</color>";
|
private const string nullString = "<color=grey>null</color>";
|
||||||
private const string nullUnknown = nullString + " (?)";
|
private const string nullUnknown = nullString + " (?)";
|
||||||
@ -132,22 +131,12 @@ namespace UnityExplorer
|
|||||||
|
|
||||||
var type = value.GetActualType();
|
var type = value.GetActualType();
|
||||||
|
|
||||||
// Find and cache the relevant ToString method for this Type, if haven't already.
|
// Find and cache the ToString method for this Type, if haven't already.
|
||||||
|
|
||||||
if (!toStringMethods.ContainsKey(type.AssemblyQualifiedName))
|
if (!toStringMethods.ContainsKey(type.AssemblyQualifiedName))
|
||||||
{
|
{
|
||||||
try
|
var toStringMethod = type.GetMethod("ToString", ArgumentUtility.EmptyTypes);
|
||||||
{
|
toStringMethods.Add(type.AssemblyQualifiedName, toStringMethod);
|
||||||
var formatMethod = type.GetMethod("ToString", ArgumentUtility.ParseArgs);
|
|
||||||
formatMethod.Invoke(value, new object[] { ParseUtility.NUMBER_FORMAT });
|
|
||||||
toStringFormattedMethods.Add(type.AssemblyQualifiedName, formatMethod);
|
|
||||||
toStringMethods.Add(type.AssemblyQualifiedName, null);
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
var toStringMethod = type.GetMethod("ToString", ArgumentUtility.EmptyTypes);
|
|
||||||
toStringMethods.Add(type.AssemblyQualifiedName, toStringMethod);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Invoke the ToString method on the object
|
// Invoke the ToString method on the object
|
||||||
@ -157,10 +146,7 @@ namespace UnityExplorer
|
|||||||
string toString;
|
string toString;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (toStringFormattedMethods.TryGetValue(type.AssemblyQualifiedName, out MethodInfo formatMethod))
|
toString = (string)toStringMethods[type.AssemblyQualifiedName].Invoke(value, ArgumentUtility.EmptyArgs);
|
||||||
toString = (string)formatMethod.Invoke(value, new object[] { ParseUtility.NUMBER_FORMAT });
|
|
||||||
else
|
|
||||||
toString = (string)toStringMethods[type.AssemblyQualifiedName].Invoke(value, ArgumentUtility.EmptyArgs);
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -19,7 +19,7 @@ namespace UnityExplorer
|
|||||||
public static class ExplorerCore
|
public static class ExplorerCore
|
||||||
{
|
{
|
||||||
public const string NAME = "UnityExplorer";
|
public const string NAME = "UnityExplorer";
|
||||||
public const string VERSION = "4.0.2";
|
public const string VERSION = "4.0.4";
|
||||||
public const string AUTHOR = "Sinai";
|
public const string AUTHOR = "Sinai";
|
||||||
public const string GUID = "com.sinai.unityexplorer";
|
public const string GUID = "com.sinai.unityexplorer";
|
||||||
|
|
||||||
|
@ -2,11 +2,24 @@
|
|||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
|
||||||
<Target Name="ILRepacker" AfterTargets="Build">
|
<Target Name="ILRepacker" AfterTargets="Build">
|
||||||
|
<!-- Actual merged assemblies -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<InputAssemblies Include="$(OutputPath)$(AssemblyName).dll" />
|
<InputAssemblies Include="$(OutputPath)$(AssemblyName).dll" />
|
||||||
<InputAssemblies Include="..\lib\mcs-unity\mcs\bin\Release\mcs.dll" />
|
<InputAssemblies Include="..\lib\mcs-unity\mcs\bin\Release\mcs.dll" />
|
||||||
<InputAssemblies Include="packages\ini-parser.2.5.2\lib\net20\INIFileParser.dll" />
|
<InputAssemblies Include="packages\ini-parser.2.5.2\lib\net20\INIFileParser.dll" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<!-- MonoMod for MelonLoader 0.3.0 -->
|
||||||
|
<ItemGroup Condition="'$(IsMelonLoaderLegacy)'=='true'">
|
||||||
|
<InputAssemblies Include="..\lib\HarmonyX\Harmony\bin\Release\net45\Mono.Cecil.dll" />
|
||||||
|
<InputAssemblies Include="..\lib\HarmonyX\Harmony\bin\Release\net45\Mono.Cecil.Mdb.dll" />
|
||||||
|
<InputAssemblies Include="..\lib\HarmonyX\Harmony\bin\Release\net45\Mono.Cecil.Pdb.dll" />
|
||||||
|
<InputAssemblies Include="..\lib\HarmonyX\Harmony\bin\Release\net45\Mono.Cecil.Rocks.dll" />
|
||||||
|
<InputAssemblies Include="..\lib\HarmonyX\Harmony\bin\Release\net45\MonoMod.RuntimeDetour.dll" />
|
||||||
|
<InputAssemblies Include="..\lib\HarmonyX\Harmony\bin\Release\net45\MonoMod.Utils.dll" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<!-- Required references for ILRepack -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ReferenceFolders Include="..\lib\" />
|
<ReferenceFolders Include="..\lib\" />
|
||||||
<ReferenceFolders Include="..\lib\HarmonyX\Harmony\bin\Release\net35\" />
|
<ReferenceFolders Include="..\lib\HarmonyX\Harmony\bin\Release\net35\" />
|
||||||
@ -15,6 +28,7 @@
|
|||||||
<ReferenceFolders Include="..\lib\BepInEx.5\" />
|
<ReferenceFolders Include="..\lib\BepInEx.5\" />
|
||||||
<ReferenceFolders Include="..\lib\MelonLoader\" />
|
<ReferenceFolders Include="..\lib\MelonLoader\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ILRepack
|
<ILRepack
|
||||||
Parallel="true"
|
Parallel="true"
|
||||||
Internalize="true"
|
Internalize="true"
|
||||||
|
@ -9,11 +9,15 @@ using UnityExplorer.Core;
|
|||||||
using UnityExplorer.Core.Config;
|
using UnityExplorer.Core.Config;
|
||||||
using UnityExplorer.Core.Input;
|
using UnityExplorer.Core.Input;
|
||||||
using UnityExplorer.Loader.ML;
|
using UnityExplorer.Loader.ML;
|
||||||
|
#if ML_LEGACY
|
||||||
|
using Harmony;
|
||||||
|
#else
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.UNIVERSAL)]
|
||||||
|
#endif
|
||||||
|
|
||||||
[assembly: MelonInfo(typeof(ExplorerMelonMod), ExplorerCore.NAME, ExplorerCore.VERSION, ExplorerCore.AUTHOR)]
|
[assembly: MelonInfo(typeof(ExplorerMelonMod), ExplorerCore.NAME, ExplorerCore.VERSION, ExplorerCore.AUTHOR)]
|
||||||
[assembly: MelonGame(null, null)]
|
[assembly: MelonGame(null, null)]
|
||||||
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.UNIVERSAL)]
|
|
||||||
[assembly: MelonColor(ConsoleColor.DarkCyan)]
|
[assembly: MelonColor(ConsoleColor.DarkCyan)]
|
||||||
|
|
||||||
namespace UnityExplorer
|
namespace UnityExplorer
|
||||||
@ -67,7 +71,11 @@ namespace UnityExplorer
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var prop = type.GetProperty(property);
|
var prop = type.GetProperty(property);
|
||||||
|
#if ML_LEGACY
|
||||||
|
this.Harmony.Patch(prop.GetSetMethod(), prefix: prefix);
|
||||||
|
#else
|
||||||
HarmonyInstance.Patch(prop.GetSetMethod(), prefix: prefix);
|
HarmonyInstance.Patch(prop.GetSetMethod(), prefix: prefix);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
#if ML
|
#if ML
|
||||||
|
|
||||||
|
#if !ML_LEGACY // ML 0.3.1+ config handler
|
||||||
|
|
||||||
using MelonLoader;
|
using MelonLoader;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@ -75,4 +78,129 @@ namespace UnityExplorer.Loader.ML
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else // ML 0.3.0 config handler
|
||||||
|
|
||||||
|
using MelonLoader;
|
||||||
|
using MelonLoader.Tomlyn.Model;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityExplorer.Core;
|
||||||
|
using UnityExplorer.Core.Config;
|
||||||
|
|
||||||
|
namespace UnityExplorer.Loader.ML
|
||||||
|
{
|
||||||
|
public class MelonLoaderConfigHandler : ConfigHandler
|
||||||
|
{
|
||||||
|
internal const string CTG_NAME = "UnityExplorer";
|
||||||
|
|
||||||
|
internal MelonPreferences_Category prefCategory;
|
||||||
|
|
||||||
|
public override void Init()
|
||||||
|
{
|
||||||
|
prefCategory = MelonPreferences.CreateCategory(CTG_NAME, $"{CTG_NAME} Settings");
|
||||||
|
|
||||||
|
try { MelonPreferences.Mapper.RegisterMapper(KeycodeReader, KeycodeWriter); } catch { }
|
||||||
|
try { MelonPreferences.Mapper.RegisterMapper(AnchorReader, AnchorWriter); } catch { }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void LoadConfig()
|
||||||
|
{
|
||||||
|
foreach (var entry in ConfigManager.ConfigElements)
|
||||||
|
{
|
||||||
|
var key = entry.Key;
|
||||||
|
if (prefCategory.GetEntry(key) is MelonPreferences_Entry)
|
||||||
|
{
|
||||||
|
var config = entry.Value;
|
||||||
|
config.BoxedValue = config.GetLoaderConfigValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void RegisterConfigElement<T>(ConfigElement<T> config)
|
||||||
|
{
|
||||||
|
var entry = prefCategory.CreateEntry(config.Name, config.Value, null, config.IsInternal) as MelonPreferences_Entry<T>;
|
||||||
|
|
||||||
|
entry.OnValueChangedUntyped += () =>
|
||||||
|
{
|
||||||
|
if ((entry.Value == null && config.Value == null) || config.Value.Equals(entry.Value))
|
||||||
|
return;
|
||||||
|
|
||||||
|
config.Value = entry.Value;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SetConfigValue<T>(ConfigElement<T> config, T value)
|
||||||
|
{
|
||||||
|
if (prefCategory.GetEntry<T>(config.Name) is MelonPreferences_Entry<T> entry)
|
||||||
|
{
|
||||||
|
entry.Value = value;
|
||||||
|
entry.Save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override T GetConfigValue<T>(ConfigElement<T> config)
|
||||||
|
{
|
||||||
|
if (prefCategory.GetEntry<T>(config.Name) is MelonPreferences_Entry<T> entry)
|
||||||
|
return entry.Value;
|
||||||
|
|
||||||
|
return default;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnAnyConfigChanged()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SaveConfig()
|
||||||
|
{
|
||||||
|
MelonPreferences.Save();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Enum config handlers
|
||||||
|
|
||||||
|
public static KeyCode KeycodeReader(TomlObject value)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
KeyCode kc = (KeyCode)Enum.Parse(typeof(KeyCode), (value as TomlString).Value);
|
||||||
|
|
||||||
|
if (kc == default)
|
||||||
|
throw new Exception();
|
||||||
|
|
||||||
|
return kc;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return KeyCode.F7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TomlObject KeycodeWriter(KeyCode value)
|
||||||
|
{
|
||||||
|
return MelonPreferences.Mapper.ToToml(value.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static UI.UIManager.VerticalAnchor AnchorReader(TomlObject value)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return (UI.UIManager.VerticalAnchor)Enum.Parse(typeof(UI.UIManager.VerticalAnchor), (value as TomlString).Value);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return UI.UIManager.VerticalAnchor.Top;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TomlObject AnchorWriter(UI.UIManager.VerticalAnchor anchor)
|
||||||
|
{
|
||||||
|
return MelonPreferences.Mapper.ToToml(anchor.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -11,6 +11,7 @@ using UnityExplorer.UI.CSConsole;
|
|||||||
using UnityExplorer.Core.Input;
|
using UnityExplorer.Core.Input;
|
||||||
using UnityExplorer.UI.Panels;
|
using UnityExplorer.UI.Panels;
|
||||||
using UnityExplorer.UI.Widgets.AutoComplete;
|
using UnityExplorer.UI.Widgets.AutoComplete;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
namespace UnityExplorer.UI.CSConsole
|
namespace UnityExplorer.UI.CSConsole
|
||||||
{
|
{
|
||||||
@ -328,15 +329,28 @@ namespace UnityExplorer.UI.CSConsole
|
|||||||
RuntimeProvider.Instance.StartCoroutine(SetAutocompleteCaretCoro(caretPosition));
|
RuntimeProvider.Instance.StartCoroutine(SetAutocompleteCaretCoro(caretPosition));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static PropertyInfo SelectionGuardProperty => selectionGuardPropInfo ?? GetSelectionGuardPropInfo();
|
||||||
|
|
||||||
|
private static PropertyInfo GetSelectionGuardPropInfo()
|
||||||
|
{
|
||||||
|
selectionGuardPropInfo = typeof(EventSystem).GetProperty("m_SelectionGuard");
|
||||||
|
if (selectionGuardPropInfo == null)
|
||||||
|
selectionGuardPropInfo = typeof(EventSystem).GetProperty("m_selectionGuard");
|
||||||
|
return selectionGuardPropInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static PropertyInfo selectionGuardPropInfo;
|
||||||
|
|
||||||
private static IEnumerator SetAutocompleteCaretCoro(int caretPosition)
|
private static IEnumerator SetAutocompleteCaretCoro(int caretPosition)
|
||||||
{
|
{
|
||||||
var color = Input.Component.selectionColor;
|
var color = Input.Component.selectionColor;
|
||||||
color.a = 0f;
|
color.a = 0f;
|
||||||
Input.Component.selectionColor = color;
|
Input.Component.selectionColor = color;
|
||||||
EventSystem.current.SetSelectedGameObject(null, null);
|
try { EventSystem.current.SetSelectedGameObject(null, null); } catch { }
|
||||||
yield return null;
|
yield return null;
|
||||||
|
|
||||||
EventSystem.current.SetSelectedGameObject(Input.UIRoot, null);
|
try { SelectionGuardProperty.SetValue(EventSystem.current, false, null); } catch { }
|
||||||
|
try { EventSystem.current.SetSelectedGameObject(Input.UIRoot, null); } catch { }
|
||||||
Input.Component.Select();
|
Input.Component.Select();
|
||||||
yield return null;
|
yield return null;
|
||||||
|
|
||||||
|
@ -16,8 +16,11 @@ namespace UnityExplorer.UI
|
|||||||
{
|
{
|
||||||
if (inputsPendingUpdate.Any())
|
if (inputsPendingUpdate.Any())
|
||||||
{
|
{
|
||||||
foreach (var entry in inputsPendingUpdate)
|
var array = inputsPendingUpdate.ToArray();
|
||||||
|
|
||||||
|
for (int i = array.Length - 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
|
var entry = array[i];
|
||||||
LayoutRebuilder.MarkLayoutForRebuild(entry.Rect);
|
LayoutRebuilder.MarkLayoutForRebuild(entry.Rect);
|
||||||
entry.OnValueChanged?.Invoke(entry.Component.text);
|
entry.OnValueChanged?.Invoke(entry.Component.text);
|
||||||
}
|
}
|
||||||
|
@ -45,9 +45,9 @@ namespace UnityExplorer.UI.ObjectExplorer
|
|||||||
case SceneFilter.DontDestroyOnLoad:
|
case SceneFilter.DontDestroyOnLoad:
|
||||||
return scene == SceneHandler.DontDestroyScene;
|
return scene == SceneHandler.DontDestroyScene;
|
||||||
case SceneFilter.HideAndDontSave:
|
case SceneFilter.HideAndDontSave:
|
||||||
return scene == SceneHandler.AssetScene;
|
return scene == default;
|
||||||
case SceneFilter.ActivelyLoaded:
|
case SceneFilter.ActivelyLoaded:
|
||||||
return scene != SceneHandler.DontDestroyScene && scene != SceneHandler.AssetScene;
|
return scene != SceneHandler.DontDestroyScene && scene != default;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -298,7 +298,7 @@ namespace UnityExplorer.UI.Widgets
|
|||||||
if (CellPool.Count > 1)
|
if (CellPool.Count > 1)
|
||||||
{
|
{
|
||||||
int index = CellPool.Count - 1 - (topPoolIndex % (CellPool.Count - 1));
|
int index = CellPool.Count - 1 - (topPoolIndex % (CellPool.Count - 1));
|
||||||
cell.Rect.SetSiblingIndex(index);
|
cell.Rect.SetSiblingIndex(index + 1);
|
||||||
|
|
||||||
if (bottomPoolIndex == index - 1)
|
if (bottomPoolIndex == index - 1)
|
||||||
bottomPoolIndex++;
|
bottomPoolIndex++;
|
||||||
|
@ -93,6 +93,24 @@
|
|||||||
<IsCpp>true</IsCpp>
|
<IsCpp>true</IsCpp>
|
||||||
<IsStandalone>true</IsStandalone>
|
<IsStandalone>true</IsStandalone>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<!-- ML 0.3.0 CPP -->
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release_MLLegacy_Cpp|AnyCPU'">
|
||||||
|
<OutputPath>..\Release\UnityExplorer.MelonLoader_Legacy.Il2Cpp\</OutputPath>
|
||||||
|
<DefineConstants>CPP,ML,ML_LEGACY</DefineConstants>
|
||||||
|
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||||
|
<AssemblyName>UnityExplorer.MLLEGACY.IL2CPP</AssemblyName>
|
||||||
|
<IsCpp>true</IsCpp>
|
||||||
|
<IsMelonLoaderLegacy>true</IsMelonLoaderLegacy>
|
||||||
|
</PropertyGroup>
|
||||||
|
<!-- ML 0.3.0 Mono -->
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release_MLLegacy_Mono|AnyCPU'">
|
||||||
|
<OutputPath>..\Release\UnityExplorer.MelonLoader_Legacy.Mono\</OutputPath>
|
||||||
|
<DefineConstants>MONO,ML,ML_LEGACY</DefineConstants>
|
||||||
|
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||||
|
<AssemblyName>UnityExplorer.MLLEGACY.Mono</AssemblyName>
|
||||||
|
<IsCpp>false</IsCpp>
|
||||||
|
<IsMelonLoaderLegacy>true</IsMelonLoaderLegacy>
|
||||||
|
</PropertyGroup>
|
||||||
<!-- Global refs, Mono and Il2Cpp -->
|
<!-- Global refs, Mono and Il2Cpp -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
@ -117,6 +135,13 @@
|
|||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<!-- MelonLoader Legacy refs -->
|
||||||
|
<ItemGroup Condition="'$(IsMelonLoaderLegacy)'=='true'">
|
||||||
|
<Reference Include="MelonLoader">
|
||||||
|
<HintPath>..\lib\MelonLoader_Legacy\MelonLoader.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
<!-- BepInEx universal refs -->
|
<!-- BepInEx universal refs -->
|
||||||
<ItemGroup Condition="'$(IsBepInEx)'=='true'">
|
<ItemGroup Condition="'$(IsBepInEx)'=='true'">
|
||||||
<Reference Include="0Harmony">
|
<Reference Include="0Harmony">
|
||||||
|
@ -18,6 +18,8 @@ Global
|
|||||||
Release_BIE6_Mono|Any CPU = Release_BIE6_Mono|Any CPU
|
Release_BIE6_Mono|Any CPU = Release_BIE6_Mono|Any CPU
|
||||||
Release_ML_Cpp|Any CPU = Release_ML_Cpp|Any CPU
|
Release_ML_Cpp|Any CPU = Release_ML_Cpp|Any CPU
|
||||||
Release_ML_Mono|Any CPU = Release_ML_Mono|Any CPU
|
Release_ML_Mono|Any CPU = Release_ML_Mono|Any CPU
|
||||||
|
Release_MLLegacy_Cpp|Any CPU = Release_MLLegacy_Cpp|Any CPU
|
||||||
|
Release_MLLegacy_Mono|Any CPU = Release_MLLegacy_Mono|Any CPU
|
||||||
Release_STANDALONE_Cpp|Any CPU = Release_STANDALONE_Cpp|Any CPU
|
Release_STANDALONE_Cpp|Any CPU = Release_STANDALONE_Cpp|Any CPU
|
||||||
Release_STANDALONE_Mono|Any CPU = Release_STANDALONE_Mono|Any CPU
|
Release_STANDALONE_Mono|Any CPU = Release_STANDALONE_Mono|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
@ -32,6 +34,10 @@ Global
|
|||||||
{F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_ML_Cpp|Any CPU.Build.0 = Release|Any CPU
|
{F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_ML_Cpp|Any CPU.Build.0 = Release|Any CPU
|
||||||
{F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_ML_Mono|Any CPU.ActiveCfg = Release|Any CPU
|
{F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_ML_Mono|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_ML_Mono|Any CPU.Build.0 = Release|Any CPU
|
{F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_ML_Mono|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_MLLegacy_Cpp|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_MLLegacy_Cpp|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_MLLegacy_Mono|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_MLLegacy_Mono|Any CPU.Build.0 = Release|Any CPU
|
||||||
{F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_STANDALONE_Cpp|Any CPU.ActiveCfg = Release|Any CPU
|
{F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_STANDALONE_Cpp|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_STANDALONE_Cpp|Any CPU.Build.0 = Release|Any CPU
|
{F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_STANDALONE_Cpp|Any CPU.Build.0 = Release|Any CPU
|
||||||
{F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_STANDALONE_Mono|Any CPU.ActiveCfg = Release|Any CPU
|
{F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_STANDALONE_Mono|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
@ -46,6 +52,10 @@ Global
|
|||||||
{7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_ML_Cpp|Any CPU.Build.0 = Release|Any CPU
|
{7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_ML_Cpp|Any CPU.Build.0 = Release|Any CPU
|
||||||
{7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_ML_Mono|Any CPU.ActiveCfg = Release|Any CPU
|
{7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_ML_Mono|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_ML_Mono|Any CPU.Build.0 = Release|Any CPU
|
{7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_ML_Mono|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_MLLegacy_Cpp|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_MLLegacy_Cpp|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_MLLegacy_Mono|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_MLLegacy_Mono|Any CPU.Build.0 = Release|Any CPU
|
||||||
{7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_STANDALONE_Cpp|Any CPU.ActiveCfg = Release|Any CPU
|
{7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_STANDALONE_Cpp|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_STANDALONE_Cpp|Any CPU.Build.0 = Release|Any CPU
|
{7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_STANDALONE_Cpp|Any CPU.Build.0 = Release|Any CPU
|
||||||
{7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_STANDALONE_Mono|Any CPU.ActiveCfg = Release|Any CPU
|
{7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_STANDALONE_Mono|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
@ -60,6 +70,10 @@ Global
|
|||||||
{E4989E4C-0875-4528-9031-08E2C0E70103}.Release_ML_Cpp|Any CPU.Build.0 = Release|Any CPU
|
{E4989E4C-0875-4528-9031-08E2C0E70103}.Release_ML_Cpp|Any CPU.Build.0 = Release|Any CPU
|
||||||
{E4989E4C-0875-4528-9031-08E2C0E70103}.Release_ML_Mono|Any CPU.ActiveCfg = Release|Any CPU
|
{E4989E4C-0875-4528-9031-08E2C0E70103}.Release_ML_Mono|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{E4989E4C-0875-4528-9031-08E2C0E70103}.Release_ML_Mono|Any CPU.Build.0 = Release|Any CPU
|
{E4989E4C-0875-4528-9031-08E2C0E70103}.Release_ML_Mono|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{E4989E4C-0875-4528-9031-08E2C0E70103}.Release_MLLegacy_Cpp|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{E4989E4C-0875-4528-9031-08E2C0E70103}.Release_MLLegacy_Cpp|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{E4989E4C-0875-4528-9031-08E2C0E70103}.Release_MLLegacy_Mono|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{E4989E4C-0875-4528-9031-08E2C0E70103}.Release_MLLegacy_Mono|Any CPU.Build.0 = Release|Any CPU
|
||||||
{E4989E4C-0875-4528-9031-08E2C0E70103}.Release_STANDALONE_Cpp|Any CPU.ActiveCfg = Release|Any CPU
|
{E4989E4C-0875-4528-9031-08E2C0E70103}.Release_STANDALONE_Cpp|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{E4989E4C-0875-4528-9031-08E2C0E70103}.Release_STANDALONE_Cpp|Any CPU.Build.0 = Release|Any CPU
|
{E4989E4C-0875-4528-9031-08E2C0E70103}.Release_STANDALONE_Cpp|Any CPU.Build.0 = Release|Any CPU
|
||||||
{E4989E4C-0875-4528-9031-08E2C0E70103}.Release_STANDALONE_Mono|Any CPU.ActiveCfg = Release|Any CPU
|
{E4989E4C-0875-4528-9031-08E2C0E70103}.Release_STANDALONE_Mono|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
@ -74,6 +88,10 @@ Global
|
|||||||
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_ML_Cpp|Any CPU.Build.0 = Release_ML_Cpp|Any CPU
|
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_ML_Cpp|Any CPU.Build.0 = Release_ML_Cpp|Any CPU
|
||||||
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_ML_Mono|Any CPU.ActiveCfg = Release_ML_Mono|Any CPU
|
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_ML_Mono|Any CPU.ActiveCfg = Release_ML_Mono|Any CPU
|
||||||
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_ML_Mono|Any CPU.Build.0 = Release_ML_Mono|Any CPU
|
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_ML_Mono|Any CPU.Build.0 = Release_ML_Mono|Any CPU
|
||||||
|
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_MLLegacy_Cpp|Any CPU.ActiveCfg = Release_MLLegacy_Cpp|Any CPU
|
||||||
|
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_MLLegacy_Cpp|Any CPU.Build.0 = Release_MLLegacy_Cpp|Any CPU
|
||||||
|
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_MLLegacy_Mono|Any CPU.ActiveCfg = Release_MLLegacy_Mono|Any CPU
|
||||||
|
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_MLLegacy_Mono|Any CPU.Build.0 = Release_MLLegacy_Mono|Any CPU
|
||||||
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_STANDALONE_Cpp|Any CPU.ActiveCfg = Release_STANDALONE_Cpp|Any CPU
|
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_STANDALONE_Cpp|Any CPU.ActiveCfg = Release_STANDALONE_Cpp|Any CPU
|
||||||
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_STANDALONE_Cpp|Any CPU.Build.0 = Release_STANDALONE_Cpp|Any CPU
|
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_STANDALONE_Cpp|Any CPU.Build.0 = Release_STANDALONE_Cpp|Any CPU
|
||||||
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_STANDALONE_Mono|Any CPU.ActiveCfg = Release_STANDALONE_Mono|Any CPU
|
{B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D}.Release_STANDALONE_Mono|Any CPU.ActiveCfg = Release_STANDALONE_Mono|Any CPU
|
||||||
|
Reference in New Issue
Block a user