private void PopulateCurrentPlayerInfo() { CurrentPlayer currentPlayer = Service.Get <CurrentPlayer>(); bool flag = currentPlayer.NumIdentities > 1; this.groupOneAccount.Visible = !flag; this.groupTwoAccounts.Visible = flag; AccountSyncAccountType accountSyncAccountType; if (flag) { Service.Get <PlayerIdentityController>().GetOtherPlayerIdentity(new PlayerIdentityController.GetOtherPlayerIdentityCallback(this.OnOtherPlayerIdentityFetched)); accountSyncAccountType = this.GetTypeForMultipleAccountId(currentPlayer.PlayerId); } else { accountSyncAccountType = AccountSyncAccountType.SingleAccount; } Squad currentSquad = Service.Get <SquadController>().StateManager.GetCurrentSquad(); this.PopulatePlayerInfo(accountSyncAccountType, currentPlayer.PlayerName, currentPlayer.Map.FindHighestHqLevel(), currentPlayer.PlayerMedals, currentPlayer.Faction, (currentSquad != null) ? currentSquad.SquadName : null); if (accountSyncAccountType == AccountSyncAccountType.MultipleAccountsPrimary || accountSyncAccountType == AccountSyncAccountType.MultipleAccountsSecondary) { AccountSyncAccountType type = (accountSyncAccountType == AccountSyncAccountType.MultipleAccountsPrimary) ? AccountSyncAccountType.MultipleAccountsSecondary : AccountSyncAccountType.MultipleAccountsPrimary; this.ShowPlayerInfoLoading(type); } }
private void ShowPlayerInfoLoading(AccountSyncAccountType type) { UXLabel uXLabel; UXLabel uXLabel2; UXLabel uXLabel3; UXLabel uXLabel4; UXLabel uXLabel5; this.UpdateAndGetLabels(type, out uXLabel, out uXLabel2, out uXLabel3, out uXLabel4, out uXLabel5); uXLabel.Text = this.lang.Get("s_Loading", new object[0]); uXLabel.Visible = true; uXLabel2.Visible = false; uXLabel3.Visible = false; uXLabel4.Visible = false; uXLabel5.Visible = false; }
private void UpdateAndGetLabels(AccountSyncAccountType type, out UXLabel callsignLabel, out UXLabel hqLevelLabel, out UXLabel medalsLabel, out UXLabel factionLabel, out UXLabel squadLabel) { callsignLabel = null; hqLevelLabel = null; medalsLabel = null; factionLabel = null; squadLabel = null; if (type != AccountSyncAccountType.SingleAccount) { if (type != AccountSyncAccountType.MultipleAccountsPrimary) { if (type == AccountSyncAccountType.MultipleAccountsSecondary) { this.groupOneAccount.Visible = false; this.groupTwoAccounts.Visible = true; callsignLabel = base.GetElement <UXLabel>("TwoAccountsLabelCallSignSecondary"); hqLevelLabel = base.GetElement <UXLabel>("TwoAccountsLabelHQLevelSecondary"); medalsLabel = base.GetElement <UXLabel>("TwoAccountsLabelMedalsSecondary"); factionLabel = base.GetElement <UXLabel>("TwoAccountsLabelFactionSecondary"); squadLabel = base.GetElement <UXLabel>("TwoAccountsLabelSquadSecondary"); } } else { this.groupOneAccount.Visible = false; this.groupTwoAccounts.Visible = true; callsignLabel = base.GetElement <UXLabel>("TwoAccountsLabelCallSignPrimary"); hqLevelLabel = base.GetElement <UXLabel>("TwoAccountsLabelHQLevelPrimary"); medalsLabel = base.GetElement <UXLabel>("TwoAccountsLabelMedalsPrimary"); factionLabel = base.GetElement <UXLabel>("TwoAccountsLabelFactionPrimary"); squadLabel = base.GetElement <UXLabel>("TwoAccountsLabelSquadPrimary"); } } else { this.groupOneAccount.Visible = true; this.groupTwoAccounts.Visible = false; callsignLabel = base.GetElement <UXLabel>("OneLabelCallSign"); hqLevelLabel = base.GetElement <UXLabel>("OneLabelHQLevel"); medalsLabel = base.GetElement <UXLabel>("OneLabelMedals"); factionLabel = base.GetElement <UXLabel>("OneLabelFaction"); squadLabel = base.GetElement <UXLabel>("OneLabelSquad"); } }
private void PopulatePlayerInfo(AccountSyncAccountType type, string playerName, int hqLevel, int medals, FactionType faction, string squadName) { UXLabel uXLabel; UXLabel uXLabel2; UXLabel uXLabel3; UXLabel uXLabel4; UXLabel uXLabel5; this.UpdateAndGetLabels(type, out uXLabel, out uXLabel2, out uXLabel3, out uXLabel4, out uXLabel5); uXLabel.Visible = true; uXLabel2.Visible = true; uXLabel3.Visible = true; uXLabel4.Visible = true; uXLabel5.Visible = true; uXLabel.Text = this.lang.Get("ACCOUNT_CONFLICT_CALL_SIGN", new object[] { playerName }); uXLabel2.Text = this.lang.Get("ACCOUNT_CONFLICT_HQ_LEVEL", new object[] { hqLevel }); uXLabel3.Text = this.lang.Get("ACCOUNT_CONFLICT_PLAYER_RATING", new object[] { medals }); uXLabel4.Text = this.lang.Get("ACCOUNT_CONFLICT_FACTION", new object[] { StringUtils.ParseEnum <FactionType>(faction.ToString()) }); if (string.IsNullOrEmpty(squadName)) { squadName = this.lang.Get("general_none", new object[0]); } uXLabel5.Text = this.lang.Get("ACCOUNT_CONFLICT_GUILD_NAME", new object[] { squadName }); }
private void OnOtherPlayerIdentityFetched(PlayerIdentityInfo info) { AccountSyncAccountType typeForMultipleAccountId = this.GetTypeForMultipleAccountId(info.PlayerId); this.PopulatePlayerInfo(typeForMultipleAccountId, info.PlayerName, info.HQLevel, info.Medals, info.Faction, info.SquadName); }