-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No longer forcing minimal UI, showing decent prompts everywhere, incl…
…uding tutorials. (#157) * Decent prompts now * Hide reticule and examine prompts * Hide read prompt too * Tutorials! * Remove extra spaces from prompts * Cleanup * Fix scroll prompts * Hide map and compass prompts * Show jogging tutorial instead of zoom. * Hide one of the settings tab prompts * Show cancel in inventory prompt * Scale down UI * Auto update prompts when connecting controllers. (#161) * Auto update prompts when connecting controllers. * Check specific sources * Revert logs changes
- Loading branch information
1 parent
e4a26be
commit 46668f8
Showing
22 changed files
with
338 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using HarmonyLib; | ||
using UnityEngine; | ||
|
||
// Some of the available game settings don't go well with VR. | ||
// These patches force some settings to certain values to prevent VR funkyness. | ||
namespace TwoForksVr.UI.Patches | ||
{ | ||
[HarmonyPatch] | ||
public class SettingsMenuPatches | ||
{ | ||
[HarmonyPrefix] | ||
[HarmonyPatch(typeof(vgSettingsMenuController), nameof(vgSettingsMenuController.Start))] | ||
private static void RemoveUnusedSettingsElements(vgSettingsMenuController __instance) | ||
{ | ||
// Rmove control settings screen. | ||
__instance.screens.RemoveAt(2); | ||
|
||
// Remove control settings tab. | ||
Object.Destroy(__instance.selectionGroup.buttonElements[2].gameObject); | ||
|
||
// Remove one of the tab input prompts. | ||
// Since the input prompts have been patched to use VR control names, both of these prompts (left and right) | ||
// were saying the same thing (something like "Right Stick"). So we can remove one of them. | ||
__instance.selectionGroup.transform.Find("ButtonContainer").GetChild(0).gameObject.SetActive(false); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using System.Collections.Generic; | ||
using HarmonyLib; | ||
using TMPro; | ||
using TwoForksVr.Helpers; | ||
using TwoForksVr.VrInput; | ||
using UnityEngine; | ||
|
||
namespace TwoForksVr.UI.Patches | ||
{ | ||
[HarmonyPatch] | ||
public static class TutorialPatches | ||
{ | ||
private static readonly Dictionary<string, string> tutorialTextMap = new Dictionary<string, string> | ||
{ | ||
{"textRadio", $"Hold [{VirtualKey.Radio}] to activate radio."}, | ||
{"textRadio_select_dialog", $"[{VirtualKey.ScrollUpDown}] to select dialog."}, | ||
{"textUse_radio", $"Release [{VirtualKey.Radio}] to talk to Delilah."}, | ||
{"textInspect_object", "Look at hand to inspect objects."}, | ||
{"textInspect_object_move", ""}, | ||
{"textRadio_object", $"Aim with hand and hold [{VirtualKey.Radio}] to talk about targeted object."}, | ||
{"textJournal_examine", "Look at hand to inspect journal."}, | ||
{"textJournal_stow", $"[{VirtualKey.StoreObject}] to keep journal."}, | ||
{"textCompass", $"Hold [{VirtualKey.ToolPicker}] to select compass from tool picker."}, | ||
{"textFlashlight", $"Hold [{VirtualKey.ToolPicker}] to select flashlight from tool picker."}, | ||
{"textMap", $"Hold [{VirtualKey.ToolPicker}] to select map from tool picker."}, | ||
{"textJog_toggle", $"[{VirtualKey.Jog}] to toggle jogging."}, | ||
{"textMantle", $"[{VirtualKey.LocomotionAction}] to climb over obstructions."}, | ||
{"textUse_object", $"Aim with hand and press [{VirtualKey.Use}] to use objects."}, | ||
{"textInventory_open", $"Hold [{VirtualKey.ToolPicker}] to select notes inventory from the tool picker."}, | ||
{"textInventory_browse", "Use hand laser to browse notes."}, | ||
{"textInventory_read", $"[{VirtualKey.StoreObject}] to store note"}, | ||
{"textCamera", $"Hold [{VirtualKey.ToolPicker}] to select camera from tool picker."}, | ||
{"textCamera_picture", $"[{VirtualKey.Use}] to take a picture."}, | ||
{"textCamera_lower", $"Press [{VirtualKey.ToolPicker}] to lower camera."}, | ||
{"textWaveReceiver", $"Hold [{VirtualKey.ToolPicker}] to select wave receiver from tool picker."}, | ||
{"textRadio_concept", $"Hold [{VirtualKey.Radio}] to radio about current subject of interest."}, | ||
{"textRadio_heldobject", $"Hold [{VirtualKey.Radio}] to talk about currently held object."}, | ||
|
||
// There's no zooming in VR. Couldn't figure out an easy way to hide the whole tutorial box, | ||
// so I'm just showing the jogging tutorial instead. | ||
{"textZoom", $"[{VirtualKey.Jog}] to toggle jogging."}, | ||
|
||
// Unused tutorial text. | ||
{"Text", ""} | ||
}; | ||
|
||
[HarmonyPrefix] | ||
[HarmonyPatch(typeof(vgHudManager), nameof(vgHudManager.Awake))] | ||
private static void SetUpTutorials(vgHudManager __instance) | ||
{ | ||
var tutorialObject = | ||
__instance.transform.Find( | ||
"uGUI Root/HUD/SafeZoner/BottomCenterGroup/TutorialPopup/TutorialPopupParent/TutorialObject"); | ||
|
||
Logs.LogInfo($"Found {tutorialObject.childCount} tutorials"); | ||
foreach (Transform child in tutorialObject) | ||
{ | ||
Logs.LogInfo($"{child.name}: {child.GetComponent<TextMeshProUGUI>().text}"); | ||
tutorialTextMap.TryGetValue(child.name, out var tutorialString); | ||
if (tutorialString == null) | ||
{ | ||
Logs.LogError($"No tutorial text found for {child.name}"); | ||
continue; | ||
} | ||
|
||
child.GetComponent<TextMeshProUGUI>().text = tutorialString; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.