Beispiel #1
0
 private void SetupSquadWarStartedTransmission(TransmissionVO transmission)
 {
     this.battleLogTransmission.Visible = false;
     this.ShowGenericTransmissionGroup(false);
     this.conflictContainer.Visible            = false;
     this.squadWarEndedContainer.Visible       = false;
     this.genericTransmissionTextGroup.Visible = true;
     this.SetupTransmissionButtons(transmission);
     this.genericTransmissionTitle.Text = this.lang.Get(LangUtils.AppendPlayerFactionToKey("transm_war_start_title"), new object[0]);
     this.genericTransmissionBody.Text  = this.lang.Get(LangUtils.AppendPlayerFactionToKey("transm_war_start_body"), new object[0]);
 }
Beispiel #2
0
        public TransmissionsHolonetTab(HolonetScreen holoScreen, HolonetControllerType holonetControllerType) : base(holoScreen, holonetControllerType)
        {
            base.InitializeTab("TransmissionsLogTab", "hn_transmissions_tab");
            List <TransmissionVO> transmissions = Service.HolonetController.TransmissionsController.Transmissions;
            int count = transmissions.Count;

            this.table = holoScreen.GetElement <UXTable>("TransmissionsLogTable");
            this.table.SetTemplateItem("TransmissionsLogItem");
            string title = string.Empty;
            string body  = string.Empty;

            for (int i = 0; i < count; i++)
            {
                bool           flag           = false;
                TransmissionVO transmissionVO = transmissions[i];
                switch (transmissionVO.Type)
                {
                case TransmissionType.Research:
                    title = this.lang.Get("hn_transmission_research_title", new object[]
                    {
                        this.GetResearchDisplayName(transmissionVO.TransData)
                    });
                    body = this.lang.Get("hn_transmission_research_body", new object[]
                    {
                        this.GetResearchDisplayName(transmissionVO.TransData),
                        transmissionVO.Btn1Data
                    });
                    flag = true;
                    break;

                case TransmissionType.HqUpgrade:
                    title = this.lang.Get("hn_transmission_hqupgrade_title", new object[0]);
                    body  = this.lang.Get("hn_transmission_hqupgrade_body", new object[]
                    {
                        transmissionVO.Btn1Data
                    });
                    flag = true;
                    break;

                case TransmissionType.NavigationCenterUpgrade:
                    title = this.lang.Get("hn_transmission_pcupgrade_title", new object[0]);
                    body  = this.lang.Get("hn_transmission_pcupgrade_body", new object[]
                    {
                        transmissionVO.Btn1Data
                    });
                    flag = true;
                    break;

                case TransmissionType.Conflict:
                {
                    string text  = string.Empty;
                    string text2 = string.Empty;
                    StaticDataController staticDataController = Service.StaticDataController;
                    TournamentVO         optional             = staticDataController.GetOptional <TournamentVO>(transmissionVO.TransData);
                    TournamentTierVO     optional2            = staticDataController.GetOptional <TournamentTierVO>(transmissionVO.Btn1Data);
                    if (optional != null && optional2 != null)
                    {
                        text  = LangUtils.GetPlanetDisplayName(optional.PlanetId);
                        text2 = this.lang.Get(optional2.RankName, new object[0]) + " " + this.lang.Get(optional2.Division, new object[0]);
                    }
                    title = this.lang.Get("hn_transmission_conflict_title", new object[0]);
                    body  = this.lang.Get("hn_transmission_conflict_body", new object[]
                        {
                            text,
                            text2
                        });
                    flag = true;
                    break;
                }

                case TransmissionType.WarPreparation:
                    title = this.lang.Get(LangUtils.AppendPlayerFactionToKey("transm_war_prep_title"), new object[0]);
                    body  = this.lang.Get(LangUtils.AppendPlayerFactionToKey("transm_war_prep_body"), new object[0]);
                    flag  = true;
                    break;

                case TransmissionType.WarStart:
                    title = this.lang.Get(LangUtils.AppendPlayerFactionToKey("transm_war_start_title"), new object[0]);
                    body  = this.lang.Get(LangUtils.AppendPlayerFactionToKey("transm_war_start_body"), new object[0]);
                    flag  = true;
                    break;

                case TransmissionType.WarEnded:
                    title = this.lang.Get(LangUtils.AppendPlayerFactionToKey("transm_war_end_title"), new object[0]);
                    body  = this.lang.Get(LangUtils.AppendPlayerFactionToKey("transm_war_end_body"), new object[0]);
                    flag  = true;
                    break;

                case TransmissionType.SquadChange:
                {
                    object[] array = (transmissionVO.TransData ?? string.Empty).Split(new char[]
                        {
                            '\\'
                        });
                    if (array.Length > 1)
                    {
                        title = this.lang.Get("hn_squad_application_accepted_title", new object[]
                            {
                                array[1]
                            });
                        body = this.lang.Get("hn_squad_application_accepted_body", array);
                    }
                    flag = true;
                    break;
                }

                case TransmissionType.GuildLevelUp:
                    title = this.lang.Get("hn_perks_squad_level_up_title", new object[0]);
                    body  = this.lang.Get("hn_perks_squad_level_up_body", new object[]
                    {
                        transmissionVO.SquadLevel
                    });
                    flag = true;
                    break;

                case TransmissionType.DailyCrateReward:
                {
                    title = this.lang.Get("hn_daily_crate_reward_title", new object[0]);
                    CrateVO crateVO = Service.StaticDataController.Get <CrateVO>(transmissionVO.CrateId);
                    body = this.lang.Get("hn_daily_crate_reward_body", new object[]
                        {
                            LangUtils.GetCrateDisplayName(crateVO)
                        });
                    flag = true;
                    break;
                }
                }
                if (flag)
                {
                    this.AddCustomTransmission(transmissionVO, title, body, i);
                }
                else
                {
                    this.AddGenericTransmission(transmissionVO, i);
                }
            }
        }
Beispiel #3
0
        private void SetupConflictTransmission(TransmissionVO transmission)
        {
            this.battleLogTransmission.Visible = false;
            this.ShowGenericTransmissionGroup(false);
            this.conflictContainer.Visible            = true;
            this.squadWarEndedContainer.Visible       = false;
            this.genericTransmissionTextGroup.Visible = false;
            this.SetupTransmissionButtons(transmission);
            IDataController dataController = Service.Get <IDataController>();
            CurrentPlayer   currentPlayer  = Service.Get <CurrentPlayer>();

            this.conflictEndVO = dataController.GetOptional <TournamentVO>(transmission.TransData);
            TournamentTierVO optional = dataController.GetOptional <TournamentTierVO>(transmission.Btn1Data);

            if (this.conflictEndVO == null || optional == null)
            {
                return;
            }
            Tournament tournament = currentPlayer.TournamentProgress.GetTournament(this.conflictEndVO.Uid);

            if (tournament == null)
            {
                Service.Get <StaRTSLogger>().ErrorFormat("Tournament doesn't exist for player. tournament {0}", new object[]
                {
                    this.conflictEndVO.Uid
                });
                this.conflictMessage.Visible  = false;
                this.conflictTierIcon.Visible = false;
                return;
            }
            TournamentRank finalRank = tournament.FinalRank;
            string         text      = LangUtils.AppendPlayerFactionToKey("hn_conflict_end_message");

            this.conflictMessage.Visible  = true;
            this.conflictTierIcon.Visible = true;
            this.conflictMessage.Text     = this.lang.Get(text.ToString(), new object[]
            {
                LangUtils.GetPlanetDisplayName(this.conflictEndVO.PlanetId)
            });
            this.conflictTierIcon.SpriteName = Service.Get <TournamentController>().GetTierIconName(optional);
            this.conflictTierTitle.Text      = this.lang.Get("s_YourTier", new object[0]);
            this.conflictTierLevel.Text      = this.lang.Get("CONFLICT_LEAGUE_AND_DIVISION", new object[]
            {
                this.lang.Get(optional.RankName, new object[0]),
                this.lang.Get(optional.DivisionSmall, new object[0])
            });
            this.conflictTierPercent.Text = this.lang.Get("CONFLICT_TIER_PERCENTILE", new object[]
            {
                Math.Round(finalRank.Percentile, 2)
            });
            bool flag = TimedEventPrizeUtils.TrySetupConflictEndedRewardView(tournament.RedeemedRewards, this.holonetScreen.GetElement <UXLabel>("LabelReward"), this.holonetScreen.GetElement <UXSprite>("SpriteReward"));

            if (flag)
            {
                this.holonetScreen.GetElement <UXLabel>("LabelRewardTitle").Text = this.lang.Get("CONFLICT_END_PRIZE", new object[0]);
            }
            else
            {
                Service.Get <StaRTSLogger>().ErrorFormat("There is no reward given to player for tournament {0}", new object[]
                {
                    this.conflictEndVO.Uid
                });
            }
            Service.Get <ViewTimerManager>().CreateViewTimer(0.5f, false, new TimerDelegate(this.ShowReward), null);
        }