Skip to content
This repository was archived by the owner on Jan 24, 2023. It is now read-only.

Commit deb713d

Browse files
committed
Added helper method to get screen transform based on index.
1 parent cdd7e84 commit deb713d

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

VRChat/VrcUiExtensions.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,14 @@ public static void ShowScreen(this VRCUiManager uiManager, QuickMenu.MainMenuScr
126126
ShowScreen(uiManager, BigMenuIndexToPathTable[menuIndex], addToScreenStack);
127127
}
128128

129+
public static Transform GetScreen(this VRCUiManager uiManager, QuickMenu.MainMenuScreenIndex menuIndex)
130+
{
131+
if (!BigMenuIndexToPathTable.ContainsKey(menuIndex))
132+
return null;
133+
134+
return uiManager.MenuContent().transform.Find($"Screens/{BigMenuIndexToNameTable[menuIndex]}");
135+
}
136+
129137
private static readonly Dictionary<QuickMenu.MainMenuScreenIndex, string> BigMenuIndexToPathTable = new Dictionary<QuickMenu.MainMenuScreenIndex, string>()
130138
{
131139
{ QuickMenu.MainMenuScreenIndex.Unknown, "" },
@@ -141,5 +149,22 @@ public static void ShowScreen(this VRCUiManager uiManager, QuickMenu.MainMenuScr
141149
{ QuickMenu.MainMenuScreenIndex.VRCPlusMenu, "UserInterface/MenuContent/Screens/VRC+" },
142150
{ QuickMenu.MainMenuScreenIndex.GalleryMenu, "UserInterface/MenuContent/Screens/Gallery" },
143151
};
152+
153+
154+
private static readonly Dictionary<QuickMenu.MainMenuScreenIndex, string> BigMenuIndexToNameTable = new Dictionary<QuickMenu.MainMenuScreenIndex, string>()
155+
{
156+
{ QuickMenu.MainMenuScreenIndex.Unknown, "" },
157+
{ QuickMenu.MainMenuScreenIndex.WorldsMenu, "WorldInfo" },
158+
{ QuickMenu.MainMenuScreenIndex.AvatarMenu, "Avatar" },
159+
{ QuickMenu.MainMenuScreenIndex.SocialMenu, "Social" },
160+
{ QuickMenu.MainMenuScreenIndex.SettingsMenu, "Settings" },
161+
{ QuickMenu.MainMenuScreenIndex.UserDetailsMenu, "UserInfo" },
162+
{ QuickMenu.MainMenuScreenIndex.DetailsMenu_Obsolete, "ImageDetails" },
163+
{ QuickMenu.MainMenuScreenIndex.SafetyMenu, "Settings_Safety" },
164+
{ QuickMenu.MainMenuScreenIndex.CurrentUserPlaylistsMenu, "Playlists" },
165+
{ QuickMenu.MainMenuScreenIndex.OtherUserPlaylistsMenu, "Playlists" },
166+
{ QuickMenu.MainMenuScreenIndex.VRCPlusMenu, "VRC+" },
167+
{ QuickMenu.MainMenuScreenIndex.GalleryMenu, "Gallery" },
168+
};
144169
}
145170
}

0 commit comments

Comments
 (0)