Пример #1
0
 public void OnPlayerJoined(Player player)
 {
     if (player != null)
     {
         if (NicknameManager.Contains(player.field_Private_APIUser_0.id))
         {
             VRChatAPI.UpdatePlayerNameplate(player);
         }
     }
 }
Пример #2
0
 public override void OnApplicationStart()
 {
     if (MelonHandler.Mods.Any(it => it.Info.SystemType.Name == nameof(UiExpansionKitMod)))
     {
         typeof(UiExpansionKitSupport).GetMethod(nameof(UiExpansionKitSupport.Initialize), BindingFlags.Static | BindingFlags.Public) !.Invoke(null, new object[0]);
     }
     NicknameManager.LoadNicknames();
     MelonCoroutines.Start(Initialize());
     VRChatAPI.Patch();
 }
Пример #3
0
        private static void RemoveNicknameUserDetailsMenu()
        {
            var Menu     = GameObject.Find("Screens").transform.Find("UserInfo");
            var UserInfo = Menu.transform.GetComponentInChildren <VRC.UI.PageUserInfo>();

            if (Menu != null && UserInfo != null)
            {
                var Player = VRChatAPI.GetPlayerFromId(UserInfo.field_Public_APIUser_0.id);
                if (Player != null)
                {
                    VRChatAPI.UpdatePlayerNameplate(Player, true);
                }
                RemoveNickname(UserInfo.field_Public_APIUser_0.id);
                VRChatAPI.UpdateQuickMenuText(true);
                VRChatAPI.UpdateMenuContentText(true);
            }
        }
Пример #4
0
 private static void UpdateNicknameUserDetailsMenu()
 {
     UIExpansionKit.API.BuiltinUiUtils.ShowInputPopup("Type a nickname", "", InputField.InputType.Standard, false, "Accept", (name, _, __) =>
     {
         var Menu     = GameObject.Find("Screens").transform.Find("UserInfo");
         var UserInfo = Menu.transform.GetComponentInChildren <VRC.UI.PageUserInfo>();
         if (Menu != null && UserInfo != null)
         {
             Nickname n     = new Nickname();
             n.UserId       = UserInfo?.field_Public_APIUser_0?.id;
             n.OriginalName = UserInfo?.field_Public_APIUser_0?.displayName;
             n.ModifiedName = name;
             UpdateNickname(n);
             var Player = VRChatAPI.GetPlayerFromId(UserInfo.field_Public_APIUser_0.id);
             if (Player != null)
             {
                 VRChatAPI.UpdatePlayerNameplate(Player);
             }
             VRChatAPI.UpdateQuickMenuText();
             VRChatAPI.UpdateMenuContentText();
         }
     });
 }