Exemple #1
0
        public static void OnStaticConfigChanged()
        {
            updateDelegate = null;
            if (PlayerListConfig.pingToggle.Value)
            {
                updateDelegate += AddPing;
            }
            if (PlayerListConfig.fpsToggle.Value)
            {
                updateDelegate += AddFps;
            }
            if (PlayerListConfig.platformToggle.Value)
            {
                updateDelegate += AddPlatform;
            }
            if (PlayerListConfig.perfToggle.Value)
            {
                updateDelegate += AddPerf;
            }
            if (PlayerListConfig.distanceToggle.Value)
            {
                updateDelegate += AddDistance;
            }
            if (PlayerListConfig.photonIdToggle.Value)
            {
                updateDelegate += AddPhotonId;
            }
            if (PlayerListConfig.ownedObjectsToggle.Value)
            {
                if (VRCUtils.AreRiskyFunctionsAllowed)
                {
                    updateDelegate += AddOwnedObjects;
                }
                else
                {
                    updateDelegate += AddOwnedObjectsSafe;
                }
            }
            if (PlayerListConfig.displayNameToggle.Value)
            {
                updateDelegate += AddDisplayName;
            }
            if (PlayerListConfig.distanceToggle.Value && EntrySortManager.IsSortTypeInUse(EntrySortManager.SortType.Distance) || PlayerListConfig.pingToggle.Value && EntrySortManager.IsSortTypeInUse(EntrySortManager.SortType.Ping))
            {
                updateDelegate += (PlayerNet playerNet, PlayerEntry entry, ref StringBuilder tempString) => EntrySortManager.SortPlayer(entry.playerLeftPairEntry);
            }

            if (PlayerListConfig.condensedText.Value)
            {
                separator = "|";
            }
            else
            {
                separator = " | ";
            }

            EntryManager.RefreshPlayerEntries();
        }
        public override void OnConfigChanged()
        {
            updateDelegate = null;
            if (PlayerListConfig.pingToggle.Value)
            {
                updateDelegate += AddPing;
            }
            if (PlayerListConfig.fpsToggle.Value)
            {
                updateDelegate += AddFps;
            }
            if (PlayerListConfig.platformToggle.Value)
            {
                updateDelegate += AddPlatform;
            }
            if (PlayerListConfig.perfToggle.Value)
            {
                updateDelegate += AddPerf;
            }
            if (PlayerListConfig.distanceToggle.Value)
            {
                updateDelegate += AddDistance;
            }
            if (PlayerListConfig.photonIdToggle.Value)
            {
                updateDelegate += AddPhotonId;
            }
            if (PlayerListConfig.ownedObjectsToggle.Value)
            {
                if (VRCUtils.AreRiskyFunctionsAllowed)
                {
                    updateDelegate += AddOwnedObjects;
                }
                else
                {
                    updateDelegate += AddOwnedObjectsSafe;
                }
            }
            if (PlayerListConfig.displayNameToggle.Value)
            {
                if (!emmNameSpoofEnabled)
                {
                    updateDelegate += AddDisplayName;
                }
                else
                {
                    typeof(EmmManager).GetMethod("AddSelfToUpdateDelegate").Invoke(null, null);
                }
            }

            GetPlayerColor();
        }