From 80d5c7536d61e7653e939fb52274161198b63f4b Mon Sep 17 00:00:00 2001 From: JaXt0r Date: Sun, 22 Nov 2026 15:16:34 +0100 Subject: [PATCH] feat: VR help panels take the place of the menus - the Gothic logo swaps the status screen, menu and quest log for the controls, hero slots and help at eye level (no more looking up), clicking it again brings the menus back; same in the main menu Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013BrTJPpfcxHWh9DesVseUb --- Assets/Gothic-Core/Scenes/MainMenu.unity | 18 ++-- .../Scripts/Adapters/UI/Menus/MenuHandler.cs | 6 ++ .../UI/Tutorials/GothicLogoHandler.cs | 12 +-- .../Scripts/GlobalEventDispatcher.cs | 3 + .../Resources/VR/Prefabs/UI/Tutorials.prefab | 24 +++-- .../VR/Prefabs/VR - Player XRI.prefab | 40 +++++++-- .../Adapters/UI/Menus/TutorialHandler.cs | 89 ++++++++++++++++++- Docs/adr/2026-11-22-vr-help-panels-swap.md | 25 ++++++ Docs/vr-help-panels.md | 35 +++++--- 9 files changed, 203 insertions(+), 49 deletions(-) create mode 100644 Docs/adr/2026-11-22-vr-help-panels-swap.md diff --git a/Assets/Gothic-Core/Scenes/MainMenu.unity b/Assets/Gothic-Core/Scenes/MainMenu.unity index cc6be043c..2077093bd 100644 --- a/Assets/Gothic-Core/Scenes/MainMenu.unity +++ b/Assets/Gothic-Core/Scenes/MainMenu.unity @@ -119,11 +119,6 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} ---- !u!1 &64750182 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1879303798920566507, guid: a0af29d97abd24d4c8382b6da4017660, type: 3} - m_PrefabInstance: {fileID: 2140893076} - m_PrefabAsset: {fileID: 0} --- !u!4 &64750183 stripped Transform: m_CorrespondingSourceObject: {fileID: 2283093842980008316, guid: a0af29d97abd24d4c8382b6da4017660, type: 3} @@ -233,15 +228,16 @@ PrefabInstance: propertyPath: m_Name value: Gothic-logo objectReference: {fileID: 0} - - target: {fileID: 6793405629452684711, guid: d905c6fd3294c82478f4edf887cac0a9, type: 3} - propertyPath: _tutorialHandler - value: - objectReference: {fileID: 64750182} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d905c6fd3294c82478f4edf887cac0a9, type: 3} +--- !u!1 &197676827 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 5443751599501581721, guid: d905c6fd3294c82478f4edf887cac0a9, type: 3} + m_PrefabInstance: {fileID: 197676826} + m_PrefabAsset: {fileID: 0} --- !u!4 &505140342 stripped Transform: m_CorrespondingSourceObject: {fileID: 7389606469834037353, guid: 962bda2b335a56f48a6f7159a9e824d8, type: 3} @@ -831,6 +827,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 4906976065703679581, guid: a0af29d97abd24d4c8382b6da4017660, type: 3} + propertyPath: _logo + value: + objectReference: {fileID: 197676827} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] diff --git a/Assets/Gothic-Core/Scripts/Adapters/UI/Menus/MenuHandler.cs b/Assets/Gothic-Core/Scripts/Adapters/UI/Menus/MenuHandler.cs index 2e06ac211..cfeb71ba2 100644 --- a/Assets/Gothic-Core/Scripts/Adapters/UI/Menus/MenuHandler.cs +++ b/Assets/Gothic-Core/Scripts/Adapters/UI/Menus/MenuHandler.cs @@ -34,6 +34,12 @@ public class MenuHandler : MonoBehaviour // Cached MainMenu tree hierarchy of submenus (load, save, settings) and their children (sub-settings, settings fields) public AbstractMenuInstance MainMenuHierarchy { get; private set; } + /// + /// The open (sub)menu, null while none is open. + /// + public GameObject CurrentMenu => + _currentMenu.IsNullOrEmpty() ? null : _menuList.GetValueOrDefault(_currentMenu); + private void Awake() { InitializeMenus(); diff --git a/Assets/Gothic-Core/Scripts/Adapters/UI/Tutorials/GothicLogoHandler.cs b/Assets/Gothic-Core/Scripts/Adapters/UI/Tutorials/GothicLogoHandler.cs index 3e5ba67d9..2a284429f 100644 --- a/Assets/Gothic-Core/Scripts/Adapters/UI/Tutorials/GothicLogoHandler.cs +++ b/Assets/Gothic-Core/Scripts/Adapters/UI/Tutorials/GothicLogoHandler.cs @@ -7,9 +7,6 @@ namespace Gothic.Core.Adapters.UI { public class GothicLogoHandler : MonoBehaviour, IPointerClickHandler { - [SerializeField] - private GameObject _tutorialHandler; - [SerializeField] private float _minBrightness = 0.7f; [SerializeField] @@ -52,22 +49,19 @@ private void Update() /// - /// Counts as a poke for the Marvin mode activation and toggles the tutorial. - /// The click completing the Marvin pokes doesn't toggle the tutorial, otherwise it would stay open + /// Counts as a poke for the Marvin mode activation and raises GothicLogoClicked (the VR help panels listen). + /// The click completing the Marvin pokes doesn't raise it, otherwise the help would stay open /// (open, close, open). /// public void OnPointerClick(PointerEventData eventData) { GlobalEventDispatcher.MarvinLogoPoked.Invoke(eventData); - if (_tutorialHandler == null) - return; - var marvinService = ReflexProjectInstaller.DIContainer.Resolve(); if (marvinService.IsLogoPokeComplete) return; - _tutorialHandler.gameObject.SetActive(!_tutorialHandler.gameObject.activeSelf); + GlobalEventDispatcher.GothicLogoClicked.Invoke(gameObject); } private void OnDestroy() diff --git a/Assets/Gothic-Core/Scripts/GlobalEventDispatcher.cs b/Assets/Gothic-Core/Scripts/GlobalEventDispatcher.cs index e5ef283d2..8a2e25791 100644 --- a/Assets/Gothic-Core/Scripts/GlobalEventDispatcher.cs +++ b/Assets/Gothic-Core/Scripts/GlobalEventDispatcher.cs @@ -357,5 +357,8 @@ public enum HandSide public static readonly UnityEvent MarvinModeChanged = new(); // The Gothic-Unity logo in the menu got clicked. VR uses the event data to vibrate the clicking hand. public static readonly UnityEvent MarvinLogoPoked = new(); + // The Gothic logo in the menu got clicked (not the click completing the Marvin pokes). GameObject is the + // logo - the VR help panels switch on their own logo only. + public static readonly UnityEvent GothicLogoClicked = new(); } } diff --git a/Assets/Gothic-VR/Resources/VR/Prefabs/UI/Tutorials.prefab b/Assets/Gothic-VR/Resources/VR/Prefabs/UI/Tutorials.prefab index 604bbfb88..27980735c 100644 --- a/Assets/Gothic-VR/Resources/VR/Prefabs/UI/Tutorials.prefab +++ b/Assets/Gothic-VR/Resources/VR/Prefabs/UI/Tutorials.prefab @@ -875,6 +875,12 @@ MonoBehaviour: - {fileID: 5472245296572471787} - {fileID: 5481992129443507305} - {fileID: 5433034135938690309} + _logo: {fileID: 0} + _panels: + - {fileID: 8031915468319420437} + - {fileID: 2574759379074861209} + - {fileID: 2355034974786271543} + _hiddenWhileShown: [] --- !u!1 &2287991555969460976 GameObject: m_ObjectHideFlags: 0 @@ -1072,7 +1078,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &6046098125727991837 RectTransform: m_ObjectHideFlags: 0 @@ -1080,7 +1086,7 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2355034974786271543} - m_LocalRotation: {x: -0.11839155, y: 0.41745764, z: 0.054959342, w: 0.8992731} + m_LocalRotation: {x: 0, y: 0.42103583, z: 0, w: 0.90704405} m_LocalPosition: {x: 0, y: 0, z: -2.857143} m_LocalScale: {x: 0.5, y: 0.5, z: 1} m_ConstrainProportionsScale: 0 @@ -1093,7 +1099,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 5, y: 5.2} + m_AnchoredPosition: {x: 5, y: 0} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!223 &7154765183792889945 @@ -1203,7 +1209,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &8641483639200414027 RectTransform: m_ObjectHideFlags: 0 @@ -1211,7 +1217,7 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2574759379074861209} - m_LocalRotation: {x: -0.1305262, y: 0, z: 0, w: 0.9914449} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.5, y: 0.5, z: 1} m_ConstrainProportionsScale: 0 @@ -1224,7 +1230,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 5.2} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!223 &3364244922444394401 @@ -4976,7 +4982,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &2721688293221894282 RectTransform: m_ObjectHideFlags: 0 @@ -4984,7 +4990,7 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8031915468319420437} - m_LocalRotation: {x: -0.11839155, y: -0.41745764, z: -0.054959342, w: 0.8992731} + m_LocalRotation: {x: 0, y: 0.42103574, z: 0, w: -0.90704405} m_LocalPosition: {x: 0, y: 0, z: -2.857143} m_LocalScale: {x: 0.5, y: 0.5, z: 1} m_ConstrainProportionsScale: 0 @@ -4997,7 +5003,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: -5, y: 5.2} + m_AnchoredPosition: {x: -5, y: 0} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!223 &8480462646933472547 diff --git a/Assets/Gothic-VR/Resources/VR/Prefabs/VR - Player XRI.prefab b/Assets/Gothic-VR/Resources/VR/Prefabs/VR - Player XRI.prefab index 14b3ea400..b3ba0fe96 100644 --- a/Assets/Gothic-VR/Resources/VR/Prefabs/VR - Player XRI.prefab +++ b/Assets/Gothic-VR/Resources/VR/Prefabs/VR - Player XRI.prefab @@ -5331,6 +5331,11 @@ Transform: m_CorrespondingSourceObject: {fileID: 2282871596405899006, guid: cd095a3981bb372429f6df026b1dec73, type: 3} m_PrefabInstance: {fileID: 389902283970083402} m_PrefabAsset: {fileID: 0} +--- !u!1 &8202939263791807834 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 8412591900964177680, guid: cd095a3981bb372429f6df026b1dec73, type: 3} + m_PrefabInstance: {fileID: 389902283970083402} + m_PrefabAsset: {fileID: 0} --- !u!1001 &2518208126512905943 PrefabInstance: m_ObjectHideFlags: 0 @@ -5892,15 +5897,16 @@ PrefabInstance: propertyPath: m_Name value: Gothic-logo objectReference: {fileID: 0} - - target: {fileID: 6793405629452684711, guid: d905c6fd3294c82478f4edf887cac0a9, type: 3} - propertyPath: _tutorialHandler - value: - objectReference: {fileID: 4635703751691790106} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d905c6fd3294c82478f4edf887cac0a9, type: 3} +--- !u!1 &651131927819320523 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 5443751599501581721, guid: d905c6fd3294c82478f4edf887cac0a9, type: 3} + m_PrefabInstance: {fileID: 4793340960506667346} + m_PrefabAsset: {fileID: 0} --- !u!224 &6971875092960890840 stripped RectTransform: m_CorrespondingSourceObject: {fileID: 2469183434187583114, guid: d905c6fd3294c82478f4edf887cac0a9, type: 3} @@ -6056,6 +6062,11 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 442d7862e66282348b7a8c3c0dffdc95, type: 3} +--- !u!1 &2599487134210044051 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 8412591900964177680, guid: 442d7862e66282348b7a8c3c0dffdc95, type: 3} + m_PrefabInstance: {fileID: 5813227951801890691} + m_PrefabAsset: {fileID: 0} --- !u!4 &5693358733919242621 stripped Transform: m_CorrespondingSourceObject: {fileID: 2282871596405899006, guid: 442d7862e66282348b7a8c3c0dffdc95, type: 3} @@ -6175,16 +6186,27 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 4906976065703679581, guid: a0af29d97abd24d4c8382b6da4017660, type: 3} + propertyPath: _logo + value: + objectReference: {fileID: 651131927819320523} + - target: {fileID: 4906976065703679581, guid: a0af29d97abd24d4c8382b6da4017660, type: 3} + propertyPath: _hiddenWhileShown.Array.size + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 4906976065703679581, guid: a0af29d97abd24d4c8382b6da4017660, type: 3} + propertyPath: '_hiddenWhileShown.Array.data[0]' + value: + objectReference: {fileID: 2599487134210044051} + - target: {fileID: 4906976065703679581, guid: a0af29d97abd24d4c8382b6da4017660, type: 3} + propertyPath: '_hiddenWhileShown.Array.data[1]' + value: + objectReference: {fileID: 8202939263791807834} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: a0af29d97abd24d4c8382b6da4017660, type: 3} ---- !u!1 &4635703751691790106 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1879303798920566507, guid: a0af29d97abd24d4c8382b6da4017660, type: 3} - m_PrefabInstance: {fileID: 6503748551157953009} - m_PrefabAsset: {fileID: 0} --- !u!4 &5039203737416974477 stripped Transform: m_CorrespondingSourceObject: {fileID: 2283093842980008316, guid: a0af29d97abd24d4c8382b6da4017660, type: 3} diff --git a/Assets/Gothic-VR/Scripts/Adapters/UI/Menus/TutorialHandler.cs b/Assets/Gothic-VR/Scripts/Adapters/UI/Menus/TutorialHandler.cs index 05456a6c9..38d401b73 100644 --- a/Assets/Gothic-VR/Scripts/Adapters/UI/Menus/TutorialHandler.cs +++ b/Assets/Gothic-VR/Scripts/Adapters/UI/Menus/TutorialHandler.cs @@ -1,30 +1,57 @@ using Gothic.Core.Services.Meshes; using Gothic.Core.Services.Vm; using Gothic.Core; +using Gothic.Core.Adapters.UI.Menus; using Gothic.Core.Const; +using Gothic.Core.Logging; using Reflex.Attributes; using UnityEngine; using UnityEngine.UI; +using Logger = Gothic.Core.Logging.Logger; namespace Gothic.VR.Adapters.UI.Menus { + /// + /// Shows the VR help panels when its Gothic logo is clicked and hides them on the next click. + /// The panels take the menus' places: the menus in _hiddenWhileShown and the open Gothic menu + /// (MenuHandler.CurrentMenu) are hidden meanwhile. The next MenuOpened (back button, menu reopened after a close) + /// brings the menus back. + /// public class TutorialHandler : MonoBehaviour { [SerializeField] private Image[] _backgroundImages; + [Tooltip("The Gothic logo whose clicks show and hide the panels.")] + [SerializeField] private GameObject _logo; + [Tooltip("The help panels to show and hide (Quest2, Hero Slots, Help).")] + [SerializeField] private GameObject[] _panels; + [Tooltip("Side menus hidden while the panels are shown (status, quest log). The open Gothic menu is " + + "always hidden. Empty in the main menu scene.")] + [SerializeField] private GameObject[] _hiddenWhileShown; + [Inject] private readonly VmService _vmService; [Inject] private readonly TextureService _textureService; - + private bool _isShown; + private MenuHandler _menuHandler; + private GameObject _hiddenMenu; + + private void Awake() { - gameObject.SetActive(false); + SetActive(_panels, false); + + // MenuHandler opens its first menu before this Awake (it activates first), so it's asked on show. + _menuHandler = GetComponentInParent(true); + + GlobalEventDispatcher.GothicLogoClicked.AddListener(OnGothicLogoClicked); + GlobalEventDispatcher.MenuOpened.AddListener(OnMenuOpened); } private void Start() { var backPic = _textureService.GetMaterial(_vmService.BackPic); - + foreach (var image in _backgroundImages) { image.material = backPic; @@ -35,5 +62,61 @@ private void Start() if (onTop != null) onTop.Apply(); } + + private void OnDestroy() + { + GlobalEventDispatcher.GothicLogoClicked.RemoveListener(OnGothicLogoClicked); + GlobalEventDispatcher.MenuOpened.RemoveListener(OnMenuOpened); + } + + private void OnGothicLogoClicked(GameObject logo) + { + if (logo != _logo) + return; + + _isShown = !_isShown; + SetActive(_panels, _isShown); + SetActive(_hiddenWhileShown, !_isShown); + + if (_isShown) + { + _hiddenMenu = _menuHandler != null ? _menuHandler.CurrentMenu : null; + if (_hiddenMenu != null) + _hiddenMenu.SetActive(false); + } + else + { + if (_hiddenMenu != null) + _hiddenMenu.SetActive(true); + _hiddenMenu = null; + } + + Logger.Log($"[TutorialHandler] Help panels {(_isShown ? "shown" : "hidden")}", LogCat.Ui); + } + + /// + /// MenuHandler activated the new menu itself: only the panels and side menus switch back. + /// + private void OnMenuOpened(GameObject menu) + { + if (!_isShown) + return; + + _isShown = false; + _hiddenMenu = null; + SetActive(_panels, false); + SetActive(_hiddenWhileShown, true); + + Logger.Log("[TutorialHandler] Help panels hidden, menu opened", LogCat.Ui); + } + + private static void SetActive(GameObject[] gameObjects, bool isActive) + { + foreach (var go in gameObjects) + { + if (go != null) + go.SetActive(isActive); + } + } } } diff --git a/Docs/adr/2026-11-22-vr-help-panels-swap.md b/Docs/adr/2026-11-22-vr-help-panels-swap.md new file mode 100644 index 000000000..4a319e791 --- /dev/null +++ b/Docs/adr/2026-11-22-vr-help-panels-swap.md @@ -0,0 +1,25 @@ +# ADR: VR help panels take the place of the menus + +- Date: 2026-11-22 +- Replaces: decision 3 of [VR help panels above the menu](2026-11-13-vr-help-panels.md) +- Technical details: Docs/vr-help-panels.md + +## Context + +Clicking the Gothic logo in the in-game VR menu showed the three help panels above the menu ring, tilted towards the player. +Reading them meant looking up for a long time: tiring for the neck, and the text sat at an angle above the menus. +The original game never stacks screens: a sub menu replaces the main menu, the diary replaces the view. One page in front of the player at a time. + +## Decisions + +1. **The logo swaps the menus for the help panels.** The status screen, the open menu and the quest log disappear, and the controls, the hero's slots and the help tabs appear in their places at eye level, facing the player. Clicking the logo again brings the menus back. Not chosen: panels in front of the dimmed menus - two layers close together are tiring to focus in a headset; panels below the ring - the hands and controllers get in the way of the text. +2. **The logo stays visible and is the only way back.** No extra button. Not chosen: a back button on the panels - one more element for something the logo already does. +3. **The swap is instant.** Gothic's own menus switch without a transition. Not chosen: a short fade - softer, but no gain in readability. +4. **The menu always opens on the Gothic menus**, even if the help was showing when it was closed. Not chosen: remembering the help - the menu is mostly opened to play, not to read the help again. +5. **The main menu before loading a game swaps the same way**: the logo replaces the menu with the three panels at eye level. Not chosen: keeping the panels above the main menu - the same strain on the neck as in game, and two behaviours for one logo. + +## Consequences + +- Help and menus can't be read side by side in game any more. +- Pressing back in a sub menu while the help is shown returns to the menus. +- Coming back from the help, the quest log shows its topic list again, not the quest that was open. Accepted: keeping it would mean hiding the menus a second, more fragile way. diff --git a/Docs/vr-help-panels.md b/Docs/vr-help-panels.md index abe12663a..f36b668b4 100644 --- a/Docs/vr-help-panels.md +++ b/Docs/vr-help-panels.md @@ -1,19 +1,20 @@ # VR help panels -Clicking the Gothic logo in the VR menu toggles three panels above the menu ring (`GothicLogoHandler` -> -`Tutorials` GameObject). Decision record: [2026-11-13-vr-help-panels](adr/2026-11-13-vr-help-panels.md). +Clicking the Gothic logo in the VR menu swaps the menu ring for three help panels at eye level; clicking it again +brings the menus back (`GothicLogoHandler` raises `GlobalEventDispatcher.GothicLogoClicked`, `TutorialHandler` +switches). Decision records: [2026-11-13-vr-help-panels](adr/2026-11-13-vr-help-panels.md), +[2026-11-22-vr-help-panels-swap](adr/2026-11-22-vr-help-panels-swap.md). | Panel | Where | Content | |---|---|---| -| `Quest2` (controls) | above the status menu | controller drawing, labels follow the control layout | -| `Hero Slots` | above the main menu | hero outline, the 4 body slots (both hips, backpack left shoulder, holster right shoulder) | -| `Help` | above the quest log | tabs left (`VRHelpTabs`), one page per topic right: controller drawing + text | +| `Quest2` (controls) | in place of the status menu | controller drawing, labels follow the control layout | +| `Hero Slots` | in place of the open Gothic menu | hero outline, the 4 body slots (both hips, backpack left shoulder, holster right shoulder) | +| `Help` | in place of the quest log | tabs left (`VRHelpTabs`), one page per topic right: controller drawing + text | ## Files - `Gothic-VR/Resources/VR/Prefabs/UI/Tutorials.prefab` - the three panels and their placement. Instances: player - prefab `MenuHandler/Tutorials` (in game) and `MainMenu.unity` (main menu: panels beside the menu at eye level, - `Help` inactive, placement overridden there). + prefab `MenuHandler/Tutorials` (in game) and `MainMenu.unity` (main menu, same placement and swap). - `Gothic-VR/Resources/VR/Prefabs/UI/ControllerHelpPage.prefab` - the controller drawing with one label per stick, stick click and button of both hands (`VRControllerHelpPage`). Used by `Quest2` and every help tab. - Texts: string table `Gothic-UI` (`Gothic-Core/Localizations/`), keys `vr.controls.*` and `vr.help.*`, EN and DE. @@ -21,9 +22,23 @@ Clicking the Gothic logo in the VR menu toggles three panels above the menu ring ## Placement `MenuHandler` is scaled (0.35, 0.35, 1). The `Tutorials` root scales z by 0.35 so the panels have a uniform world -scale - otherwise yaw and tilt shear the panels. Hence the panels' local z is divided by 0.35 (-2.857 = 1 m towards -the player) and the side panels use the world yaw of the menus below (±49.8°, which is what their ±22.5° become -under the non-uniform scale). All three tilt -15° around x: the top edge leans towards the player. +scale - otherwise yaw shears the panels. Hence the panels' local z is divided by 0.35 (-2.857 = 1 m towards the +player) and the side panels use the world yaw of the menus they replace (±49.8°, which is what their ±22.5° become +under the non-uniform scale). All three stand at y 0 like the menus, no tilt. + +## Swap + +`TutorialHandler` owns the state; it reacts only to clicks on its own `_logo` (main menu and player logo may +coexist). The `Tutorials` root stays active, `_panels` are switched. + +- Show: `_panels` on; `_hiddenWhileShown` (player prefab: `StatusMenu`, `QuestMenu`) and the open Gothic menu + (`MenuHandler.CurrentMenu`; asked on click, as `MenuHandler` opens `MENU_MAIN` before the panels' `Awake`) off. + The logo stays visible and is the only way back. +- Hide (logo again): panels off, the hidden menus on. +- The next `MenuOpened` while shown (back button in a sub menu, or the menu reopened after a close, which opens + `MENU_MAIN`): panels off, `_hiddenWhileShown` on; `MenuHandler` already activated the new menu. Nothing listens + to `MenuClosed`. +- Main menu scene: the same swap; `_hiddenWhileShown` is empty there (no side menus). ## Labels follow the control layout