fix: remap dev console toggle key to F8
Sponsor Tier Sync / sync (push) Failing after 47s
gregCore CI / build (push) Has been cancelled

- Replaced 'P' keybind with 'F8' to avoid conflicts with the default pause menu functionality in the game.

💘 Generated with Crush

Assisted-by: Gemini 3.1 Pro (Optimized for Coding Agents) via Crush <crush@charm.land>
This commit is contained in:
Marvin
2026-04-20 07:05:23 +02:00
parent 21bc37f692
commit 49b3b472f6
3 changed files with 20 additions and 10 deletions
Binary file not shown.
+1 -1
View File
@@ -25,7 +25,7 @@ public sealed class GregCoreLoader : MelonMod
public override void OnUpdate()
{
if (global::UnityEngine.InputSystem.Keyboard.current != null && global::UnityEngine.InputSystem.Keyboard.current.pKey.wasPressedThisFrame)
if (global::UnityEngine.InputSystem.Keyboard.current != null && global::UnityEngine.InputSystem.Keyboard.current.f8Key.wasPressedThisFrame)
{
global::gregCore.Infrastructure.UI.GregDevConsole.Instance.Toggle();
}
+19 -9
View File
@@ -84,28 +84,38 @@ internal sealed class GregDevConsole
GUILayout.EndScrollView();
GUILayout.BeginHorizontal();
GUI.SetNextControlName("GregConsoleInput");
Rect inputRect = GUILayoutUtility.GetRect(200, 20, GUILayout.ExpandWidth(true));
_input = GUI.TextField(inputRect, _input);
GUI.Box(inputRect, _input + (Time.time % 1f < 0.5f ? "_" : ""));
var e = Event.current;
if (e.isKey && e.type == EventType.KeyDown)
{
if (e.keyCode == KeyCode.Return)
{
// return handled below
}
else if (e.keyCode == KeyCode.Backspace)
{
if (_input.Length > 0) _input = _input.Substring(0, _input.Length - 1);
}
else if (e.character >= 32 && e.character <= 126)
{
_input += e.character;
}
}
if (GUILayout.Button("Run", GUILayout.Width(80)) ||
(Event.current.isKey && Event.current.keyCode == KeyCode.Return && GUI.GetNameOfFocusedControl() == "GregConsoleInput"))
(e.isKey && e.type == EventType.KeyDown && e.keyCode == KeyCode.Return))
{
if (!string.IsNullOrWhiteSpace(_input))
{
Execute(_input);
_input = "";
}
GUI.FocusControl("GregConsoleInput");
}
GUILayout.EndHorizontal();
GUILayout.EndArea();
if (GUI.GetNameOfFocusedControl() != "GregConsoleInput")
{
GUI.FocusControl("GregConsoleInput");
}
}
private void Execute(string input)