コード例 #1
0
        private void InitCurrentPlayerInfo()
        {
            CurrentPlayer currentPlayer = Service.CurrentPlayer;
            string        str           = (this.currentFaction != FactionType.Empire) ? "Rebel" : "Empire";
            Color         textColor     = base.GetElement <UXLabel>("LabelCallsignName" + str).TextColor;

            base.GetElement <UXLabel>("LabelFactionCurrent").Text  = ((this.currentFaction != FactionType.Empire) ? this.lang.Get("FACTION_FLIP_CURRENT_BASE_REBEL", new object[0]) : this.lang.Get("FACTION_FLIP_CURRENT_BASE_EMPIRE", new object[0]));
            base.GetElement <UXLabel>("LabelCallsignCurrent").Text = this.lang.Get("FACTION_FLIP_CALL_SIGN", new object[0]);
            UXLabel element = base.GetElement <UXLabel>("LabelCallsignNameCurrent");

            element.Text      = currentPlayer.PlayerName;
            element.TextColor = textColor;
            base.GetElement <UXLabel>("LabelHQLEVELOther").Text = this.lang.Get("FACTION_FLIP_HQ_LEVEL", new object[]
            {
                string.Empty
            });
            UXLabel element2 = base.GetElement <UXLabel>("LabelHQLEVELCountOther");

            element2.Text      = currentPlayer.Map.FindHighestHqLevel().ToString();
            element2.TextColor = textColor;
            base.GetElement <UXLabel>("LabelMedalOther").Text = this.lang.Get("FACTION_FLIP_MEDALS_CURRENT", new object[0]);
            UXLabel element3 = base.GetElement <UXLabel>("LabelMedalCountOther");

            element3.Text      = currentPlayer.PlayerMedals.ToString();
            element3.TextColor = textColor;
            base.GetElement <UXLabel>("LabelSquadOther").Text = this.lang.Get("FACTION_FLIP_SQUAD", new object[0]);
            UXLabel element4     = base.GetElement <UXLabel>("LabelSquadNameOther");
            Squad   currentSquad = Service.SquadController.StateManager.GetCurrentSquad();

            element4.Text      = ((currentSquad == null) ? this.lang.Get("general_none", new object[0]) : currentSquad.SquadName);
            element4.TextColor = textColor;
        }
コード例 #2
0
        protected override void OnScreenLoaded()
        {
            base.OnScreenLoaded();
            this.ToggleParentScreenVisibility(false);
            this.InitButtons();
            UXButton element  = base.GetElement <UXButton>("BtnTroopPrev");
            UXButton element2 = base.GetElement <UXButton>("BtnTroopNext");

            if (this.equipmentList != null && this.equipmentList.Count > 1)
            {
                element.Visible    = true;
                element2.Visible   = true;
                element.Tag        = -1;
                element2.Tag       = 1;
                element.OnClicked  = new UXButtonClickedDelegate(this.OnPrevOrNextButtonClicked);
                element2.OnClicked = new UXButtonClickedDelegate(this.OnPrevOrNextButtonClicked);
            }
            else
            {
                element.Visible  = false;
                element2.Visible = false;
            }
            UXButton element3 = base.GetElement <UXButton>("BtnBack");

            element3.OnClicked       = new UXButtonClickedDelegate(this.OnBackButtonClicked);
            base.CurrentBackDelegate = new UXButtonClickedDelegate(this.OnBackButtonClicked);
            base.CurrentBackButton   = element3;
            this.labelUpgradeTime    = base.GetElement <UXLabel>("LabelUpgradeTime");
            Service.EventManager.RegisterObserver(this, EventId.ContractCompleted);
            this.Redraw();
        }
コード例 #3
0
        protected override void OnScreenLoaded()
        {
            this.InitButtons();
            UXLabel  element  = base.GetElement <UXLabel>("LabelItem1");
            UXLabel  element2 = base.GetElement <UXLabel>("LabelItem2");
            UXLabel  element3 = base.GetElement <UXLabel>("LabelItem3");
            UXSprite element4 = base.GetElement <UXSprite>("SpriteRewardItem1");
            UXSprite element5 = base.GetElement <UXSprite>("SpriteRewardItem2");
            UXSprite element6 = base.GetElement <UXSprite>("SpriteRewardItem3");

            this.characterSprite1                = base.GetElement <UXSprite>("SpriteCharacter1");
            this.characterSprite2                = base.GetElement <UXSprite>("SpriteCharacter2");
            this.itemLabels[0]                   = element;
            this.itemLabels[1]                   = element2;
            this.itemLabels[2]                   = element3;
            this.itemSprites[0]                  = element4;
            this.itemSprites[1]                  = element5;
            this.itemSprites[2]                  = element6;
            this.purchaseButton                  = base.GetElement <UXButton>("BtnPrimary");
            this.purchaseButton.OnClicked        = new UXButtonClickedDelegate(this.OnPurchaseButtonClicked);
            this.purchaseIAPButtonLabel          = base.GetElement <UXLabel>("LabelBtnPrimary");
            this.purchaseWithCurrencyButtonLabel = base.GetElement <UXLabel>("LabelBtnSecondary");
            this.purchaseWithCurrencySprite      = base.GetElement <UXSprite>("SpriteCurrency");
            this.timerLabel  = base.GetElement <UXLabel>("LabelTimer");
            this.valueLabel  = base.GetElement <UXLabel>("LabelValueStatement");
            this.value2Label = base.GetElement <UXLabel>("LabelValueStatement2");
            this.UpdateElements();
            Animator component = base.Root.GetComponent <Animator>();

            if (component != null)
            {
                component.SetTrigger("show");
            }
            Service.ViewTimeEngine.RegisterClockTimeObserver(this, 1f);
        }
コード例 #4
0
        private void InitLabels()
        {
            if (this.centerTitle)
            {
                this.titleLabel = base.GetElement <UXLabel>("LabelTitleCenter");
                base.GetElement <UXLabel>("LabelTitle").Visible = false;
            }
            else
            {
                this.titleLabel = base.GetElement <UXLabel>("LabelTitle");
                base.GetElement <UXLabel>("LabelTitleCenter").Visible = false;
            }
            this.centerLabel      = base.GetElement <UXLabel>("LabelBody");
            this.rightLabel       = base.GetElement <UXLabel>("LabelBodyWImage");
            this.primaryLabel     = base.GetElement <UXLabel>("LabelBtnPrimary");
            this.primary2Option   = base.GetElement <UXLabel>("LabelBtnPrimary_2option");
            this.secondary2Option = base.GetElement <UXLabel>("LabelBtnSecondary");
            this.centerLabel.Text = string.Empty;
            this.rightLabel.Text  = string.Empty;
            UXElement element = base.GetElement <UXElement>("TitleGroupPerks");

            element.Visible               = false;
            this.costRequirement          = base.GetElement <UXElement>("Requirement");
            this.buttonOption2            = base.GetElement <UXElement>("2option");
            this.labelBodyRequirement     = base.GetElement <UXLabel>("LabelBodyRequirement");
            this.labelStarProgress        = base.GetElement <UXLabel>("LabelStarProgress");
            this.requirementSlider        = base.GetElement <UXSlider>("pBarStarProgress");
            this.labelSkip                = base.GetElement <UXLabel>("LabelSkip");
            this.labelSkip.Text           = this.lang.Get("s_SKIP", new object[0]);
            this.labelSkipCost            = base.GetElement <UXLabel>("SkipCostLabel");
            this.labelTimer               = base.GetElement <UXLabel>("TickerDialogSmall");
            this.requirementLabel         = base.GetElement <UXLabel>("LabelRequirement");
            this.requirementLabel.Visible = false;
        }
コード例 #5
0
 public EpisodeWidgetView(UXFactory factory)
 {
     this.widgetBtn                   = factory.GetElement <UXButton>("Episode");
     this.widgetBtn.OnClicked         = new UXButtonClickedDelegate(this.OnWidgetClicked);
     this.titleLabel                  = factory.GetElement <UXLabel>("LabelTitleEpisode");
     this.noticeLabel                 = factory.GetElement <UXLabel>("LabelNoticeEpisode");
     this.titleLabelComplete          = factory.GetElement <UXLabel>("LabelStatus");
     this.noticeLabelComplete         = factory.GetElement <UXLabel>("LabelCTA");
     this.bgTexture                   = factory.GetElement <UXTexture>("TextureEpisodeBg");
     this.iconTexture                 = factory.GetElement <UXTexture>("TextureEpisodeIcon");
     this.borderTexture               = factory.GetElement <UXElement>("ParticleBorder");
     this.titleInitAnchorOffsetLeft   = this.titleLabel.GetLabelAnchorOffset(UXAnchorSection.Left);
     this.noticeInitAnchorOffsetLeft  = this.noticeLabel.GetLabelAnchorOffset(UXAnchorSection.Left);
     this.widgetCircleTimer           = factory.GetElement <UXElement>("WidgetCircleTimer");
     this.pBarCircleTimer             = factory.GetElement <UXSlider>("pBarCircleTimer");
     this.progressSlider              = factory.GetElement <UXSlider>("pBarEpisodeProgress");
     this.progressSliderGoal          = factory.GetElement <UXSlider>("pBarEpisodeProgressDelta");
     this.progressLabel               = factory.GetElement <UXLabel>("LabelEpisodeProgress");
     this.progressEarnedToast         = factory.GetElement <UXElement>("WidgetEpisodeProgress");
     this.progressEarnedToast.Visible = false;
     this.showTimer                   = false;
     this.needToShowCTA               = false;
     this.showingCTA                  = false;
     this.lang = Service.Lang;
     this.ForceHide();
 }
コード例 #6
0
 protected override void InitLabels()
 {
     base.GetElement <UXLabel>("AttackerLabelGained").Visible    = false;
     base.GetElement <UXLabel>("DefenderLabelAvailable").Visible = false;
     base.GetElement <UXLabel>("LabelDamage").Text = this.lang.Get("s_Damage", new object[0]);
     this.resultLabel             = base.GetElement <UXLabel>("LabelBattleResult");
     this.resultFailureTitleLabel = base.GetElement <UXLabel>("LabelMissionResultTitle");
     this.troopsLabel             = base.GetElement <UXLabel>("LabelTroops");
     this.rewardLabel             = base.GetElement <UXLabel>("LabelRewardSuccess");
     this.rewardLabel.Visible     = false;
     if (this.isNonAttackerReplayView)
     {
         base.GetElement <UXLabel>("TitleBarLabelStars").Text = this.lang.Get("s_Attacker_Earned", new object[0]);
         this.percentLabel         = base.GetElement <UXLabel>("ReplayDamageAmount");
         this.creditsLabel         = base.GetElement <UXLabel>("AttackerLabelCurrencyValueHome");
         this.materialLabel        = base.GetElement <UXLabel>("AttackerLabelMaterialValueHome");
         this.contrabandLabel      = base.GetElement <UXLabel>("AttackerLabelContrabandValueHome");
         this.replayLostCredits    = base.GetElement <UXLabel>("DefenderLabelCurrencyValueHome");
         this.replayLostMaterials  = base.GetElement <UXLabel>("LabelLabelMaterialValueHome");
         this.replayLostContraband = base.GetElement <UXLabel>("DefenderLabelContrabandValueHome");
         this.replayAttackerName   = base.GetElement <UXLabel>("AttackerLabelName");
         this.replayDefenderName   = base.GetElement <UXLabel>("DefenderLabelName");
         this.replayAttackerTournamentRatingLabel = base.GetElement <UXLabel>("AttackerLabelTournamentMedals");
         this.replayDefenderTournamentRatingLabel = base.GetElement <UXLabel>("LabelDefenderTournamentMedals");
         this.replayAttackerTournamentRatingIcon  = base.GetElement <UXSprite>("AttackerSpriteIcoTournamentMedals");
         this.replayDefenderTournamentRatingIcon  = base.GetElement <UXSprite>("LabelSpriteIcoDefenderTournamentMedals");
     }
     else
     {
         this.percentLabel = base.GetElement <UXLabel>("LabelBattleDescription");
     }
     base.InitLabels();
 }
コード例 #7
0
 protected override void OnScreenLoaded()
 {
     this.title                       = base.GetElement <UXLabel>("LabelDialogTitleNR");
     this.message                     = base.GetElement <UXLabel>("LabelTopMessageNR");
     this.messageBorderStroke         = base.GetElement <UXSprite>("SpriteBGMessageStrokeNR");
     this.rewardSectionTitle          = base.GetElement <UXLabel>("LabelRewardsTitleNR");
     this.leftContainerBtn            = base.GetElement <UXButton>("CrateContainerLeftNR");
     this.midContainerBtn             = base.GetElement <UXButton>("CrateContainerMiddleNR");
     this.rightContainerBtn           = base.GetElement <UXButton>("CrateContainerRightNR");
     this.leftCrateSprite             = base.GetElement <UXSprite>("SpriteCrateLeftNR");
     this.midCrateSprite              = base.GetElement <UXSprite>("SpriteCrateMiddleNR");
     this.rightCrateSprite            = base.GetElement <UXSprite>("SpriteCrateRightNR");
     this.oneStarLabel                = base.GetElement <UXLabel>("LabelRequirementsOneStarNR");
     this.twoStarLabel                = base.GetElement <UXLabel>("LabelRequirementsTwoStarNR");
     this.threeStarLabel              = base.GetElement <UXLabel>("LabelRequirementsThreeStarNR");
     this.rewardBGTexture             = base.GetElement <UXTexture>("TextureBGRewardsNR");
     this.raidTimer                   = base.GetElement <UXLabel>("TickerNR");
     this.okBtn                       = base.GetElement <UXButton>("ButtonOneOptionNR");
     this.okLabel                     = base.GetElement <UXLabel>("LabelOneOptionNR");
     this.confirmBtn                  = base.GetElement <UXButton>("ButtonTwoOptionRightNR");
     this.confirmLabel                = base.GetElement <UXLabel>("LabelTwoOptionRightNR");
     this.cancelBtn                   = base.GetElement <UXButton>("ButtonTwoOptionLeftNR");
     this.cancelLabel                 = base.GetElement <UXLabel>("LabelTwoOptionLeftNR");
     this.okLabel.Text                = this.lang.Get("s_Ok", new object[0]);
     this.okBtn.OnClicked             = new UXButtonClickedDelegate(this.OnCloseButtonClicked);
     this.leftContainerBtn.OnClicked  = new UXButtonClickedDelegate(this.OnCrateClicked);
     this.midContainerBtn.OnClicked   = new UXButtonClickedDelegate(this.OnCrateClicked);
     this.rightContainerBtn.OnClicked = new UXButtonClickedDelegate(this.OnCrateClicked);
     this.InitButtons();
     this.RefreshRaidView();
     Service.ViewTimeEngine.RegisterClockTimeObserver(this, 1f);
 }
コード例 #8
0
        protected override void OnScreenLoaded()
        {
            this.InitButtons();
            UXTexture   element = base.GetElement <UXTexture>("SquadImage");
            FactionType faction = Service.CurrentPlayer.Faction;

            if (faction != FactionType.Empire)
            {
                if (faction == FactionType.Rebel)
                {
                    element.LoadTexture("SquadIntro_r");
                }
            }
            else
            {
                element.LoadTexture("SquadIntro_e");
            }
            UXLabel element2 = base.GetElement <UXLabel>("LabelTitle");

            element2.Text = this.lang.Get("SQUAD_JOIN_OR_CREATE", new object[0]);
            UXLabel element3 = base.GetElement <UXLabel>("LabelSquadIntro");

            element3.Text = this.lang.Get("SQUAD_INTRO", new object[0]);
            UXLabel element4 = base.GetElement <UXLabel>("LabelCreateSquad");

            element4.Text = this.lang.Get("CREATE_SQUAD", new object[0]);
            UXLabel element5 = base.GetElement <UXLabel>("LabelJoinSquad");

            element5.Text = this.lang.Get("JOIN_A_SQUAD", new object[0]);
        }
コード例 #9
0
        protected override void OnScreenLoaded()
        {
            base.GetElement <UXElement>("InputFieldRequestMessageWar").Visible = false;
            base.GetElement <UXElement>("TitleGroupPerks").Visible             = false;
            this.InitButtons();
            this.buttonLabel            = base.GetElement <UXLabel>("LabelBtnSend");
            this.buttonLabel.Text       = this.lang.Get("BUTTON_SEND", new object[0]);
            this.requestLabel           = base.GetElement <UXLabel>("LabelRequestTroops");
            this.troopsPanel            = base.GetElement <UXElement>("PanelCurrentTroops");
            this.troopsLabel            = base.GetElement <UXLabel>("LabelCurrentTroops");
            this.requestLabel.Visible   = false;
            this.troopsPanel.Visible    = false;
            this.troopsLabel.Visible    = false;
            this.instructionsLabel      = base.GetElement <UXLabel>("LabelTroopIncrement");
            this.requestPerksLabel      = base.GetElement <UXLabel>("LabelRequestTroopsPerks");
            this.instructionsPerksLabel = base.GetElement <UXLabel>("LabelTroopIncrementPerks");
            this.input = base.GetElement <UXInput>("LabelInputNameSquad");
            UIInput uIInputComponent = this.input.GetUIInputComponent();
            UIInput arg_11F_0        = uIInputComponent;

            if (AbstractSquadRequestScreen.< > f__mg$cache0 == null)
            {
                AbstractSquadRequestScreen.< > f__mg$cache0 = new UIInput.OnValidate(LangUtils.OnValidateWNewLines);
            }
            arg_11F_0.onValidate = AbstractSquadRequestScreen.< > f__mg$cache0;
        }
コード例 #10
0
        private void InitSearch()
        {
            this.searchBtnOverlay           = base.GetElement <UXButton>("BtnSearchWindow");
            this.searchBtnOverlay.OnClicked = new UXButtonClickedDelegate(this.SearchClicked);
            this.searchBtnOverlay.Enabled   = false;
            UXLabel element = base.GetElement <UXLabel>("LabelBtnSearchWindow");

            element.Text                         = this.lang.Get("s_Search", new object[0]);
            this.searchInput                     = base.GetElement <UXInput>("LabelInputNameSquad");
            this.searchInstructionsLabel         = base.GetElement <UXLabel>("LabelSearchInstructions");
            this.searchInstructionsLabel.Text    = this.lang.Get("SEARCH_INSTRUCTIONS", new object[0]);
            this.searchInstructionsLabel.Visible = true;
            this.searchInput.Text                = string.Empty;
            this.searchInput.InitText(this.lang.Get("s_Search", new object[0]));
            UIInput uIInputComponent = this.searchInput.GetUIInputComponent();
            UIInput arg_106_0        = uIInputComponent;

            if (SquadJoinScreen.< > f__mg$cache0 == null)
            {
                SquadJoinScreen.< > f__mg$cache0 = new UIInput.OnValidate(LangUtils.OnValidateWSpaces);
            }
            arg_106_0.onValidate = SquadJoinScreen.< > f__mg$cache0;
            EventDelegate item = new EventDelegate(new EventDelegate.Callback(this.OnChange));

            uIInputComponent.onChange.Add(item);
        }
コード例 #11
0
        public BuildingTooltip(UXFactory factory, UXElement tooltipElement, string subElementPrefix, string parentName, BuildingTooltipKind kind)
        {
            this.TooltipElement = tooltipElement;
            this.Kind           = kind;
            this.lastTimeLeft   = 0f;
            this.lastTimeTotal  = 0f;
            string name = UXUtils.FormatAppendedName(subElementPrefix + "LabelName", parentName);

            this.titleLabel = factory.GetElement <UXLabel>(name);
            string name2 = UXUtils.FormatAppendedName(subElementPrefix + "LabelLevel", parentName);

            this.levelLabel = factory.GetElement <UXLabel>(name2);
            string name3 = UXUtils.FormatAppendedName(subElementPrefix + "Label", parentName);

            this.bubbleLabel = factory.GetOptionalElement <UXLabel>(name3);
            string name4 = UXUtils.FormatAppendedName(subElementPrefix + "SpriteBkg", parentName);

            this.bubbleSprite = factory.GetOptionalElement <UXSprite>(name4);
            string name5 = UXUtils.FormatAppendedName(subElementPrefix + "PbarLabelTime", parentName);

            this.timeLabel = factory.GetOptionalElement <UXLabel>(name5);
            string name6 = UXUtils.FormatAppendedName(subElementPrefix + "Pbar", parentName);

            this.progressSlider = factory.GetOptionalElement <UXSlider>(name6);
            string name7 = UXUtils.FormatAppendedName(subElementPrefix + "SpriteImage", parentName);

            this.iconSprite = factory.GetOptionalElement <UXSprite>(name7);
            string name8 = UXUtils.FormatAppendedName(subElementPrefix + "Selected", parentName);

            this.selectedGroup = factory.GetOptionalElement <UXElement>(name8);
            this.SetupBGBasedOnKind();
        }
コード例 #12
0
        public void OnViewFrameTime(float dt)
        {
            List <UXElement>   elementList          = this.gridWarLog.GetElementList();
            SquadController    squadController      = Service.SquadController;
            uint               serverTime           = Service.ServerAPI.ServerTime;
            SquadMemberWarData currentMemberWarData = squadController.WarManager.GetCurrentMemberWarData();
            int i     = 0;
            int count = elementList.Count;

            while (i < count)
            {
                string             text         = elementList[i].Tag as string;
                UXLabel            subElement   = this.gridWarLog.GetSubElement <UXLabel>(text, "LabelWarlogExpires");
                SquadWarRewardData rewardForWar = SquadUtils.GetRewardForWar(text, currentMemberWarData);
                if (rewardForWar != null)
                {
                    int num = (int)(rewardForWar.ExpireDate - serverTime);
                    if (num < 0)
                    {
                        this.HideCollectButton(text);
                    }
                    else
                    {
                        string text2 = LangUtils.FormatTime((long)num);
                        subElement.Visible = true;
                        subElement.Text    = text2;
                    }
                }
                else
                {
                    this.HideCollectButton(text);
                }
                i++;
            }
        }
コード例 #13
0
        private void InitExpirationLabel()
        {
            TargetedBundleController targetedBundleController = Service.Get <TargetedBundleController>();

            this.expirationLabel = base.GetElement <UXLabel>("LabelCrateExpireTimer");
            if (this.ModalReason == CrateInfoReason.Reason_Store_Buy && this.targetLEIVO != null)
            {
                UXUtils.SetLeiExpirationTimerLabel(this.targetLEIVO, this.expirationLabel, this.lang);
                Service.Get <ViewTimeEngine>().RegisterClockTimeObserver(this, 1f);
                return;
            }
            if (this.ModalReason == CrateInfoReason.Reason_Inventory_Open && this.crateData != null)
            {
                UXUtils.SetCrateExpirationTimerLabel(this.crateData, this.expirationLabel, this.lang);
                if (this.crateData.DoesExpire)
                {
                    Service.Get <ViewTimeEngine>().RegisterClockTimeObserver(this, 1f);
                    return;
                }
            }
            else
            {
                if (this.ModalReason == CrateInfoReason.Reason_Targeted_Offer)
                {
                    UXUtils.SetCrateTargetedOfferTimerLabel(targetedBundleController.OfferExpiresAt, this.expirationLabel, this.lang);
                    Service.Get <ViewTimeEngine>().RegisterClockTimeObserver(this, 1f);
                    return;
                }
                this.expirationLabel.Visible = false;
            }
        }
コード例 #14
0
        private void InitSlider()
        {
            UXLabel element = base.GetElement <UXLabel>("LabelLoading");

            element.Text       = Service.Lang.Get("LOADING", new object[0]);
            this.loadingSlider = base.GetElement <UXSlider>("PBarLoading");
        }
コード例 #15
0
        public void OnScreenLoaded()
        {
            this.chapterActionButtonLabel = this.screen.GetElement <UXLabel>("LabelBtnChapterAction");
            this.pveMeshTexture           = this.screen.GetElement <UXMeshRenderer>("MeshPVEImage");
            this.chapterJewel             = this.screen.GetElement <UXElement>("ContainerJewelChapter");
            this.chapterButtonBackground  = this.screen.GetElement <UXSprite>("SpriteBkgBtnChapterAction");
            this.chapterStarsSprite       = this.screen.GetElement <UXSprite>("SpriteChapterSelectionStar");
            this.chapterLabel             = this.screen.GetElement <UXLabel>("LabelChapterNumber");
            this.nameLabel                         = this.screen.GetElement <UXLabel>("LabelChapterTitle");
            this.nameLabel.Visible                 = false;
            this.nameLabelOperationsLocked         = this.screen.GetElement <UXLabel>("LabelOperationsLocked");
            this.nameLabelOperationsLocked.Visible = false;
            this.progressLabel                     = this.screen.GetElement <UXLabel>("LabelChapterSelectionProgress");
            this.starsLabel                        = this.screen.GetElement <UXLabel>("LabelChapterSelectionStars");
            this.progressSlider                    = this.screen.GetElement <UXSlider>("ChapterSelectionPbar");
            this.pveContinueButton                 = this.screen.GetElement <UXButton>("BtnChapterAction");
            this.pveContinueButton.Enabled         = true;
            CampaignVO highestUnlockedCampaign = GameUtils.GetHighestUnlockedCampaign();

            this.alternateBackground = this.screen.GetElement <UXTexture>("TextureChapterBg");
            this.alternateBackground.LoadTexture("chap_btn_" + highestUnlockedCampaign.Uid);
            this.alternateButton           = this.screen.GetElement <UXButton>("BtnChapterActionTop");
            this.alternateButton.Enabled   = true;
            this.alternateButton.OnClicked = new UXButtonClickedDelegate(this.OnPveButtonClicked);
            this.screen.GetElement <UXLabel>("LabelBtnChapterActionTop").Text = Service.Get <Lang>().Get("LABEL_CAMPAIGNS", new object[0]);
            this.alternateGroup = this.screen.GetElement <UXElement>("ChapterButtonTop");
            UXElement element = this.screen.GetElement <UXElement>("ContainerJewelChapterTop");

            element.Visible = false;
            this.RefreshScreenForPlanetChange();
        }
コード例 #16
0
        public void InitLabels()
        {
            Lang    lang    = Service.Get <Lang>();
            UXLabel element = this.screen.GetElement <UXLabel>("LabelTitleAvailablePerks");

            element.Text = lang.Get("PERK_ACTIVE_AVAILABLE_TITLE", new object[0]);
        }
コード例 #17
0
 protected override void InitElements()
 {
     this.missionRewardGroup         = base.GetElement <UXElement>("MissionRewards");
     this.missionRewardGroup.Visible = false;
     this.squadBonusGroup            = base.GetElement <UXElement>("SquadBonus");
     this.squadBonusGroup.Visible    = false;
     this.attackMedalsLabel          = base.GetElement <UXLabel>("AttackerLabelMedals");
     this.defendMedalsLabel          = base.GetElement <UXLabel>("LabelDefenderMedals");
     this.attackMedalsIcon           = base.GetElement <UXSprite>("AttackerSpriteIcoMedals");
     this.defendMedalsIcon           = base.GetElement <UXSprite>("LabelSpriteIcoDefenderMedals");
     if (this.isNonAttackerReplayView)
     {
         this.replayAttackerTournamentRating = base.GetElement <UXElement>("AttackerTournamentMedals");
         this.replayDefenderTournamentRating = base.GetElement <UXElement>("DefenderTournamentMedals");
         this.replayTitleBarResultLabel      = base.GetElement <UXLabel>("TitleBarLabelResult");
     }
     else
     {
         this.seizedLabel = base.GetElement <UXLabel>("LabelLootText");
         this.seizedTable = base.GetElement <UXTable>("SeizedTable");
         this.seizedTable.SetTemplateItem("SeizedTemplate");
         base.InitStars();
     }
     base.GetElement <UXElement>("MissionResult").Visible = false;
 }
コード例 #18
0
        private void UpdatePerkTimerLabelsOnTick()
        {
            Lang lang  = Service.Get <Lang>();
            int  count = this.activePerkTimerLabels.Count;

            for (int i = 0; i < count; i++)
            {
                UXLabel uXLabel = this.activePerkTimerLabels[i];
                uint    endTime = ((ActivatedPerkData)uXLabel.Tag).EndTime;
                this.UpdateLabelTimeRemaining(uXLabel, lang, "PERK_ACTIVE_SLOT_ACTIVE_TIMER", endTime);
            }
            count = this.cooldownTimerLabels.Count;
            for (int j = 0; j < count; j++)
            {
                UXLabel uXLabel2 = this.cooldownTimerLabels[j];
                uint    endTime2 = (uint)uXLabel2.Tag;
                this.UpdateLabelTimeRemaining(uXLabel2, lang, "PERK_ACTIVE_CARD_COOLDOWN_TIMER", endTime2);
            }
            count = this.cooldownCostLabels.Count;
            for (int k = 0; k < count; k++)
            {
                UXLabel uXLabel3 = this.cooldownCostLabels[k];
                string  perkId   = (string)uXLabel3.Tag;
                this.UpdateGridItemCooldownSkipCost(uXLabel3, perkId);
            }
        }
コード例 #19
0
        protected override void OnScreenLoaded()
        {
            this.InitButtons();
            this.labelTitle        = base.GetElement <UXLabel>("LabelTitle");
            this.btnInfo           = base.GetElement <UXButton>("BtnInfo");
            this.labelSquadQueue   = base.GetElement <UXLabel>("LabelSquadQueue");
            this.buttonCancel      = base.GetElement <UXButton>("ButtonCancel");
            this.labelButtonCancel = base.GetElement <UXLabel>("LabelButtonCancel");
            this.buttonBack        = base.GetElement <UXButton>("ButtonBack");
            this.labelButtonBack   = base.GetElement <UXLabel>("LabelButtonBack");
            this.buttonConfirm     = base.GetElement <UXButton>("ButtonConfirm");
            this.labelButtonOk     = base.GetElement <UXLabel>("LabelButtonOk");
            this.queueTexture      = base.GetElement <UXTexture>("QueueTexture");
            IDataController dataController = Service.Get <IDataController>();
            TextureVO       textureVO      = dataController.Get <TextureVO>("gui_textures_cancel_matchmaking");

            this.queueTexture.LoadTexture(textureVO.AssetName);
            this.labelTitle.Text         = this.lang.Get("WAR_MATCHMAKE_TITLE", new object[0]);
            this.btnInfo.OnClicked       = new UXButtonClickedDelegate(Service.Get <SquadController>().WarManager.ShowInfoScreen);
            this.buttonCancel.OnClicked  = new UXButtonClickedDelegate(this.OnCancelButtonClicked);
            this.labelButtonCancel.Text  = this.lang.Get("WAR_CANCEL_MATCHMAKE", new object[0]);
            this.buttonBack.OnClicked    = new UXButtonClickedDelegate(this.OnBackClicked);
            this.labelButtonBack.Text    = this.lang.Get("WAR_CANCEL_MATCHMAKE_BACK", new object[0]);
            this.buttonConfirm.OnClicked = new UXButtonClickedDelegate(this.OnConfirmClicked);
            this.labelButtonOk.Text      = this.lang.Get("WAR_OK", new object[0]);
            this.finalConfirm            = false;
            this.Refresh();
        }
コード例 #20
0
        private void UpdateTitleText(bool isSwapping)
        {
            UXLabel   element  = base.GetElement <UXLabel>("DialogBldgUpgradeTitle");
            UXElement element2 = base.GetElement <UXElement>("UpgradeTime");

            element2.Visible = !isSwapping;
            if (isSwapping)
            {
                element.Text = this.lang.Get("BUILDING_INFO", new object[]
                {
                    LangUtils.GetBuildingDisplayName(this.buildingInfo),
                    this.buildingInfo.Lvl
                });
            }
            else
            {
                element.Text = this.lang.Get("BUILDING_UPGRADE", new object[]
                {
                    LangUtils.GetBuildingDisplayName(this.nextBuildingInfo),
                    this.nextBuildingInfo.Lvl
                });
                UXLabel element3 = base.GetElement <UXLabel>("LabelUpgradeTime");
                element3.Text = GameUtils.GetTimeLabelFromSeconds(this.nextBuildingInfo.UpgradeTime);
            }
        }
コード例 #21
0
        private void InitializeEventTickerElements()
        {
            this.elementTicker = this.factory.CloneElement <UXElement>(this.factory.GetElement <UXElement>("GalaxyConflictTicker"), "GalaxyConflictTickerClone", Service.UXController.WorldAnchor.Root);
            string name = UXUtils.FormatAppendedName("GalaxyConflictStatus", "GalaxyConflictTickerClone");

            this.elementStatus = this.factory.GetElement <UXElement>(name);
            string name2 = UXUtils.FormatAppendedName("LabelConflictStatusTitle", "GalaxyConflictTickerClone");

            this.labelStatusTitle = this.factory.GetElement <UXLabel>(name2);
            string name3 = UXUtils.FormatAppendedName("SpriteConflictStatusBg", "GalaxyConflictTickerClone");

            this.elementBgSprite      = this.factory.GetElement <UXSprite>(name3);
            this.DefaultTickerBgColor = this.elementBgSprite.Color;
            this.tickerLabels         = new UXLabel[4];
            this.tickerButtons        = new UXButton[4];
            this.tickerDataObjects    = new List <EventTickerObject>();
            for (int i = 0; i < 4; i++)
            {
                string originalName  = string.Format("LabelConflictStatusEvent{0}", i + 1);
                string name4         = UXUtils.FormatAppendedName(originalName, "GalaxyConflictTickerClone");
                string originalName2 = string.Format("LabelConflictStatusEvent{0}Btn", i + 1);
                string name5         = UXUtils.FormatAppendedName(originalName2, "GalaxyConflictTickerClone");
                this.tickerLabels[i]      = this.factory.GetElement <UXLabel>(name4);
                this.tickerLabels[i].Text = string.Empty;
                this.tickerButtons[i]     = this.factory.GetElement <UXButton>(name5);
            }
        }
コード例 #22
0
        private void InitRewardsGrid()
        {
            this.rewardsGrid = base.GetElement <UXGrid>("GridRewards");
            this.rewardsGrid.SetTemplateItem("RewardItem");
            RewardVO rewardVO = Service.StaticDataController.Get <RewardVO>(this.meta.Reward);
            List <RewardComponentTag> rewardComponents = RewardUtils.GetRewardComponents(rewardVO);

            for (int i = 0; i < rewardComponents.Count; i++)
            {
                RewardComponentTag rewardComponentTag = rewardComponents[i];
                string             itemUid            = rewardVO.Uid + i;
                UXElement          uXElement          = this.rewardsGrid.CloneTemplateItem(itemUid);
                uXElement.Tag = rewardComponentTag;
                UXLabel subElement = this.rewardsGrid.GetSubElement <UXLabel>(itemUid, "LabelRewardCount");
                subElement.Text = rewardComponentTag.Quantity;
                RewardType type = rewardComponentTag.Type;
                UXSprite   subElement2;
                if (type != RewardType.Building && type != RewardType.Currency)
                {
                    subElement2 = this.rewardsGrid.GetSubElement <UXSprite>(itemUid, "SpriteTroop");
                }
                else
                {
                    subElement2 = this.rewardsGrid.GetSubElement <UXSprite>(itemUid, "SpriteReward");
                }
                RewardUtils.SetRewardIcon(subElement2, rewardComponentTag.RewardGeometryConfig, AnimationPreference.NoAnimation);
                this.rewardsGrid.AddItem(uXElement, rewardComponentTag.Order);
                this.rewardsGrid.RepositionItems();
                this.rewardsGrid.Scroll(0.5f);
            }
            this.rewardsGrid.RepositionItems();
            this.rewardsGrid.Scroll(0.5f);
        }
コード例 #23
0
 protected override void InitButtons()
 {
     base.InitButtons();
     this.sprite                 = base.GetElement <UXSprite>("SpriteImage");
     this.textureImage           = base.GetElement <UXTexture>("TextureImage");
     this.textureImageInset      = base.GetElement <UXTexture>("TextureImageInset");
     this.primaryButton          = base.GetElement <UXButton>("BtnPrimary");
     this.payButton              = base.GetElement <UXButton>("BtnPay");
     this.payLeftButton          = base.GetElement <UXButton>("BtnOptionPay1");
     this.payRightButton         = base.GetElement <UXButton>("BtnOptionPay2");
     this.payLeftLabel           = base.GetElement <UXLabel>("CostOptionPay1LabelDescription");
     this.payRightLabel          = base.GetElement <UXLabel>("CostOptionPay2LabelDescription");
     this.primary2OptionButton   = base.GetElement <UXButton>("BtnPrimary_2option");
     this.secondary2OptionButton = base.GetElement <UXButton>("BtnSecondary");
     this.option2ButtonSkip      = base.GetElement <UXButton>("BtnSkip");
     this.bgGraphic              = base.GetElement <UXElement>("SpriteTextBg");
     this.bgGraphic.Visible      = true;
     this.CloseButton.Enabled    = (!this.IsFatal && !this.disableCloseBtn);
     if (!this.IsFatal && Service.UserInputInhibitor != null)
     {
         Service.UserInputInhibitor.AddToAllow(this.CloseButton);
     }
     this.primaryButton.Visible          = false;
     this.payButton.Visible              = false;
     this.payLeftButton.Visible          = false;
     this.payRightButton.Visible         = false;
     this.primary2OptionButton.Visible   = false;
     this.secondary2OptionButton.Visible = false;
     this.costRequirement.Visible        = false;
     this.option2ButtonSkip.Visible      = false;
     this.labelBodyRequirement.Visible   = false;
 }
コード例 #24
0
        private void InitLabels()
        {
            UXLabel element = base.GetElement <UXLabel>("LabelCampaignTitle");

            element.Text = LangUtils.GetCampaignTitle(this.meta);
            UXLabel element2 = base.GetElement <UXLabel>("LabelStars");

            element2.Text = this.lang.Get("LABEL_CAMPAIGN_STARS", new object[]
            {
                this.earnedStars,
                this.totalStars
            });
            UXLabel element3 = base.GetElement <UXLabel>("LabelStarsFeedback");

            if (this.earnedStars < this.totalStars)
            {
                element3.Text = this.lang.Get("CAMPAIGN_CHAPTER_COMPLETE", new object[0]);
            }
            else
            {
                element3.Text = this.lang.Get("CAMPAIGN_ALLSTARS_COMPLETE", new object[0]);
            }
            UXLabel element4 = base.GetElement <UXLabel>("LabelNextChapter");

            element4.Text    = LangUtils.GetCampaignTitle(this.nextMeta);
            element4.Visible = (this.meta != this.nextMeta);
            UXLabel element5 = base.GetElement <UXLabel>("LabelNextChapterIntro");

            element5.Visible = (this.meta != this.nextMeta);
        }
コード例 #25
0
        private void Loaded(object cookie)
        {
            bool flag = base.IsLoaded();

            if (flag)
            {
                this.animation = base.Root.GetComponent <Animation>();
                if (this.animation != null)
                {
                    this.animation.playAutomatically = false;
                }
            }
            string vO_BLACKLIST = GameConstants.VO_BLACKLIST;
            Lang   lang         = Service.Get <Lang>();
            string locale       = lang.Locale;

            base.GetElement <UXLabel>("LabelChapterNumber").Text = lang.Get(this.chapterNumber, new object[0]);
            base.GetElement <UXLabel>("LabelChapterName").Text   = lang.Get(this.chapterName, new object[0]);
            UXLabel element = base.GetElement <UXLabel>("LabelBody");

            element.UseFontSharpening = false;
            element.Text = LangUtils.ProcessStringWithNewlines(lang.Get(this.chapterBody, new object[0]));
            base.GetElement <UXLabel>("LabelBtnSkipIntro").Text = lang.Get("s_SKIP", new object[0]);
            if (vO_BLACKLIST.Contains(locale))
            {
                base.GetElement <UXSprite>("logo").Visible = false;
            }
            if (this.onLoadingCompleteCallback != null)
            {
                this.onLoadingCompleteCallback(this.onLoadingCompleteCookie);
            }
        }
コード例 #26
0
 public void Destroy()
 {
     Service.Get <ViewTimeEngine>().UnregisterClockTimeObserver(this);
     this.label    = null;
     this.Campaign = null;
     this.lang     = null;
 }
コード例 #27
0
        protected void SetupBar(int index, string labelString, int currentValue, int nextValue, int maxValue, bool showBars)
        {
            bool flag = !string.IsNullOrEmpty(labelString);

            base.GetElement <UXElement>(string.Format("pBar{0}", index)).Visible = flag;
            if (!flag)
            {
                return;
            }
            UXLabel element = base.GetElement <UXLabel>(string.Format("LabelpBar{0}", index));

            element.Text = labelString;
            UXSlider element2 = base.GetElement <UXSlider>(string.Format("pBarCurrent{0}", index));
            UXSlider element3 = base.GetElement <UXSlider>(string.Format("pBarNext{0}", index));

            element2.Visible = showBars;
            element3.Visible = showBars;
            base.GetElement <UXSprite>(string.Format("SpritepBarBkg{0}", index)).Visible = showBars;
            element3.Visible = (nextValue > currentValue && showBars);
            element2.Value   = MathUtils.NormalizeRange((float)currentValue, 0f, (float)maxValue);
            element3.Value   = MathUtils.NormalizeRange((float)nextValue, 0f, (float)maxValue);
            UXLabel element4 = base.GetElement <UXLabel>(string.Format("LabelpBar{0}Current", index));

            element4.Text = this.lang.Get("perkEffect_descMod_PosPct", new object[]
            {
                this.lang.ThousandsSeparated(currentValue)
            });
            UXLabel element5 = base.GetElement <UXLabel>(string.Format("LabelpBar{0}Next", index));

            element5.Visible = (this.forResearchLab && nextValue > currentValue);
            element5.Text    = this.lang.Get("perkEffect_descMod_PosPct", new object[]
            {
                this.lang.ThousandsSeparated(nextValue - currentValue)
            });
        }
コード例 #28
0
 protected override void InitLabels()
 {
     base.InitLabels();
     this.labelViewGalaxyMap.Text = this.lang.Get("s_ViewGalaxyMap", new object[0]);
     base.GetElement <UXElement>("LabelInfo").Visible           = false;
     base.GetElement <UXElement>("LowLayoutGroup").Visible      = false;
     base.GetElement <UXLabel>("LabelUpgradeUnlockPlanet").Text = string.Empty;
     this.labelUpgradeUnlockPlanet = base.GetElement <UXLabel>("LabelUpgradeUnlockPlanet");
     if (this.tutorialMode)
     {
         base.GetElement <UXLabel>("LabelSelectPlanet").Text = this.lang.Get("PLANETS_GNC_SELECT_UNLOCK", new object[0]);
     }
     else if (this.reqMet)
     {
         base.GetElement <UXLabel>("LabelSelectPlanet").Text = this.lang.Get("PLANETS_GNC_SELECT_UPGRADE", new object[0]);
     }
     else
     {
         base.GetElement <UXLabel>("LabelSelectPlanet").Text = this.lang.Get("PLANETS_GNC_HQ_UPGRADE_REQUIRED", new object[]
         {
             this.reqBuildingInfo.Lvl
         });
         this.labelHQUpgradeDesc.Visible = false;
     }
     base.GetElement <UXLabel>("LabelUpgradeTime").Text = GameUtils.GetTimeLabelFromSeconds((!this.tutorialMode) ? this.nextBuildingInfo.Time : this.buildingInfo.Time);
     base.GetElement <UXElement>("UpgradeTime").Visible = true;
     base.GetElement <UXLabel>("LabelUpgrade").Text     = this.lang.Get("PLANETS_GNC_CONSTR_TIME", new object[0]);
     this.buttonPrimaryAction.Enabled = false;
     base.GetElement <UXLabel>("CostLabelConfirm").Text = this.lang.Get("PLANETS_GNC_UNLOCK_MODAL_BUTTON_CONFIRM", new object[0]);
     this.labelUnlockPlanetTimer      = base.GetElement <UXLabel>("LabelUnlockPlanetTimer");
     this.labelUnlockPlanetTimer.Text = string.Empty;
 }
コード例 #29
0
        private void InitEditView()
        {
            UXLabel element = base.GetElement <UXLabel>("LabelTitleSquadCreate");

            element.Text = this.lang.Get("EDIT_SQUAD", new object[0]);
            this.labelInstructions.Visible = false;
            UXLabel element2 = base.GetElement <UXLabel>("LabelBtnDone");

            element2.Text = this.lang.Get("BUTTON_DONE", new object[0]);
            this.buttonPurchase.Visible = false;
            this.buttonEdit.OnClicked   = new UXButtonClickedDelegate(this.OnEditClicked);
            Squad currentSquad = Service.SquadController.StateManager.GetCurrentSquad();

            this.inputName.Text                  = currentSquad.SquadName;
            this.inputName.EnableInput           = false;
            this.inputDescription.Text           = currentSquad.Description;
            this.spriteSelectedSymbol.SpriteName = currentSquad.Symbol;
            this.symbolName = currentSquad.Symbol;
            string     name     = this.ConvertSymbolNameToCheckboxId(currentSquad.Symbol);
            UXCheckbox element3 = base.GetElement <UXCheckbox>(name);

            element3.DelayedSelect(true);
            this.UpdateEnrollmentType(currentSquad.InviteType == 1);
            this.scoreReq = currentSquad.RequiredTrophies;
            this.UpdateScoreReq(0);
        }
コード例 #30
0
        protected void AddTroopItem(IUpgradeableVO troop, int troopCount, string tooltipText)
        {
            TroopUpgradeTag troopUpgradeTag = new TroopUpgradeTag(troop as IDeployableVO, true);

            this.troopList.Add(troopUpgradeTag);
            string    uid        = troop.Uid;
            UXElement item       = this.storageItemGrid.CloneTemplateItem(uid);
            UXLabel   subElement = this.storageItemGrid.GetSubElement <UXLabel>(uid, "LabelStorageCount");

            subElement.Text = LangUtils.GetMultiplierText(troopCount);
            UXSprite        subElement2 = this.storageItemGrid.GetSubElement <UXSprite>(uid, "SpriteStorageItemImageTroops");
            ProjectorConfig config      = ProjectorUtils.GenerateGeometryConfig(troop as IDeployableVO, subElement2);

            Service.EventManager.SendEvent(EventId.ButtonCreated, new GeometryTag(troop, config, Service.CurrentPlayer.ActiveArmory));
            ProjectorUtils.GenerateProjector(config);
            UXLabel subElement3 = this.storageItemGrid.GetSubElement <UXLabel>(uid, "LabelTroopLevel");

            subElement3.Text = LangUtils.GetLevelText(troop.Lvl);
            UXElement subElement4 = this.storageItemGrid.GetSubElement <UXElement>(uid, "BtnRequestTroops");

            subElement4.Visible = false;
            UXButton subElement5 = this.storageItemGrid.GetSubElement <UXButton>(uid, "StorageItemsCard");

            if (tooltipText != null)
            {
                this.troopTooltipHelper.RegisterButtonTooltip(subElement5, tooltipText);
            }
            else
            {
                subElement5.Tag       = troopUpgradeTag;
                subElement5.OnClicked = new UXButtonClickedDelegate(this.OnTroopItemClicked);
            }
            this.storageItemGrid.AddItem(item, troop.Order);
        }