mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-15 13:57:31 +08:00
3.3.3
* Fix `Hide on Startup` not working * Fix for cases when we try to `scene.GetRootGameObjects()` but the scene has not yet fully loaded. * MelonLoader releases will no longer spam "Preferences Saved!" constantly in the Console log * Fix mistake with UI Event System setting/releasing * Fix some UI elements not having correct Color transition values
This commit is contained in:
parent
8f025622b4
commit
d070ded036
28
README.md
28
README.md
@ -38,6 +38,34 @@ The standalone release is based on the BepInEx build, so it requires Harmony 2.0
|
|||||||
1. Create an instance of Unity Explorer with `UnityExplorer.ExplorerStandalone.CreateInstance();`
|
1. Create an instance of Unity Explorer with `UnityExplorer.ExplorerStandalone.CreateInstance();`
|
||||||
2. Optionally subscribe to the `ExplorerStandalone.OnLog` event to handle logging if you wish.
|
2. Optionally subscribe to the `ExplorerStandalone.OnLog` event to handle logging if you wish.
|
||||||
|
|
||||||
|
## Issues and contributions
|
||||||
|
|
||||||
|
Both issue reports and PR contributions are welcome in this repository.
|
||||||
|
|
||||||
|
### Issue reporting
|
||||||
|
|
||||||
|
To report an issue with UnityExplorer, please use the following template (as well as any other information / images you can provide).
|
||||||
|
|
||||||
|
Please upload the required log files on [Pastebin](https://pastebin.com/) and include a link to your paste:
|
||||||
|
|
||||||
|
* All reports: Unity's `output_log.txt` or `Player.log`, should be found at `%userprofile%\AppData\LocalLow\[Company]\[Game]\` unless redirected.
|
||||||
|
* BepInEx: `BepInEx\LogOutput.log`
|
||||||
|
* MelonLoader: `MelonLoader\Latest.log`
|
||||||
|
|
||||||
|
Template:
|
||||||
|
|
||||||
|
```
|
||||||
|
* OS Platform:
|
||||||
|
* Display resolution:
|
||||||
|
* Game(s) tested on:
|
||||||
|
* UnityExplorer version(s) tested:
|
||||||
|
|
||||||
|
* Description of issue:
|
||||||
|
|
||||||
|
* Unity log pastebin link:
|
||||||
|
* Mod Loader log pastebin link:
|
||||||
|
```
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityExplorer.UI.Main;
|
using UnityExplorer.UI.Main;
|
||||||
@ -45,6 +46,8 @@ namespace UnityExplorer.Core.Config
|
|||||||
PanelDragger.OnFinishDrag += PanelDragger_OnFinishDrag;
|
PanelDragger.OnFinishDrag += PanelDragger_OnFinishDrag;
|
||||||
MainMenu.OnActiveTabChanged += MainMenu_OnActiveTabChanged;
|
MainMenu.OnActiveTabChanged += MainMenu_OnActiveTabChanged;
|
||||||
DebugConsole.OnToggleShow += DebugConsole_OnToggleShow;
|
DebugConsole.OnToggleShow += DebugConsole_OnToggleShow;
|
||||||
|
|
||||||
|
InitConsoleCallback();
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void RegisterConfigElement<T>(ConfigElement<T> configElement)
|
internal static void RegisterConfigElement<T>(ConfigElement<T> configElement)
|
||||||
@ -134,6 +137,33 @@ namespace UnityExplorer.Core.Config
|
|||||||
Last_SceneExplorer_State.Value = showing;
|
Last_SceneExplorer_State.Value = showing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region CONSOLE ONEXIT CALLBACK
|
||||||
|
|
||||||
|
internal static void InitConsoleCallback()
|
||||||
|
{
|
||||||
|
handler = new ConsoleEventDelegate(ConsoleEventCallback);
|
||||||
|
SetConsoleCtrlHandler(handler, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool ConsoleEventCallback(int eventType)
|
||||||
|
{
|
||||||
|
// 2 is Console Quit
|
||||||
|
if (eventType == 2)
|
||||||
|
Handler.SaveConfig();
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static ConsoleEventDelegate handler;
|
||||||
|
private delegate bool ConsoleEventDelegate(int eventType);
|
||||||
|
|
||||||
|
[DllImport("kernel32.dll", SetLastError = true)]
|
||||||
|
private static extern bool SetConsoleCtrlHandler(ConsoleEventDelegate callback, bool add);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region WINDOW ANCHORS / POSITION HELPERS
|
||||||
|
|
||||||
// Window Anchors helpers
|
// Window Anchors helpers
|
||||||
|
|
||||||
private const string DEFAULT_WINDOW_ANCHORS = "0.25,0.10,0.78,0.95";
|
private const string DEFAULT_WINDOW_ANCHORS = "0.25,0.10,0.78,0.95";
|
||||||
@ -210,5 +240,7 @@ namespace UnityExplorer.Core.Config
|
|||||||
//ExplorerCore.LogWarning("Exception setting window position: " + ex);
|
//ExplorerCore.LogWarning("Exception setting window position: " + ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,11 +125,17 @@ namespace UnityExplorer.Core.Input
|
|||||||
{
|
{
|
||||||
Cursor.lockState = CursorLockMode.None;
|
Cursor.lockState = CursorLockMode.None;
|
||||||
Cursor.visible = true;
|
Cursor.visible = true;
|
||||||
|
|
||||||
|
if (UIManager.EventSys)
|
||||||
|
SetEventSystem();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Cursor.lockState = m_lastLockMode;
|
Cursor.lockState = m_lastLockMode;
|
||||||
Cursor.visible = m_lastVisibleState;
|
Cursor.visible = m_lastVisibleState;
|
||||||
|
|
||||||
|
if (UIManager.EventSys)
|
||||||
|
ReleaseEventSystem();
|
||||||
}
|
}
|
||||||
m_currentlySettingCursor = false;
|
m_currentlySettingCursor = false;
|
||||||
}
|
}
|
||||||
|
@ -89,10 +89,13 @@ namespace UnityExplorer.Core.Runtime.Il2Cpp
|
|||||||
|
|
||||||
internal delegate void d_GetRootGameObjects(int handle, IntPtr list);
|
internal delegate void d_GetRootGameObjects(int handle, IntPtr list);
|
||||||
|
|
||||||
public override GameObject[] GetRootGameObjects(Scene scene) => GetRootGameObjects(scene.handle);
|
public override GameObject[] GetRootGameObjects(Scene scene)
|
||||||
|
|
||||||
public static GameObject[] GetRootGameObjects(int handle)
|
|
||||||
{
|
{
|
||||||
|
if (!scene.isLoaded)
|
||||||
|
return new GameObject[0];
|
||||||
|
|
||||||
|
int handle = scene.handle;
|
||||||
|
|
||||||
if (handle == -1)
|
if (handle == -1)
|
||||||
return new GameObject[0];
|
return new GameObject[0];
|
||||||
|
|
||||||
|
@ -52,6 +52,9 @@ namespace UnityExplorer.Core.Runtime.Mono
|
|||||||
|
|
||||||
public override GameObject[] GetRootGameObjects(Scene scene)
|
public override GameObject[] GetRootGameObjects(Scene scene)
|
||||||
{
|
{
|
||||||
|
if (!scene.isLoaded)
|
||||||
|
return new GameObject[0];
|
||||||
|
|
||||||
return scene.GetRootGameObjects();
|
return scene.GetRootGameObjects();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ namespace UnityExplorer
|
|||||||
public class ExplorerCore
|
public class ExplorerCore
|
||||||
{
|
{
|
||||||
public const string NAME = "UnityExplorer";
|
public const string NAME = "UnityExplorer";
|
||||||
public const string VERSION = "3.3.2";
|
public const string VERSION = "3.3.3";
|
||||||
public const string AUTHOR = "Sinai";
|
public const string AUTHOR = "Sinai";
|
||||||
public const string GUID = "com.sinai.unityexplorer";
|
public const string GUID = "com.sinai.unityexplorer";
|
||||||
|
|
||||||
|
@ -69,7 +69,6 @@ namespace UnityExplorer.Loader.ML
|
|||||||
|
|
||||||
public override void OnAnyConfigChanged()
|
public override void OnAnyConfigChanged()
|
||||||
{
|
{
|
||||||
MelonPreferences.Save();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SaveConfig()
|
public override void SaveConfig()
|
||||||
|
@ -169,7 +169,7 @@ namespace UnityExplorer.UI.Main.Home.Inspectors.GameObjects
|
|||||||
toggle.onValueChanged.AddListener((bool val) => { OnToggleClicked(thisIndex, val); });
|
toggle.onValueChanged.AddListener((bool val) => { OnToggleClicked(thisIndex, val); });
|
||||||
|
|
||||||
ColorBlock mainColors = new ColorBlock();
|
ColorBlock mainColors = new ColorBlock();
|
||||||
RuntimeProvider.Instance.SetColorBlock(mainColors, new Color(0.07f, 0.07f, 0.07f),
|
mainColors = RuntimeProvider.Instance.SetColorBlock(mainColors, new Color(0.07f, 0.07f, 0.07f),
|
||||||
new Color(0.2f, 0.2f, 0.2f, 1), new Color(0.05f, 0.05f, 0.05f));
|
new Color(0.2f, 0.2f, 0.2f, 1), new Color(0.05f, 0.05f, 0.05f));
|
||||||
|
|
||||||
var mainBtn = UIFactory.CreateButton(btnGroupObj,
|
var mainBtn = UIFactory.CreateButton(btnGroupObj,
|
||||||
|
@ -176,7 +176,7 @@ namespace UnityExplorer.UI.Main.Home.Inspectors.GameObjects
|
|||||||
// Main component button
|
// Main component button
|
||||||
|
|
||||||
ColorBlock mainColors = new ColorBlock();
|
ColorBlock mainColors = new ColorBlock();
|
||||||
RuntimeProvider.Instance.SetColorBlock(mainColors, new Color(0.07f, 0.07f, 0.07f),
|
mainColors = RuntimeProvider.Instance.SetColorBlock(mainColors, new Color(0.07f, 0.07f, 0.07f),
|
||||||
new Color(0.2f, 0.2f, 0.2f, 1), new Color(0.05f, 0.05f, 0.05f));
|
new Color(0.2f, 0.2f, 0.2f, 1), new Color(0.05f, 0.05f, 0.05f));
|
||||||
|
|
||||||
var mainBtn = UIFactory.CreateButton(groupObj,
|
var mainBtn = UIFactory.CreateButton(groupObj,
|
||||||
|
@ -180,7 +180,7 @@ namespace UnityExplorer.UI.Main
|
|||||||
// Hide button
|
// Hide button
|
||||||
|
|
||||||
ColorBlock colorBlock = new ColorBlock();
|
ColorBlock colorBlock = new ColorBlock();
|
||||||
RuntimeProvider.Instance.SetColorBlock(colorBlock, new Color(65f / 255f, 23f / 255f, 23f / 255f),
|
colorBlock = RuntimeProvider.Instance.SetColorBlock(colorBlock, new Color(65f / 255f, 23f / 255f, 23f / 255f),
|
||||||
new Color(35f / 255f, 10f / 255f, 10f / 255f), new Color(156f / 255f, 0f, 0f));
|
new Color(35f / 255f, 10f / 255f, 10f / 255f), new Color(156f / 255f, 0f, 0f));
|
||||||
|
|
||||||
var hideButton = UIFactory.CreateButton(titleBar,
|
var hideButton = UIFactory.CreateButton(titleBar,
|
||||||
|
@ -53,8 +53,7 @@ namespace UnityExplorer.UI
|
|||||||
// Force refresh of anchors etc
|
// Force refresh of anchors etc
|
||||||
Canvas.ForceUpdateCanvases();
|
Canvas.ForceUpdateCanvases();
|
||||||
|
|
||||||
if (!ConfigManager.Hide_On_Startup.Value)
|
ShowMenu = !ConfigManager.Hide_On_Startup.Value;
|
||||||
ShowMenu = true;
|
|
||||||
|
|
||||||
ExplorerCore.Log("UI initialized.");
|
ExplorerCore.Log("UI initialized.");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user