Compare commits

..

5 Commits

Author SHA1 Message Date
1c5306b7c8 Fix the onValueChange throttling affecting internal features 2021-05-03 00:59:39 +10:00
ea1e183c4a Fix onValueChanged bursts 2021-05-01 16:32:11 +10:00
8080129d58 Merge branch 'master' of https://github.com/sinai-dev/Explorer 2021-04-30 00:12:48 +10:00
4b8298fd2e Update CursorUnlocker.cs 2021-04-30 00:12:41 +10:00
ad055b4383 Update README.md 2021-04-29 21:54:13 +10:00
4 changed files with 30 additions and 25 deletions

View File

@ -6,6 +6,10 @@
An in-game explorer and a suite of debugging tools for <a href="https://docs.unity3d.com/Manual/IL2CPP.html">IL2CPP</a> and <b>Mono</b> Unity games, to aid with modding development.
</p>
<p align="center">
Supports most Unity games from versions 5.2 to 2020+.
</p>
## Releases [![](https://img.shields.io/github/release/sinai-dev/UnityExplorer.svg?label=release%20notes)](../../releases/latest) [![](https://img.shields.io/github/downloads/sinai-dev/UnityExplorer/total.svg)](../../releases) [![](https://img.shields.io/github/downloads/sinai-dev/UnityExplorer/latest/total.svg)](../../releases/latest)
| Mod Loader | IL2CPP | Mono |

View File

@ -62,7 +62,7 @@ namespace UnityExplorer.Core.Input
}
catch (Exception ex)
{
ExplorerCore.LogWarning($"Exception setting up Camera.onPostRender callback: {ex}");
ExplorerCore.LogWarning($"Exception setting up Aggressive Mouse Unlock: {ex}");
}
}
@ -72,9 +72,7 @@ namespace UnityExplorer.Core.Input
{
while (true)
{
ExplorerCore.Log("Yielding end of frame");
yield return _waitForEndOfFrame;
ExplorerCore.Log("Yielded");
if (UIManager.ShowMenu)
UpdateCursorControl();

View File

@ -14,7 +14,7 @@ namespace UnityExplorer
public class ExplorerCore
{
public const string NAME = "UnityExplorer";
public const string VERSION = "3.3.13";
public const string VERSION = "3.3.15";
public const string AUTHOR = "Sinai";
public const string GUID = "com.sinai.unityexplorer";

View File

@ -199,23 +199,10 @@ The following helper methods are available:
InputField.onValueChanged.AddListener((string s) => { OnInputChanged(s); });
}
internal static bool IsUserCopyPasting()
{
return (InputManager.GetKey(KeyCode.LeftControl) || InputManager.GetKey(KeyCode.RightControl))
&& InputManager.GetKeyDown(KeyCode.V);
}
public void UpdateConsole()
{
if (s_copyPasteBuffer != null)
{
if (!IsUserCopyPasting())
{
OnInputChanged(s_copyPasteBuffer);
s_copyPasteBuffer = null;
}
}
if (Time.time > s_timeOfLastInternalSet)
Writing = false;
if (EnableCtrlRShortcut)
{
@ -274,6 +261,8 @@ The following helper methods are available:
public void UseAutocomplete(string suggestion)
{
Writing = true;
string input = InputField.text;
input = input.Insert(m_lastCaretPos, suggestion);
InputField.text = input;
@ -288,20 +277,32 @@ The following helper methods are available:
AutoCompleter.ClearAutocompletes();
}
internal static string s_copyPasteBuffer;
private static float s_timeOfLastUpdate;
private static bool Writing
{
get => s_writing;
set
{
if (value)
s_timeOfLastInternalSet = Time.time;
s_writing = value;
}
}
private static bool s_writing;
private static float s_timeOfLastInternalSet;
public void OnInputChanged(string newText, bool forceUpdate = false)
{
if (IsUserCopyPasting())
{
//Console.WriteLine("Copy+Paste detected!");
s_copyPasteBuffer = newText;
if (!Writing && Time.time <= s_timeOfLastUpdate)
return;
}
s_timeOfLastUpdate = Time.time;
if (EnableAutoIndent)
UpdateIndent(newText);
Writing = true;
if (!forceUpdate && string.IsNullOrEmpty(newText))
inputHighlightText.text = string.Empty;
else
@ -378,6 +379,8 @@ The following helper methods are available:
private void AutoIndentCaret()
{
Writing = true;
if (CurrentIndent > 0)
{
string indent = GetAutoIndentTab(CurrentIndent);