From 7327f073d8589760c7d7198baa5e5901d750fae2 Mon Sep 17 00:00:00 2001 From: kerboul Date: Sun, 17 May 2026 20:53:07 +0200 Subject: [PATCH] fix: remapper F1/F2/F3 -> backtick/Tab/T pour compatibilite WebGL navigateur - DebugNetworkUI: F1 -> backtick (`) - KeyBindingUI: F2 -> Tab - ChatUI: F3 -> T (ouvrir seulement), Escape pour fermer Co-Authored-By: Claude Sonnet 4.6 --- game/Assets/Scripts/KeyBindingUI.cs | 7 +++---- game/Assets/Scripts/Network/DebugNetworkUI.cs | 6 +++--- game/Assets/Scripts/UI/ChatUI.cs | 13 +++++++++---- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/game/Assets/Scripts/KeyBindingUI.cs b/game/Assets/Scripts/KeyBindingUI.cs index d9c841d..8062bc8 100644 --- a/game/Assets/Scripts/KeyBindingUI.cs +++ b/game/Assets/Scripts/KeyBindingUI.cs @@ -47,7 +47,7 @@ public class KeyBindingUI : MonoBehaviour void Update() { - if (Keyboard.current != null && Keyboard.current[Key.F2].wasPressedThisFrame) + if (Keyboard.current != null && Keyboard.current[Key.Tab].wasPressedThisFrame) { _visible = !_visible; IsVisible = _visible; @@ -132,7 +132,7 @@ public class KeyBindingUI : MonoBehaviour GUILayout.BeginHorizontal(); if (GUILayout.Button("Réinitialiser tout", ImGuiSkin.Button, GUILayout.Height(32))) ResetAllBindings(); - if (GUILayout.Button("Fermer (F2)", ImGuiSkin.Button, GUILayout.Height(32))) + if (GUILayout.Button("Fermer (Tab)", ImGuiSkin.Button, GUILayout.Height(32))) { _visible = false; CancelRebind(); @@ -146,8 +146,7 @@ public class KeyBindingUI : MonoBehaviour GUILayout.Label("Appuyez sur une touche pour assigner...", ImGuiSkin.Hint); } - // F2 hint - GUILayout.Label("F2 — Ouvrir / Fermer ce menu", ImGuiSkin.Footer); + GUILayout.Label("Tab — Ouvrir / Fermer ce menu", ImGuiSkin.Footer); ImGuiSkin.EndWindow(); } diff --git a/game/Assets/Scripts/Network/DebugNetworkUI.cs b/game/Assets/Scripts/Network/DebugNetworkUI.cs index 5a806f9..9871b55 100644 --- a/game/Assets/Scripts/Network/DebugNetworkUI.cs +++ b/game/Assets/Scripts/Network/DebugNetworkUI.cs @@ -29,8 +29,8 @@ public class DebugNetworkUI : MonoBehaviour _fpsCount = 0; } - // Toggle detailed panel with F1 - if (Keyboard.current != null && Keyboard.current[Key.F1].wasPressedThisFrame) + // Toggle detailed panel with ` (backtick) + if (Keyboard.current != null && Keyboard.current[Key.Backquote].wasPressedThisFrame) _detailsVisible = !_detailsVisible; } @@ -47,7 +47,7 @@ public class DebugNetworkUI : MonoBehaviour DrawDetailPanel(nm); // Hint - GUI.Label(new Rect(10, Screen.height - 25, 300, 20), "F1 — Debug details", ImGuiSkin.Footer); + GUI.Label(new Rect(10, Screen.height - 25, 300, 20), "` — Debug details", ImGuiSkin.Footer); } // ───────── HUD Strip (always visible) ───────── diff --git a/game/Assets/Scripts/UI/ChatUI.cs b/game/Assets/Scripts/UI/ChatUI.cs index 330f8aa..ae2283e 100644 --- a/game/Assets/Scripts/UI/ChatUI.cs +++ b/game/Assets/Scripts/UI/ChatUI.cs @@ -6,7 +6,7 @@ using UnityEngine.InputSystem; using UnityEngine.Networking; /// -/// General chat panel. Toggle with F3. +/// General chat panel. T to open, Escape to close. /// Polls GET /chat/history every 3s and sends via POST /chat/send (or Colyseus if connected). /// Uses ImGuiSkin for visual consistency. /// @@ -42,8 +42,13 @@ public class ChatUI : MonoBehaviour void Update() { - if (Keyboard.current != null && Keyboard.current[Key.F3].wasPressedThisFrame) - Toggle(); + if (Keyboard.current != null) + { + if (!_visible && Keyboard.current[Key.T].wasPressedThisFrame) + Toggle(); + else if (_visible && Keyboard.current[Key.Escape].wasPressedThisFrame) + Toggle(); + } if (_visible) { @@ -144,7 +149,7 @@ public class ChatUI : MonoBehaviour GUILayout.EndHorizontal(); GUILayout.Space(4f); - GUILayout.Label("F3 — Ouvrir / Fermer · Entrée — Envoyer", ImGuiSkin.Footer); + GUILayout.Label("T — Ouvrir · Échap — Fermer · Entrée — Envoyer", ImGuiSkin.Footer); ImGuiSkin.EndWindow();