public void AddUserToBattleSelectTable(NodeAddedEvent e, [Combine] TeamScoreTableNode scoreTable, [Context, JoinByBattle, Combine] RoundUserNode roundUser, [JoinByTeam] TeamNode teamNode, [JoinAll] SingleNode <BattleSelectScreenComponent> screen) { if (scoreTable.uiTeam.TeamColor == teamNode.teamColor.TeamColor) { this.AddRow(scoreTable, roundUser); } }
public void InitTeamScoreTables(NodeAddedEvent e, [Combine] TeamScoreTableNode scoreTable, BattleResultsNode battleResults, SingleNode <TeamBattleResultsScreenComponent> screen, [JoinAll] SelfUserNode selfUser, [JoinAll] SingleNode <FriendsComponent> friends) { BattleResultForClient resultForClient = battleResults.battleResults.ResultForClient; ScrollRect component = scoreTable.uiTeam.gameObject.GetComponent <ScrollRect>(); Vector2 vector = new Vector2(); component.content.anchoredPosition = vector; PlayerStatInfoUI rowPrefab = scoreTable.battleResultsScoreTable.rowPrefab; ICollection <UserResult> is2 = null; TeamColor teamColor = scoreTable.uiTeam.TeamColor; if (teamColor == TeamColor.BLUE) { is2 = (resultForClient.Spectator || (resultForClient.PersonalResult.UserTeamColor == TeamColor.BLUE)) ? resultForClient.BlueUsers : resultForClient.RedUsers; } else if (teamColor == TeamColor.RED) { is2 = (resultForClient.Spectator || (resultForClient.PersonalResult.UserTeamColor == TeamColor.BLUE)) ? resultForClient.RedUsers : resultForClient.BlueUsers; } foreach (UserResult result in is2) { PlayerStatInfoUI oui2 = Object.Instantiate <PlayerStatInfoUI>(rowPrefab); bool isSelf = result.UserId == selfUser.userGroup.Key; bool isFriend = friends.component.AcceptedFriendsIds.Contains(result.UserId); bool containerLeft = false; int leagueIndex = result.League.GetComponent <LeagueConfigComponent>().LeagueIndex; bool isDm = false; oui2.Init(leagueIndex, result.Uid, result.Kills, result.Deaths, result.KillAssists, result.ScoreWithoutPremium, !isSelf ? Color.white : scoreTable.scoreTableRowColor.selfRowColor, result.HullId, result.WeaponId, result.UserId, battleResults.battleResults.ResultForClient.BattleId, result.AvatarId, isSelf, isDm, isFriend, containerLeft, false); oui2.transform.SetParent(component.content, false); } }
private void AddRow(TeamScoreTableNode scoreTable, RoundUserNode roundUser) { Entity entity = scoreTable.scoreTable.AddRow().GetComponent <EntityBehaviour>().Entity; entity.AddComponent(new ScoreTableGroupComponent(scoreTable.scoreTableGroup.Key)); entity.AddComponent(new UserGroupComponent(roundUser.userGroup.Key)); }
public void InitRowsCache(NodeAddedEvent e, [Combine] TeamScoreTableNode scoreTable, [Context, JoinByBattle] BattleNode battle, [JoinAll] SingleNode <BattleScreenComponent> screen) { scoreTable.scoreTable.InitRowsCache(battle.userLimit.TeamLimit, scoreTable.scoreTableUserRowIndicators.indicators); scoreTable.Entity.AddComponent <ScoreTableRowsCacheInitedComponent>(); }
public void RemovePrerequisite(NodeRemoveEvent e, [Combine] ScoreTableRowNode scoreTableRow, [JoinByScoreTable] TeamScoreTableNode scoreTable, [JoinByScoreTable] ICollection <ScoreTableRowNode> rows) { if (rows.Count <= 1) { scoreTable.visibilityPrerequisites.AddHidePrerequisite(this.HIDE_WHEN_EMPTY, false); } }
public void HideEmptyScoreTable(NodeAddedEvent e, [Combine] TeamScoreTableNode teamScoreTable) { teamScoreTable.visibilityPrerequisites.AddHidePrerequisite(this.HIDE_WHEN_EMPTY, false); }
public void AddPrerequisite(NodeAddedEvent e, [Combine] ScoreTableRowNode scoreTableRow, [JoinByScoreTable] TeamScoreTableNode scoreTable) { scoreTable.visibilityPrerequisites.RemoveHidePrerequisite(this.HIDE_WHEN_EMPTY, false); }