public void ShowParticipantOptions(GameObject obj, SquadWarParticipantState state) { if (this.opponentState != null && this.opponentState == state) { return; } this.opponentState = state; this.buffBaseData = null; this.Visible = true; this.transformToTrack = obj.transform; this.animator.Play("Off", 0, 1f); this.animator.ResetTrigger("Off"); this.animator.ResetTrigger("ShowBottom"); this.animator.SetTrigger("ShowTop"); SquadWarManager warManager = Service.Get <SquadController>().WarManager; string empty = string.Empty; if (warManager.CanScoutWarMember(this.opponentState.SquadMemberId, ref empty)) { this.scoutMemberButton.VisuallyEnableButton(); this.scoutMemberLabel.TextColor = this.scoutBuffBaseLabel.OriginalTextColor; } else { this.scoutMemberButton.VisuallyDisableButton(); this.scoutMemberLabel.TextColor = UXUtils.COLOR_LABEL_DISABLED; } this.PlayShowAudioClip(); Service.Get <ViewTimeEngine>().RegisterFrameTimeObserver(this); }
public override void RefreshView() { if (!base.IsLoaded()) { return; } SquadWarManager warManager = Service.Get <SquadController>().WarManager; SquadWarSquadType participantSquad = warManager.GetParticipantSquad(this.participantState.SquadMemberId); SquadWarSquadData squadData = warManager.GetSquadData(participantSquad); this.playerNameLabel.Text = this.lang.Get("WAR_PLAYER_DETAILS_NAME", new object[] { this.participantState.SquadMemberName, this.participantState.HQLevel }); this.attacksRemainingLabel.Text = this.lang.Get("WAR_PLAYER_DETAILS_TURNS_LEFT", new object[] { this.participantState.TurnsLeft }); this.uplinksAvailableLabel.Text = this.lang.Get("WAR_PLAYER_DETAILS_POINTS_LEFT", new object[] { this.participantState.VictoryPointsLeft }); FactionIconUpgradeController factionIconUpgradeController = Service.Get <FactionIconUpgradeController>(); int rating = GameUtils.CalculateVictoryRating(this.participantState.AttacksWon, this.participantState.DefensesWon); string icon = factionIconUpgradeController.GetIcon(squadData.Faction, rating); if (factionIconUpgradeController.UseUpgradeImage(rating)) { this.factionSprite.SpriteName = icon; this.factionSprite.Visible = true; this.factionDefaultSprite.Visible = false; } else { this.factionSprite.Visible = false; this.factionDefaultSprite.Visible = true; this.factionDefaultSprite.SpriteName = icon; } string empty = string.Empty; if (warManager.CanScoutWarMember(this.participantState.SquadMemberId, ref empty)) { this.scoutButton.VisuallyEnableButton(); this.scoutButtonLabel.TextColor = this.scoutButtonLabel.OriginalTextColor; } else { this.scoutButton.VisuallyDisableButton(); this.scoutButtonLabel.TextColor = UXUtils.COLOR_LABEL_DISABLED; } this.UpdateUplinkHelper(0, this.participantState.VictoryPointsLeft >= 3, "WAR_PLAYER_DETAILS_REQ_1"); this.UpdateUplinkHelper(1, this.participantState.VictoryPointsLeft >= 2, "WAR_PLAYER_DETAILS_REQ_2"); this.UpdateUplinkHelper(2, this.participantState.VictoryPointsLeft >= 1, "WAR_PLAYER_DETAILS_REQ_3"); }
private void OnScoutMemberClicked(UXButton button) { if (this.opponentState != null) { SquadWarManager warManager = Service.SquadController.WarManager; string empty = string.Empty; if (warManager.CanScoutWarMember(this.opponentState.SquadMemberId, ref empty)) { string squadMemberId = this.opponentState.SquadMemberId; if (warManager.ScoutWarMember(squadMemberId)) { this.Hide(); } } else { Service.UXController.MiscElementsManager.ShowPlayerInstructions(empty); } } }
private void OnScoutClicked(UXButton button) { if (this.participantState != null) { SquadWarManager warManager = Service.Get <SquadController>().WarManager; string empty = string.Empty; if (warManager.CanScoutWarMember(this.participantState.SquadMemberId, ref empty)) { string squadMemberId = this.participantState.SquadMemberId; if (warManager.ScoutWarMember(squadMemberId)) { this.Close(null); return; } } else { Service.Get <UXController>().MiscElementsManager.ShowPlayerInstructions(empty); } } }