Пример #1
0
 public static void Postfix(APIUser __0 = null) //, InfoType __1, ListType __2 = ListType.None
 {
     if (__0 == null)
     {
         return;
     }
     if (__0.location == null)
     {
         FriendButton.button.SetActive(false);
         return;
     }
     if (!__0.isFriend ||
         Utilities.isInSameWorld(__0) ||
         __0.location.ToLower().Equals("private") ||
         __0.location.ToLower().Equals("offline")
         )
     {
         FriendButton.button.SetActive(false);
     }
     else
     {
         FriendButton.button.SetActive(true);
         MelonCoroutines.Start(FriendButton.UpdateText());
     }
 }
Пример #2
0
    void OnInitializeFriendButton(GameObject go, int wrapIndex, int realIndex)
    {
        if (lstDatas.Count <= 0)
        {
            return;
        }
        if (go == null)
        {
            return;
        }

        int lstIndex = realIndex % lstDatas.Count;

        if (lstIndex < 0)
        {
            lstIndex = -lstIndex;
        }
        FriendButton button = go.GetComponent <FriendButton>();

        button.Set(lstDatas[lstIndex]._id,
                   lstDatas[lstIndex]._name,
                   lstDatas[lstIndex]._lastlogin.ToString(),
                   lstDatas[lstIndex]._picture,
                   lstDatas[lstIndex]._chkBox,
                   lstDatas[lstIndex]._deleteMask);
    }
Пример #3
0
 public void UiManagerInit()
 {
     InviteButton.Setup();
     FriendButton.Setup();
     WorldButton.Setup();
     WorldDownloadStatus.Setup();
     HudIcon.Setup();
 }
Пример #4
0
    static int FriendSortByLastLogin(FriendButton x, FriendButton y)
    {
        if (x == null || y == null)
        {
            return(0);
        }

        return(x.lastlogin.CompareTo(y.lastlogin));
    }
Пример #5
0
    static int FriendSortByName(FriendButton x, FriendButton y)
    {
        if (x == null || y == null)
        {
            return(0);
        }

        return(x.raw_name.CompareTo(y.raw_name));
    }
Пример #6
0
 public override void VRChat_OnUiManagerInit()
 {
     InviteButton.Setup();
     FriendButton.Setup();
     WorldButton.Setup();
     WorldDownloadStatus.Setup();
     HudIcon.Setup();
     CacheManager.UpdateDirectories();
 }
Пример #7
0
 public override void VRChat_OnUiManagerInit()
 {
     GameObject.Find("UserInterface/QuickMenu/QuickModeMenus/QuickModeNotificationsMenu/ScrollRect/ViewPort/Content/NotificationUiPrefab/Row_NotificationActions").AddComponent <SelectedNotificationListener>();
     GameObject.Find("UserInterface/QuickMenu/QuickModeMenus/QuickModeInviteResponseMoreOptionsMenu").AddComponent <NotificationMoreListener>();
     InviteButton.Setup();
     FriendButton.Setup();
     WorldButton.Setup();
     WorldDownloadStatus.Setup();
     HudIcon.Setup();
 }
Пример #8
0
    // test
    void AddAllButton2()
    {
        int rand = 1;

        for (int i = 0; i < 100; i++)
        {
            GameObject   tempGameObj = NGUITools.AddChild(grid.gameObject, button_Prefab);
            FriendButton comp        = tempGameObj.GetComponent <FriendButton>();

            rand = Random.Range(0, 100000);
            comp.Set(string.Format("id {0}", i), string.Format("name {0}", i), rand.ToString(), "f1");
            //lst.Add(comp);
        }
        //SortingID();

        //toggleSortByName.value = true;

        //grid.Reposition();
    }
Пример #9
0
    void AddAllButton()
    {
        TextAsset textAsset = Resources.Load <TextAsset>("friends");
        JSONNode  node      = JSON.Parse(textAsset.text);

        for (int i = 0; i < node["data"].Count; i++)
        {
            GameObject   tempGameObj = NGUITools.AddChild(grid.gameObject, button_Prefab);
            FriendButton comp        = tempGameObj.GetComponent <FriendButton>();
            comp.Set(node["data"][i]["name"],
                     node["data"][i]["id"],
                     node["data"][i]["lastlogin"],
                     node["data"][i]["picture"]);
            lst.Add(comp);
        }
        SortingID();

        toggleSortByName.value = true;

        grid.Reposition();
    }
Пример #10
0
        private static async void OnRecompress()
        {
            await TaskUtilities.YieldToMainThread();

            CacheManager.CreateInfoFileFor(file);
            if (ModSettings.showHudMessages)
            {
                Utilities.QueueHudMessage("Download Finished");
            }
            if (ModSettings.hideQMStatusWhenInActive)
            {
                WorldDownloadStatus.Disable();
            }
            Downloading = false;
            CacheManager.AddDirectory(CacheManager.ComputeAssetHash(DownloadInfo.ApiWorld.id));
            HudIcon.Disable();
            InviteButton.UpdateTextDownloadStopped();
            FriendButton.UpdateTextDownloadStopped();
            WorldButton.UpdateTextDownloadStopped();
            WorldDownloadStatus.gameObject.SetText(Constants.DOWNLOAD_STATUS_IDLE_TEXT);
            switch (DownloadInfo.DownloadType)
            {
            case DownloadType.Friend:
                if (!ModSettings.autoFollowFriends)
                {
                    if (ModSettings.showPopupsOnComplete)
                    {
                        DisplayFriendPopup();
                    }
                }
                else
                {
                    Utilities.GoToWorld(DownloadInfo.ApiWorld, DownloadInfo.InstanceIDTags, false);
                }
                break;

            case DownloadType.Invite:
                if (!ModSettings.autoFollowInvites)
                {
                    if (ModSettings.showPopupsOnComplete)
                    {
                        DisplayInvitePopup();
                    }
                }
                else
                {
                    Utilities.GoToWorld(DownloadInfo.ApiWorld, DownloadInfo.InstanceIDTags, true);
                }
                break;

            case DownloadType.World:
                if (!ModSettings.autoFollowWorlds)
                {
                    if (ModSettings.showPopupsOnComplete)
                    {
                        DisplayWorldPopup();
                    }
                }
                else
                {
                    Utilities.GoToWorld(DownloadInfo.ApiWorld, DownloadInfo.InstanceIDTags, false);
                }
                break;
            }
        }