public override void Init(object[] parameters) { isSelf = true; EntryManager.localPlayerEntry = this; player = Player.prop_Player_0; apiUser = player.prop_APIUser_0; userId = apiUser.id; gameObject.GetComponent <UnityEngine.UI.Button>().onClick.AddListener(new Action(() => UiManager.OpenUserInQuickMenu(player))); platform = PlayerUtils.GetPlatform(player).PadRight(2); // Join event runs after avatar instantiation event so perf calculations *should* be finished (also not sure if this will throw null refs so gonna release without a check and hope for the best) perf = PerformanceRating.None; perfString = "<color=#" + ColorUtility.ToHtmlStringRGB(VRCUiAvatarStatsPanel.Method_Private_Static_Color_AvatarPerformanceCategory_PerformanceRating_0(AvatarPerformanceCategory.Overall, perf)) + ">" + PlayerUtils.ParsePerformanceText(perf) + "</color>"; NetworkEvents.OnPlayerJoined += new Action <Player>((player) => { int highestId = 0; foreach (int photonId in PlayerManager.prop_PlayerManager_0.field_Private_Dictionary_2_Int32_Player_0.Keys) { if (photonId > highestId) { highestId = photonId; } } highestPhotonIdLength = highestId.ToString().Length; }); GetPlayerColor(); OnConfigChanged(); }
public override void Init(object[] parameters) { player = (Player)parameters[0]; apiUser = player.prop_APIUser_0; userId = apiUser.id; platform = platform = PlayerUtils.GetPlatform(player).PadRight(2); perf = PerformanceRating.None; perfString = "<color=#" + ColorUtility.ToHtmlStringRGB(VRCUiAvatarStatsPanel.Method_Private_Static_Color_AvatarPerformanceCategory_PerformanceRating_0(AvatarPerformanceCategory.Overall, perf)) + ">" + PlayerUtils.ParsePerformanceText(perf) + "</color>"; gameObject.GetComponent <UnityEngine.UI.Button>().onClick.AddListener(new Action(() => UiManager.OpenUserInQuickMenu(player))); isFriend = APIUser.IsFriendsWith(apiUser.id); GetPlayerColor(false); }