Skip to content

Commit 8b95f21

Browse files
committed
swap to buttons improved
1 parent c25115e commit 8b95f21

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

Basis/Packages/com.basis.framework/BasisUI/Menus/Main Menu Providers/SettingsProviderParts/SettingsProviderPlatform.cs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,19 @@ public static void BuildDeviceModeUI(RectTransform container)
4848
foreach (string mode in availableModes)
4949
{
5050
string capturedMode = mode;
51+
string displayName = GetModeDisplayName(capturedMode);
5152
bool isActive = string.Equals(currentMode, capturedMode, System.StringComparison.Ordinal);
5253
string suffix = isActive ? " [ACTIVE]" : "";
5354

5455
PanelButton modeButton = PanelButton.CreateNew(infoGroup.ContentParent);
55-
modeButton.Descriptor.SetTitle($"Switch To {capturedMode}{suffix}");
56+
modeButton.Descriptor.SetTitle($"Switch To {displayName}{suffix}");
5657
modeButton.Descriptor.SetDescription(GetModeDescription(capturedMode));
5758
modeButton.OnClicked += () =>
5859
{
5960
if (isActive) return;
60-
BasisMainMenu.Instance.OpenDialogue($"Switch To {capturedMode}",
61-
$"Are you sure you want to switch to {capturedMode}?",
62-
$"Switch To {capturedMode}",
61+
BasisMainMenu.Instance.OpenDialogue($"Switch To {displayName}",
62+
$"Are you sure you want to switch to {displayName}?",
63+
$"Switch To {displayName}",
6364
"Cancel",
6465
async value =>
6566
{
@@ -71,11 +72,18 @@ public static void BuildDeviceModeUI(RectTransform container)
7172
}
7273
}
7374

75+
private static string GetModeDisplayName(string mode)
76+
{
77+
if (mode == BasisConstants.OpenVRLoader) return "OpenVR (SteamVR)";
78+
if (mode == BasisConstants.OpenXRLoader) return "OpenXR";
79+
return mode;
80+
}
81+
7482
private static string GetModeDescription(string mode)
7583
{
76-
if (mode == BasisConstants.Desktop) return "Desktop mode (no VR).";
77-
if (mode == BasisConstants.OpenVRLoader) return "SteamVR / OpenVR runtime.";
78-
if (mode == BasisConstants.OpenXRLoader) return "OpenXR runtime.";
84+
if (mode == BasisConstants.Desktop) return "Desktop mode (no VR). Shortcut: F9";
85+
if (mode == BasisConstants.OpenVRLoader) return "SteamVR / OpenVR runtime. Shortcut: F11";
86+
if (mode == BasisConstants.OpenXRLoader) return "OpenXR runtime. Shortcut: F10";
7987
return mode;
8088
}
8189
}

0 commit comments

Comments
 (0)