Example #1
0
        private void InitLabels()
        {
            this.mainGroup         = base.GetElement <UXElement>("DefaultContainer");
            this.mainGroup.Visible = true;
            UXLabel element = base.GetElement <UXLabel>("LabelSettingsTitle");

            element.Text = this.lang.Get("SETTINGS_TITLE", new object[0]);
            element      = base.GetElement <UXLabel>("LabelBtnMusic");
            element.Text = this.lang.Get("SETTINGS_MUSIC", new object[0]);
            element      = base.GetElement <UXLabel>("LabelBtnSoundEffects");
            element.Text = this.lang.Get("SETTINGS_SFX", new object[0]);
            element      = base.GetElement <UXLabel>("LabelBtnLanguage");
            element.Text = this.lang.GetDisplayLanguage(this.lang.Locale);
            this.SetFacebookButtonLabel(Service.Get <ISocialDataController>().IsLoggedIn);
            element      = base.GetElement <UXLabel>("LabelBtnAbout");
            element.Text = this.lang.Get("SETTINGS_ABOUT", new object[0]);
            element      = base.GetElement <UXLabel>("LabelBtnHelp");
            element.Text = this.lang.Get("SETTINGS_HELP", new object[0]);
            element      = base.GetElement <UXLabel>("LabelBtnPrivacyPolicy");
            element.Text = this.lang.Get("SETTINGS_PRIVACY", new object[0]);
            element      = base.GetElement <UXLabel>("LabelBtnTOS");
            element.Text = this.lang.Get("SETTINGS_TOS", new object[0]);
            if (GameConstants.FORUMS_ENABLED)
            {
                element      = base.GetElement <UXLabel>("LabelBtnForums");
                element.Text = this.lang.Get("SETTINGS_FORUMS", new object[0]);
            }
            element      = base.GetElement <UXLabel>("LabelFBIncentiveiOS");
            element.Text = this.lang.Get("CONNECT_FB_SETTINGS_DESC", new object[0]);
            element      = base.GetElement <UXLabel>("LabelBtnFactionSwap");
            FactionType faction = Service.Get <CurrentPlayer>().Faction;

            if (faction == FactionType.Empire)
            {
                element.Text = this.lang.Get("FACTION_FLIP_PLAY_REBEL", new object[0]);
                return;
            }
            if (faction != FactionType.Rebel)
            {
                return;
            }
            element.Text = this.lang.Get("FACTION_FLIP_PLAY_EMPIRE", new object[0]);
        }
        private void CreateTab(string tabTitle, int tab, int sortOrder)
        {
            string     itemUid    = "tab_" + sortOrder;
            UXElement  item       = this.tabGrid.CloneTemplateItem(itemUid);
            UXCheckbox subElement = this.tabGrid.GetSubElement <UXCheckbox>(itemUid, this.filterButton);

            subElement.Tag        = tab;
            subElement.OnSelected = new UXCheckboxSelectedDelegate(this.OnTabSelected);
            this.checkboxes.Add(subElement);
            UXLabel subElement2 = this.tabGrid.GetSubElement <UXLabel>(itemUid, this.filterButtonLabel);

            subElement2.Text = tabTitle;
            if (this.CurrentTab != tab)
            {
                subElement2.TextColor = UXUtils.COLOR_INACTIVE_TROOP_TAB;
            }
            this.tabLabels.Add(tab, subElement2);
            this.tabGrid.AddItem(item, sortOrder);
        }
Example #3
0
 private void InitElements()
 {
     base.GetElement <UXLabel>("LabelBtnNext").Text = this.lang.Get("s_WhatsNextButton", new object[0]);
     this.holoPositioner      = base.GetElement <UXElement>("HoloHolder");
     this.nextButton          = base.GetElement <UXButton>("BtnNext");
     this.storeButton         = base.GetElement <UXButton>("ButtonStore");
     this.infoPanel           = base.GetElement <UXElement>("InfoItems");
     this.infoLabel           = base.GetElement <UXLabel>("LabelInfoItem");
     this.infoTexture         = base.GetElement <UXTexture>("SpriteInfoItem");
     this.infoPlanetTexture   = base.GetElement <UXTexture>("SpriteInfoItemPlanets");
     this.infoTitleLabel      = base.GetElement <UXLabel>("LabelInfoItemTitle");
     this.regularTextBoxGroup = base.GetElement <UXElement>("NpcDialogLarge");
     this.regularTitleLabel   = base.GetElement <UXLabel>("LabelNpcMessageBottomLeftTitleLarge");
     this.regularBodyLabel    = base.GetElement <UXLabel>("LabelNpcMessageBottomLeftBodyLarge");
     this.storeTextBoxGroup   = base.GetElement <UXElement>("NpcDialog");
     this.storeTitleLabel     = base.GetElement <UXLabel>("LabelNpcMessageBottomLeftTitle");
     this.storeBodyLabel      = base.GetElement <UXLabel>("LabelNpcMessageBottomLeftBody");
     this.HideAllElements();
 }
        public override void OnScreenLoaded()
        {
            string initText = this.lang.Get("s_Chat", new object[0]) + "...";

            this.chatInputBox = this.screen.GetElement <UXInput>("LabelChatInput");
            this.chatInputBox.InitText(initText);
            this.chatInputScript                    = this.chatInputBox.GetUIInputComponent();
            this.chatInputScript.onValidate         = new UIInput.OnValidate(LangUtils.OnValidateWNewLines);
            this.chatInputScript.label.maxLineCount = 1;
            this.requestInputBox                    = this.screen.GetElement <UXInput>("LabelRequestInput");
            this.requestInputBox.InitText(this.lang.Get("REQUEST_TROOPS_DEFAULT", new object[0]));
            this.requestInputScript                    = this.requestInputBox.GetUIInputComponent();
            this.requestInputScript.onValidate         = new UIInput.OnValidate(LangUtils.OnValidateWNewLines);
            this.requestInputScript.label.maxLineCount = 1;
            this.defaultShareText = this.lang.Get("BATTLE_REPLAY_SHARE_DEFAULT", new object[0]);
            this.shareInputBox    = this.screen.GetElement <UXInput>("LabeShareReplayInput");
            this.shareInputBox.InitText(this.defaultShareText);
            this.shareInputScript                    = this.shareInputBox.GetUIInputComponent();
            this.shareInputScript.onValidate         = new UIInput.OnValidate(LangUtils.OnValidateWNewLines);
            this.shareInputScript.label.maxLineCount = 1;
            this.shareOppNameLabel                   = this.screen.GetElement <UXLabel>("LabelOpponentNameShare");
            this.shareTypeLabel          = this.screen.GetElement <UXLabel>("LabelReplayTypeShare");
            this.shareDamagePercentLabel = this.screen.GetElement <UXLabel>("LabelDamageShare");
            this.shareMedalsLabel        = this.screen.GetElement <UXLabel>("LabelReplayMedalsShare");
            this.share1StarSprite        = this.screen.GetElement <UXSprite>("SpriteStar1Share");
            this.share2StarSprite        = this.screen.GetElement <UXSprite>("SpriteStar2Share");
            this.share3StarSprite        = this.screen.GetElement <UXSprite>("SpriteStar3Share");
            UXButton element = this.screen.GetElement <UXButton>("BtnSendChat");

            element.OnClicked                    = new UXButtonClickedDelegate(this.OnChatMessageSend);
            this.requestTroopBtn                 = this.screen.GetElement <UXButton>("BtnRequestTroops");
            this.requestTroopBtn.OnClicked       = new UXButtonClickedDelegate(this.OnTroopRequestClicked);
            this.resendRequestTroopBtn           = this.screen.GetElement <UXButton>("BtnResendRequest");
            this.resendRequestTroopBtn.OnClicked = new UXButtonClickedDelegate(this.OnTroopRequestClicked);
            this.resendRequestTroopCostLabel     = this.screen.GetElement <UXLabel>("LabelBtnBtnResendRequestCost");
            this.shareReplayButton               = this.screen.GetElement <UXButton>("BtnShareReplay");
            this.shareReplayButton.OnClicked     = new UXButtonClickedDelegate(this.OnShareReplayClicked);
            this.inputModeChat                   = this.screen.GetElement <UXElement>("ChatInput");
            this.inputModeShare                  = this.screen.GetElement <UXElement>("ChatInputShare");
            this.inputModeRequest                = this.screen.GetElement <UXElement>("RequestInput");
            this.chatPanel     = this.screen.GetElement <UXElement>("ChatPanel");
            this.chatItemTable = this.screen.GetElement <UXTable>("ChatTable");
        }
Example #5
0
        public override void OnScreenLoaded()
        {
            this.donateTroopsPanel             = this.screen.GetElement <UXElement>("DonatePanel");
            this.donateTroopsTitle             = this.screen.GetElement <UXLabel>("LabelDonateTitle");
            this.troopTemplateItem             = this.screen.GetElement <UXElement>("DonateTroopsCard");
            this.troopTemplateItem.Visible     = false;
            this.troopDonateCloseBtn           = this.screen.GetElement <UXButton>("DonateBtnClose");
            this.troopDonateCloseBtn.OnClicked = new UXButtonClickedDelegate(this.OnDonateClose);
            this.troopDonateGrid = this.screen.GetElement <UXGrid>("DonateTroopsGrid");
            this.troopDonateGrid.BypassLocalPositionOnAdd = true;
            this.capacityBar                   = this.screen.GetElement <UXSlider>("PbarDonatePopup");
            this.capacityLabel                 = this.screen.GetElement <UXLabel>("LabelPbarDonatePopup");
            this.hintLabel                     = this.screen.GetElement <UXLabel>("LabelDonateHint");
            this.noTroopsLabel                 = this.screen.GetElement <UXLabel>("LabelDonateNoTroops");
            this.trainTroopsButton             = this.screen.GetElement <UXButton>("BtnTrainTroops");
            this.buildVehiclesButton           = this.screen.GetElement <UXButton>("BtnBuildVehicles");
            this.donateTroopsCancel            = this.screen.GetElement <UXButton>("BtnDonateTroopsCancel");
            this.donateTroopsConfirm           = this.screen.GetElement <UXButton>("BtnDonateTroopsConfirmation");
            this.donateTroopsConfirm.Enabled   = false;
            this.donateTroopsCancelLabel       = this.screen.GetElement <UXLabel>("LabelBtnDonateTroopsCancel");
            this.donateTroopsCancelLabel.Text  = Service.Get <Lang>().Get("s_Cancel", new object[0]);
            this.donateTroopsConfrimLabel      = this.screen.GetElement <UXLabel>("LabelBtnDonateTroopsConfirmation");
            this.donateTroopsConfrimLabel.Text = Service.Get <Lang>().Get("s_Confirm", new object[0]);
            this.earnReputationPanel           = this.screen.GetElement <UXElement>("PanelEarnReputation");
            this.earnReputationComplete        = this.screen.GetElement <UXElement>("EarnReputationComplete");
            this.earnReputationProgress        = this.screen.GetElement <UXElement>("EarnReputationProgress");
            this.earnReputationProgressBar     = this.screen.GetElement <UXSlider>("PBarDonateForReputation");
            this.earnReputationProgressLabel   = this.screen.GetElement <UXLabel>("LabelEarnReputationProgress");
            this.earnReputationTimer           = this.screen.GetElement <UXLabel>("LabelEarnReputationTimer");
            UXLabel element = this.screen.GetElement <UXLabel>("LabelEarnReputation");

            element.Text = this.lang.Get("PERK_CHAT_DONATE_DESC", new object[]
            {
                GameConstants.SQUADPERK_DONATION_REPUTATION_AWARD,
                GameConstants.SQUADPERK_DONATION_REPUTATION_AWARD_THRESHOLD
            });
            UXLabel element2 = this.screen.GetElement <UXLabel>("LabelRepAmountChat");

            element2.Text = GameConstants.SQUADPERK_DONATION_REPUTATION_AWARD.ToString();
            UXLabel element3 = this.screen.GetElement <UXLabel>("LabelEarnReputationComplete");

            element3.Text = this.lang.Get("PERK_CHAT_DONATE_TITLE_COMPLETE", new object[0]);
        }
Example #6
0
 public void OnScreenLoaded()
 {
     this.squadInfoOverlay               = this.screen.GetElement <UXElement>("ContainerSquadInfo");
     this.squadInfoOverlay.Visible       = false;
     this.squadDetailsAlertLabel         = this.screen.GetElement <UXLabel>("LabelSquadUserDetails");
     this.squadDetailsAlertLabel.Visible = true;
     this.squadMemberGrid = this.screen.GetElement <UXGrid>("SquadInfoGrid");
     this.squadMemberGrid.SetTemplateItem("SquadInfoItem");
     this.requestBtn           = this.screen.GetElement <UXButton>("BtnJoinSquad");
     this.requestBtnLabel      = this.screen.GetElement <UXLabel>("LabelBtnJoinSquad");
     this.joinModule           = new SquadJoinActionModule(null, this.screen, this.requestBtn);
     this.requestBtn.OnClicked = new UXButtonClickedDelegate(this.OnJoinClicked);
     this.squadNameLabel       = this.screen.GetElement <UXLabel>("LabelSquadNameTop");
     this.squadRankLabel       = this.screen.GetElement <UXLabel>("LabelSquadRankTop");
     this.squadScoreLabel      = this.screen.GetElement <UXLabel>("LabelSquadScoreTop");
     this.squadDescLabel       = this.screen.GetElement <UXLabel>("LabelSquadInfoDescription");
     this.squadToJoinLabel     = this.screen.GetElement <UXLabel>("LabelSquadInfoJoin");
     this.squadSymbolSprite    = this.screen.GetElement <UXSprite>("SpriteSquadIcon");
 }
Example #7
0
        protected void UpdateButtonContainerTween(UXElement buttonContainer, int numButtons)
        {
            if (numButtons != 1 && numButtons != 3)
            {
                return;
            }
            TweenPosition component = buttonContainer.Root.GetComponent <TweenPosition>();
            Vector3       to        = component.to;

            if (numButtons == 1)
            {
                to.x = 25f;
            }
            else if (numButtons == 3)
            {
                to.x = -332f;
            }
            component.to = to;
        }
Example #8
0
        private void InitPerkTabs()
        {
            this.allAdvancementTabs.Clear();
            this.tabActivate                  = this.screen.GetElement <UXCheckbox>("TabActivatePerks");
            this.tabUpgrade                   = this.screen.GetElement <UXCheckbox>("TabUpgradePerks");
            this.tabActivate.OnSelected       = new UXCheckboxSelectedDelegate(this.OnAdvancementTabSelected);
            this.tabUpgrade.OnSelected        = new UXCheckboxSelectedDelegate(this.OnAdvancementTabSelected);
            this.perkTabsGroup                = this.screen.GetElement <UXElement>("TabGroupPerks");
            this.perkTabsGroup.Visible        = true;
            this.perkUpgradeGroup             = this.screen.GetElement <UXElement>("UpgradeMainGroupPerks");
            this.perkUpgradeGroup.Visible     = false;
            this.activeAdvancementTab         = this.CreateAndAddActivateTab(this.screen);
            this.activeAdvancementTab.Visible = true;
            this.tabActivate.Tag              = this.activeAdvancementTab;
            SquadAdvancementBaseTab squadAdvancementBaseTab = this.CreateAndAddUpgradeTab(this.screen);

            squadAdvancementBaseTab.Visible = false;
            this.tabUpgrade.Tag             = squadAdvancementBaseTab;
        }
Example #9
0
        public int SortByDonated(UXElement elementA, UXElement elementB)
        {
            CurrentPlayer   currentPlayer   = Service.CurrentPlayer;
            SquadController squadController = Service.SquadController;
            SquadMember     squadMember     = (SquadMember)elementA.Tag;
            SquadMember     squadMember2    = (SquadMember)elementB.Tag;
            int             num             = squadMember.TroopsDonated;
            int             num2            = squadMember2.TroopsDonated;

            if (squadMember.MemberID == currentPlayer.PlayerId)
            {
                num += squadController.StateManager.NumTroopDonationsInSession;
            }
            if (squadMember2.MemberID == currentPlayer.PlayerId)
            {
                num2 += squadController.StateManager.NumTroopDonationsInSession;
            }
            return(num2 - num);
        }
Example #10
0
 private void OnDelayedScreenLoad(uint timerId, object cookie)
 {
     this.screen.GetElement <UXButton>("BtnBackToPlanetFullScreen").OnClicked = new UXButtonClickedDelegate(this.OnBackButtonClicked);
     this.header                    = this.screen.GetElement <UXLabel>("LabelObjectivesDetailsHeader");
     this.timer                     = this.screen.GetElement <UXLabel>("LabelObjectivesDetailsTimer");
     this.relocation                = this.screen.GetElement <UXLabel>("LabelRelocationRequirement");
     this.specialEventIcon          = this.screen.GetElement <UXTexture>("TextureObjectiveDetailsSpecial");
     this.specialEventFrame         = this.screen.GetElement <UXTexture>("TextureObjectiveDetailsFrameSpecial");
     this.specialEventIcon.Visible  = false;
     this.specialEventFrame.Visible = false;
     this.btnBack                   = this.screen.GetElement <UXButton>("BtnBackToPlanet");
     this.btnBack.OnClicked         = new UXButtonClickedDelegate(this.OnBackButtonClicked);
     this.grid = this.screen.GetElement <UXGrid>("GridObjective");
     this.grid.Clear();
     this.grid.SetTemplateItem("TemplateObjective");
     for (int i = 0; i < 3; i++)
     {
         string            itemUid           = i.ToString();
         UXElement         uXElement         = this.grid.CloneTemplateItem(itemUid);
         ObjectiveViewData objectiveViewData = new ObjectiveViewData();
         objectiveViewData.BtnSupplyCrate           = this.grid.GetSubElement <UXButton>(itemUid, "BtnSupplyCrate");
         objectiveViewData.BtnSupplyCrate.OnClicked = new UXButtonClickedDelegate(this.objectiveController.OnCrateClickedFromDetail);
         objectiveViewData.BtnSupplyCrate.Tag       = objectiveViewData;
         objectiveViewData.SpriteCheckmark          = this.grid.GetSubElement <UXSprite>(itemUid, "SpriteCheckmark");
         objectiveViewData.SpriteSupplyCrate        = this.grid.GetSubElement <UXSprite>(itemUid, "SpriteSupplyCrate");
         objectiveViewData.ObjectiveBgComplete      = this.grid.GetSubElement <UXElement>(itemUid, "TemplateObjectiveCompleteBg");
         objectiveViewData.ObjectiveBgCollected     = this.grid.GetSubElement <UXElement>(itemUid, "TemplateObjectiveCollectedBg");
         objectiveViewData.ObjectiveBgActive        = this.grid.GetSubElement <UXElement>(itemUid, "TemplateObjectiveProgressBg");
         objectiveViewData.SpecailObjectiveFx       = this.grid.GetSubElement <UXElement>(itemUid, "CrateDetailEffect");
         objectiveViewData.ObjectiveBgExpired       = this.grid.GetSubElement <UXElement>(itemUid, "TemplateObjectiveExpiredBg");
         objectiveViewData.StatusLabel           = this.grid.GetSubElement <UXLabel>(itemUid, "LabelObjectiveDetailStatus");
         objectiveViewData.TitleLabel            = this.grid.GetSubElement <UXLabel>(itemUid, "LabelObjectiveDetailName");
         objectiveViewData.ProgressSlider        = this.grid.GetSubElement <UXSlider>(itemUid, "PBarObjectiveDetail");
         objectiveViewData.SpriteObjectiveIcon   = this.grid.GetSubElement <UXSprite>(itemUid, "SpriteUnit");
         objectiveViewData.ObjectiveContainer    = this.grid.GetSubElement <UXElement>(itemUid, "TemplateObjectiveProgressBg");
         objectiveViewData.ObjectiveContainerLEI = this.grid.GetSubElement <UXElement>(itemUid, "TemplateObjectiveSpecialBg");
         uXElement.Tag = objectiveViewData;
         this.grid.AddItem(uXElement, i);
     }
     this.grid.RepositionItems();
     this.details.Visible = false;
 }
Example #11
0
        public ScreenInfo AddScreen(UXElement screen, bool modal, bool visibleScrim, QueueScreenBehavior subType)
        {
            ScreenBase highestLevelScreen = this.GetHighestLevelScreen <ScreenBase>();

            if (highestLevelScreen != null)
            {
                AlertScreen alertScreen = highestLevelScreen as AlertScreen;
                if (alertScreen != null && alertScreen.IsFatal)
                {
                    screen.Visible = false;
                    return(null);
                }
            }
            ScreenBase  screenBase   = screen as ScreenBase;
            AlertScreen alertScreen2 = screen as AlertScreen;
            ScreenInfo  screenInfo   = new ScreenInfo(screen, modal, visibleScrim, subType);

            if (!this.HandleScreenQueue(screenInfo))
            {
                if (highestLevelScreen != null && highestLevelScreen.IsAlwaysOnTop && this.screens.Count > 0)
                {
                    if ((screenBase != null && screenBase.IsAlwaysOnTop) || (alertScreen2 != null && alertScreen2.IsFatal))
                    {
                        this.screens.Add(screenInfo);
                        Service.EventManager.SendEvent(EventId.NewTopScreen, null);
                    }
                    else
                    {
                        this.screens.Insert(this.screens.Count - 1, screenInfo);
                    }
                }
                else
                {
                    this.screens.Add(screenInfo);
                    Service.EventManager.SendEvent(EventId.NewTopScreen, null);
                }
                screen.Visible = true;
                this.UpdateScrimAndDepths();
                Service.UserInputManager.ResetLastScreenPosition();
            }
            return(screenInfo);
        }
Example #12
0
 private void InitView()
 {
     this.holonetScreen.HideAllTabs();
     this.holoPositioner                 = this.holonetScreen.GetElement <UXElement>("TransmissionHoloHolder");
     this.transmissionsGroups            = this.holonetScreen.GetElement <UXElement>("IncomingTransmissionsGroup");
     this.previousTransmission           = this.holonetScreen.GetElement <UXButton>("BtnTransmissionPrev");
     this.previousTransmission.OnClicked = new UXButtonClickedDelegate(this.OnPreviousTransmission);
     this.nextTransmission               = this.holonetScreen.GetElement <UXButton>("BtnTransmissionNext");
     this.nextTransmission.OnClicked     = new UXButtonClickedDelegate(this.OnNextTransmission);
     this.transmissionsHeader            = this.holonetScreen.GetElement <UXLabel>("CurrentTransmissionLabel");
     this.genericTransmission            = this.holonetScreen.GetElement <UXElement>("TransmissionGenericGroup");
     this.genericTransmissionTitle       = this.holonetScreen.GetElement <UXLabel>("TransmissionMessageTitle");
     this.genericTransmissionBody        = this.holonetScreen.GetElement <UXLabel>("TransmissionMessageBody");
     this.genericTransmissionButtonTable = this.holonetScreen.GetElement <UXTable>("TransmissionButtonTable");
     this.genericTransmissionButtonTable.SetTemplateItem("TransmissionButtonTableItem");
     this.genericBtnMsg   = this.holonetScreen.GetElement <UXLabel>("LabelBtnMessage");
     this.genericCelebMsg = this.holonetScreen.GetElement <UXLabel>("LabelCelebrationMessage");
     this.genericTransmissionTextGroup = this.holonetScreen.GetElement <UXElement>("TransmissionMessageText");
     this.conflictContainer            = this.holonetScreen.GetElement <UXElement>("EndConflictContainer");
     this.conflictMessage                         = this.holonetScreen.GetElement <UXLabel>("EndConflictLabelMessage");
     this.conflictTierIcon                        = this.holonetScreen.GetElement <UXSprite>("SpriteFinalTierIcon");
     this.conflictTierTitle                       = this.holonetScreen.GetElement <UXLabel>("LabelFinalTierTitle");
     this.conflictTierLevel                       = this.holonetScreen.GetElement <UXLabel>("LabelFinalTier");
     this.conflictTierPercent                     = this.holonetScreen.GetElement <UXLabel>("LabelFinalTierPercent");
     this.battleLogTransmission                   = this.holonetScreen.GetElement <UXElement>("TransmissionBattleLogGroup");
     this.conflictResultGroup                     = this.holonetScreen.GetElement <UXElement>("ConflictResult1");
     this.battleTransmissionTitle                 = this.holonetScreen.GetElement <UXLabel>("TransmissionBattleLogTitle");
     this.battleTransmissionBody                  = this.holonetScreen.GetElement <UXLabel>("TransmissionBattleLogBody");
     this.battleTransmissionBattlesGrid           = this.holonetScreen.GetElement <UXGrid>("GridBattleList");
     this.battleTransmissionMedalsTotalDelta      = this.holonetScreen.GetElement <UXLabel>("LabelMedalResult");
     this.battleTransmissionConflictPtsTotalDelta = this.holonetScreen.GetElement <UXLabel>("LabelConflictResult1");
     this.battleTransmissionConflictPtsSprite     = this.holonetScreen.GetElement <UXSprite>("SpriteConflictResult1");
     this.battleTransmissionDismiss               = this.holonetScreen.GetElement <UXButton>("TransmissionBattlelogBtnPrimary");
     this.battleTransmissionDismiss.OnClicked     = new UXButtonClickedDelegate(this.OnDismissTransmissionClicked);
     this.battleTransmissionDismissLabel          = this.holonetScreen.GetElement <UXLabel>("TransmissionBattlelogLabelBtnPrimary");
     this.battleTransmissionBattleLog             = this.holonetScreen.GetElement <UXButton>("TransmissionBattlelogBtnSecondary");
     this.battleTransmissionBattleLog.OnClicked   = new UXButtonClickedDelegate(this.OnBattleLog);
     this.battleTransmissionBattleLogLabel        = this.holonetScreen.GetElement <UXLabel>("TransmissionBattlelogLabelBtnSecondary");
     this.squadWarEndedContainer                  = this.holonetScreen.GetElement <UXElement>("EndSquadWarContainer");
     Service.Get <HolonetController>().TransmissionsController.OnTransmissionPopupIntialized(this);
     this.eventManager.SendEvent(EventId.HolonetTabOpened, "incoming_transmission");
 }
Example #13
0
        private int SortUpgradeList(UXElement a, UXElement b)
        {
            PerkManager perkManager = Service.PerkManager;
            Squad       squad       = Service.CurrentPlayer.Squad;
            Dictionary <string, string> available = squad.Perks.Available;
            int    level   = squad.Level;
            PerkVO perkVO  = (PerkVO)a.Tag;
            PerkVO perkVO2 = (PerkVO)b.Tag;
            int    num     = perkVO.SortOrder;
            int    num2    = perkVO2.SortOrder;

            if (perkManager.IsPerkLevelLocked(perkVO, level) && perkManager.IsPerkLevelLocked(perkVO2, level))
            {
                num  = perkVO.SquadLevelUnlock;
                num2 = perkVO2.SquadLevelUnlock;
            }
            if (perkManager.IsPerkMaxTier(perkVO) && available.ContainsValue(perkVO.Uid))
            {
                num += 20000;
            }
            else if (perkManager.IsPerkLevelLocked(perkVO, level))
            {
                num += 10000;
            }
            if (!a.Visible)
            {
                num += 40000;
            }
            if (perkManager.IsPerkMaxTier(perkVO2) && available.ContainsValue(perkVO2.Uid))
            {
                num2 += 20000;
            }
            else if (perkManager.IsPerkLevelLocked(perkVO2, level))
            {
                num2 += 10000;
            }
            if (!b.Visible)
            {
                num2 += 40000;
            }
            return(num - num2);
        }
Example #14
0
        protected void AnimateStars(int stars)
        {
            for (int i = 1; i <= stars; i++)
            {
                FactionType factionType = this.faction;
                string      format;
                if (factionType != FactionType.Empire)
                {
                    if (factionType != FactionType.Rebel)
                    {
                        format = ((!this.isNonAttackerReplayView) ? "StarAnim{0}" : (this.ReplayPrefix + "StarAnim{0}"));
                    }
                    else
                    {
                        format = ((!this.isNonAttackerReplayView) ? "StarAnim{0}_Rebel" : (this.ReplayPrefix + "StarAnim{0}_Rebel"));
                    }
                }
                else
                {
                    format = ((!this.isNonAttackerReplayView) ? "StarAnim{0}_Empire" : (this.ReplayPrefix + "StarAnim{0}_Empire"));
                }
                UXElement element   = base.GetElement <UXElement>(string.Format(format, i));
                Animator  component = element.Root.GetComponent <Animator>();
                if (component == null)
                {
                    Service.Logger.WarnFormat("Unable to play end star anim #{0}", new object[]
                    {
                        i
                    });
                }
                else
                {
                    this.viewAnimators.Add(component);
                    KeyValuePair <int, Animator> keyValuePair = new KeyValuePair <int, Animator>(i, component);
                    uint item = Service.ViewTimerManager.CreateViewTimer((float)(i - 1) * 1f, false, new TimerDelegate(this.OnAnimateStarTimer), keyValuePair);
                    this.viewTimers.Add(item);
                }
            }
            uint item2 = Service.ViewTimerManager.CreateViewTimer((float)(stars - 1) * 1f + 0.35f, false, new TimerDelegate(this.OnAllStarsComplete), null);

            this.viewTimers.Add(item2);
        }
Example #15
0
        private void AddTroops(List <UXElement> list)
        {
            TroopUpgradeCatalog troopUpgradeCatalog = Service.TroopUpgradeCatalog;

            foreach (KeyValuePair <string, int> current in this.cp.Prizes.Troops)
            {
                if (current.Value > 0)
                {
                    PrizeType   prizeType = PrizeType.Infantry;
                    TroopTypeVO minLevel  = troopUpgradeCatalog.GetMinLevel(current.Key);
                    TroopType   type      = minLevel.Type;
                    if (type != TroopType.Vehicle)
                    {
                        if (type != TroopType.Mercenary)
                        {
                            if (type == TroopType.Hero)
                            {
                                prizeType = PrizeType.Hero;
                            }
                        }
                        else
                        {
                            prizeType = PrizeType.Mercenary;
                        }
                    }
                    else
                    {
                        prizeType = PrizeType.Vehicle;
                    }
                    UXElement item = this.CreateTileWithPrizeInfo(current.Key, current.Value, prizeType);
                    list.Add(item);
                }
            }
            foreach (KeyValuePair <string, int> current2 in this.cp.Prizes.SpecialAttacks)
            {
                if (current2.Value > 0)
                {
                    UXElement item2 = this.CreateTileWithPrizeInfo(current2.Key, current2.Value, PrizeType.SpecialAttack);
                    list.Add(item2);
                }
            }
        }
Example #16
0
        protected virtual void FilterGridBasedOnId(string filterId)
        {
            this.lastFilterId = filterId;
            List <UXElement> list = this.filterMap[filterId];
            int count             = this.gridToFilter.Count;

            for (int i = 0; i < count; i++)
            {
                UXElement item = this.gridToFilter.GetItem(i);
                if (list.Contains(item) && this.CanShowGridItem(item))
                {
                    item.Visible = true;
                }
                else
                {
                    item.Visible = false;
                }
            }
            this.gridToFilter.RepositionItems();
        }
Example #17
0
        private void SetupScreen(ProjectorConfig config)
        {
            this.DestroyQuad();
            this.quadGameObject                         = new GameObject(string.Format("Projector Quad ({0})", this.frameSprite.Root.name));
            this.quadGameObject.layer                   = this.frameSprite.Root.layer;
            this.quadGameObject.transform.parent        = this.frameSprite.Root.transform;
            this.quadGameObject.transform.localPosition = Vector3.zero;
            this.quadGameObject.transform.localScale    = Vector3.one;
            this.uiTexture             = this.quadGameObject.AddComponent <UITexture>();
            this.uiTexture.mainTexture = this.renderTexture;
            UXElement uXElement = new UXElement(this.frameSprite.UXCamera, this.quadGameObject, null);

            uXElement.Width       = this.frameSprite.Width;
            uXElement.Height      = this.frameSprite.Height;
            uXElement.WidgetDepth = this.frameSprite.WidgetDepth;
            if (config.Tint != Color.white)
            {
                this.uiTexture.color = config.Tint;
            }
        }
Example #18
0
        public RegionHighlight(UXElement highlight, float boardX, float boardZ, int width, int depth)
        {
            this.buttonHighlight        = highlight;
            this.buttonHighlight.Parent = Service.UXController.WorldAnchor;
            UnityUtils.SetLayerRecursively(highlight.Root, 8);
            this.buttonHighlight.UXCamera = Service.CameraManager.UXCamera;
            float num  = (float)depth / 2f;
            float num2 = (float)width / 2f;

            this.top    = new Vector3(Units.BoardToWorldX(boardX - num2), 0f, Units.BoardToWorldZ(boardZ - num));
            this.bottom = new Vector3(Units.BoardToWorldX(boardX + num2), 0f, Units.BoardToWorldZ(boardZ + num));
            this.left   = new Vector3(Units.BoardToWorldX(boardX - num2), 0f, Units.BoardToWorldZ(boardZ + num));
            this.right  = new Vector3(Units.BoardToWorldX(boardX + num2), 0f, Units.BoardToWorldZ(boardZ - num));
            this.center = (this.left + this.right) / 2f;
            this.cam    = Service.CameraManager.MainCamera;
            this.age    = 0f;
            this.UpdateHighlightPosition(0f);
            Service.ViewTimeEngine.RegisterFrameTimeObserver(this);
            this.buttonHighlight.Visible = true;
        }
Example #19
0
        public void SetupStatGridForPerk(PerkVO targetPerkVO, UXGrid statGrid, string templateElement, string descriptionElement, string valueElement, bool useUpgrade)
        {
            Lang lang = Service.Lang;
            StaticDataController staticDataController = Service.StaticDataController;

            string[] array       = null;
            string[] perkEffects = targetPerkVO.PerkEffects;
            int      num         = perkEffects.Length;

            statGrid.SetTemplateItem(templateElement);
            string perkGroup = targetPerkVO.PerkGroup;
            int    perkTier  = targetPerkVO.PerkTier;

            if (useUpgrade && perkTier > 1)
            {
                PerkVO perkByGroupAndTier = GameUtils.GetPerkByGroupAndTier(perkGroup, perkTier - 1);
                array = perkByGroupAndTier.PerkEffects;
                if (perkEffects.Length != num)
                {
                    Service.Logger.Error("PerkEffects list not consistent between " + perkByGroupAndTier.Uid + " and " + targetPerkVO.Uid);
                }
            }
            statGrid.Clear();
            for (int i = 0; i < num; i++)
            {
                PerkEffectVO perkEffectVO = staticDataController.Get <PerkEffectVO>(perkEffects[i]);
                PerkEffectVO prevVO       = null;
                if (array != null)
                {
                    prevVO = staticDataController.Get <PerkEffectVO>(array[i]);
                }
                string    itemUid     = perkEffectVO.Uid + i;
                UXElement item        = statGrid.CloneTemplateItem(itemUid);
                UXLabel   subElement  = statGrid.GetSubElement <UXLabel>(itemUid, descriptionElement);
                UXLabel   subElement2 = statGrid.GetSubElement <UXLabel>(itemUid, valueElement);
                subElement.Text  = lang.Get(perkEffectVO.StatStringId, new object[0]);
                subElement2.Text = this.GetFormattedValueBasedOnEffectType(perkEffectVO, prevVO);
                statGrid.AddItem(item, i);
            }
            statGrid.RepositionItems();
        }
Example #20
0
        private UXElement CreateDeployableUXElement(UXGrid grid, string uid, string assetName, int amount, IDeployableVO troop, BattleEntry battle)
        {
            UXElement       result          = grid.CloneTemplateItem(uid);
            UXSprite        subElement      = grid.GetSubElement <UXSprite>(uid, this.TroopCardIconName);
            ProjectorConfig projectorConfig = ProjectorUtils.GenerateGeometryConfig(troop, subElement);

            Service.EventManager.SendEvent(EventId.ButtonCreated, new GeometryTag(troop, projectorConfig, battle));
            projectorConfig.AnimPreference = AnimationPreference.NoAnimation;
            ProjectorUtils.GenerateProjector(projectorConfig);
            UXLabel subElement2 = grid.GetSubElement <UXLabel>(uid, this.TroopCardAmountName);

            subElement2.Text = LangUtils.GetMultiplierText(amount);
            UXLabel subElement3 = grid.GetSubElement <UXLabel>(uid, this.TroopCardLevelName);

            subElement3.Text = LangUtils.GetLevelText(troop.Lvl);
            FactionDecal.UpdateDeployableDecal(uid, grid, troop, this.TroopHeroDecalName);
            string text = null;

            if (troop is TroopTypeVO)
            {
                TroopTypeVO troop2 = troop as TroopTypeVO;
                Service.SkinController.GetApplicableSkin(troop2, battle.AttackerEquipment, out text);
            }
            int qualityInt;

            if (!string.IsNullOrEmpty(text))
            {
                StaticDataController staticDataController = Service.StaticDataController;
                EquipmentVO          equipmentVO          = staticDataController.Get <EquipmentVO>(text);
                qualityInt = (int)equipmentVO.Quality;
            }
            else
            {
                qualityInt = Service.DeployableShardUnlockController.GetUpgradeQualityForDeployable(troop);
            }
            UXUtils.SetCardQuality(this, this.troopGrid, uid, qualityInt, this.TroopCardQualityName, this.TroopCardDefaultName);
            UXButton subElement4 = grid.GetSubElement <UXButton>(uid, this.TroopCardName);

            this.troopTooltipHelper.RegisterButtonTooltip(subElement4, troop, battle);
            return(result);
        }
Example #21
0
        protected void InitElements()
        {
            this.nameLabel               = this.grid.GetSubElement <UXLabel>(this.id, "LabelName");
            this.typeLabel               = this.grid.GetSubElement <UXLabel>(this.id, "LabelType");
            this.squadSymbolSprite       = this.grid.GetSubElement <UXSprite>(this.id, "SpriteSquadSymbol");
            this.memberNumberLabel       = this.grid.GetSubElement <UXLabel>(this.id, "LabelMemberNumber");
            this.activeMemberNumberLabel = this.grid.GetSubElement <UXLabel>(this.id, "LabelMemberActiveNumber");
            this.rankLabel               = this.grid.GetSubElement <UXLabel>(this.id, "LabelRank");
            this.friendTexture           = this.grid.GetSubElement <UXTexture>(this.id, "FriendPic");
            this.squadFactionSprite      = this.grid.GetSubElement <UXSprite>(this.id, "SpriteFactionIcon");
            this.playerFactionSprite     = this.grid.GetSubElement <UXSprite>(this.id, "SpriteFactionUpgradeIcon");
            this.backButton              = this.grid.GetSubElement <UXButton>(this.id, "BtnScrollBack");
            this.buttonContainer         = this.grid.GetSubElement <UXElement>(this.id, "ButtonContainer");
            this.primaryButtonLabel      = this.grid.GetSubElement <UXLabel>(this.id, "LabelBtnPrimary");
            this.primaryButton           = this.grid.GetSubElement <UXButton>(this.id, "BtnPrimary");
            this.secondaryButtonLabel    = this.grid.GetSubElement <UXLabel>(this.id, "LabelBtnSecondary");
            this.secondaryButton         = this.grid.GetSubElement <UXButton>(this.id, "BtnSecondary");
            this.tertiaryButtonLabel     = this.grid.GetSubElement <UXLabel>(this.id, "LabelBtnTertiary");
            this.tertiaryButton          = this.grid.GetSubElement <UXButton>(this.id, "BtnTertiary");
            this.planetLabel             = this.grid.GetSubElement <UXLabel>(this.id, "LabelPlanet");
            this.planetBgTexture         = this.grid.GetSubElement <UXTexture>(this.id, "TexturePlanetBg");
            this.medalGroup              = this.grid.GetSubElement <UXElement>(this.id, "SquadInfoMedals");
            this.tournamentMedalGroup    = this.grid.GetSubElement <UXElement>(this.id, "SquadInfoTournamentMedals");
            this.tournamentMedalLabel    = this.grid.GetSubElement <UXLabel>(this.id, "LabelScoreTournamentMedals");
            this.tournamentMedalSprite   = this.grid.GetSubElement <UXSprite>(this.id, "SpriteSquadInfoTournamentMedalIcon");
            this.medalLabel              = this.grid.GetSubElement <UXLabel>(this.id, "LabelScore");
            this.attacksLabel            = this.grid.GetSubElement <UXLabel>(this.id, "LabelAttacksWon");
            this.defensesLabel           = this.grid.GetSubElement <UXLabel>(this.id, "LabelDefensesWon");
            this.bgSprite        = this.grid.GetSubElement <UXSprite>(this.id, "SpriteLeaderboardBg");
            this.arrowSprite     = this.grid.GetSubElement <UXSprite>(this.id, "SpriteScrollBtn");
            this.squadLevelGroup = this.grid.GetSubElement <UXElement>(this.id, "GroupSquadLevel");
            this.squadLevelLabel = this.grid.GetSubElement <UXLabel>(this.id, "LabelSquadLvl");
            this.item.AddUXButton(this.screen.GetElement <UXButton>(this.item.Root.name));
            this.item.OnElementClicked = new UXButtonClickedDelegate(this.OnClicked);
            this.backButton.OnClicked  = new UXButtonClickedDelegate(this.OnBackButtonClicked);
            this.tween = this.item.Root.GetComponent <UIPlayTween>();
            this.tween.playDirection = Direction.Forward;
            UIPlayTween component = this.backButton.Root.GetComponent <UIPlayTween>();

            component.tweenTarget = null;
        }
Example #22
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();

            uIInputComponent.onValidate = new UIInput.OnValidate(LangUtils.OnValidateWNewLines);
        }
Example #23
0
        protected void AddTroopItem(IUpgradeableVO troop, int troopCount)
        {
            TroopUpgradeTag item = new TroopUpgradeTag(troop as IDeployableVO, true);

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

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

            projectorConfig.AnimPreference = AnimationPreference.AnimationPreferred;
            ProjectorUtils.GenerateProjector(projectorConfig);
            UXLabel subElement3 = this.storageItemGrid.GetSubElement <UXLabel>(uid, "LabelTroopLevel");

            subElement3.Text = LangUtils.GetLevelText(troop.Lvl);
            this.storageItemGrid.GetSubElement <UXSprite>(uid, "SpriteCardEmpty").Visible = false;
            this.storageItemGrid.AddItem(item2, troop.Order);
        }
        public void Start()
        {
            EventManager eventManager = Service.Get <EventManager>();

            this.StopNow();
            this.animating = true;
            this.finishing = false;
            Service.Get <IBackButtonManager>().RegisterBackButtonHandler(this);
            if (this.animation == null)
            {
                this.modifiedCameras = false;
                this.FinishUp(false);
                return;
            }
            CameraManager cameraManager = Service.Get <CameraManager>();

            cameraManager.MainCamera.Camera.enabled = false;
            cameraManager.UXCamera.Camera.enabled   = false;
            Camera camera = this.uxCamera.Camera;

            this.oldNearClipPlane = camera.nearClipPlane;
            camera.fieldOfView    = 90f;
            camera.nearClipPlane  = 0.01f;
            camera.orthographic   = false;
            camera.enabled        = true;
            UXElement element = base.GetElement <UXElement>("ContainerBtnSkipIntro");
            float     x       = (float)Screen.width * 0.5f;
            float     num     = (float)Screen.height * 0.5f;
            float     z       = num;

            element.LocalPosition = new Vector3(x, num, z);
            this.skipLeft         = (float)Screen.width - element.Width;
            this.skipBottom       = (float)Screen.height - element.Height;
            Service.Get <UserInputManager>().RegisterObserver(this, UserInputLayer.Screen);
            this.modifiedCameras = true;
            this.Visible         = true;
            this.animation.Play();
            Service.Get <ViewTimeEngine>().RegisterFrameTimeObserver(this);
            eventManager.SendEvent(EventId.TextCrawlStarted, null);
        }
Example #25
0
        private void InitRewardGrid()
        {
            this.gridRewardItems.SetTemplateItem("TemplateListItem");
            List <SupplyCrateTag> rewardList = this.parent.GetRewardList();
            int count        = rewardList.Count;
            int crateHQLevel = this.parent.GetCrateHQLevel();

            for (int i = 0; i < count; i++)
            {
                SupplyCrateTag supplyCrateTag = rewardList[i];
                CrateSupplyVO  crateSupply    = supplyCrateTag.CrateSupply;
                string         itemUid        = crateSupply.Uid + i.ToString();
                UXElement      uXElement      = this.gridRewardItems.CloneTemplateItem(itemUid);
                this.gridRewardItems.AddItem(uXElement, i);
                UXSprite subElement = this.gridRewardItems.GetSubElement <UXSprite>(itemUid, "SpriteTypeListItem");
                subElement.SpriteName = this.GetRewardListSpriteName(supplyCrateTag);
                UXLabel subElement2 = this.gridRewardItems.GetSubElement <UXLabel>(itemUid, "LabelTypeListItem");
                subElement2.Text = GameUtils.GetRewardSupplyName(supplyCrateTag.CrateSupply, crateHQLevel);
                uXElement.InitAnimator();
            }
            this.gridRewardItems.RepositionItems();
        }
Example #26
0
        private void InitPvpPanel()
        {
            this.screen.GetElement <UXLabel>("LabelBattleCost").Text = base.LangController.Get("s_Cost", new object[0]);
            this.battleActionButtonLabel      = this.screen.GetElement <UXLabel>("LabelBtnBattleAction");
            this.battleActionButtonLabel.Text = base.LangController.Get("s_FindMatch", new object[0]);
            int     pvpMatchCost = Service.Get <PvpManager>().GetPvpMatchCost();
            UXLabel element      = this.screen.GetElement <UXLabel>("LabelBattleCostAmount");

            element.Text           = base.LangController.ThousandsSeparated(pvpMatchCost);
            this.pveContinueButton = this.screen.GetElement <UXButton>("BtnChapterAction");
            this.pvpAttackButton   = this.screen.GetElement <UXButton>("BtnBattleAction");
            this.battleCost        = this.screen.GetElement <UXElement>("BattleCost");
            this.labelBattleLocked = this.screen.GetElement <UXLabel>("LabelBattleLocked");
            this.labelBattleTitle  = this.screen.GetElement <UXLabel>("LabelBattleTitle");
            this.pvpMeshTexture    = this.screen.GetElement <UXMeshRenderer>("MeshPVPImage");
            int playerMedals = base.Player.PlayerMedals;

            this.screen.GetElement <UXLabel>("LabelMedalCount").Text = playerMedals.ToString();
            this.tournamentMedalsGroup  = this.screen.GetElement <UXElement>("TournamentMedalCount");
            this.tournamentMedalsLabel  = this.screen.GetElement <UXLabel>("LabelTournamentMedalCount");
            this.tournamentMedalsSprite = this.screen.GetElement <UXSprite>("SpriteTournamentMedalCount");
        }
Example #27
0
        private void RemoveAnEmptyCard(UXGrid grid)
        {
            List <UXElement> elementList = grid.GetElementList();
            UXElement        uXElement   = null;
            int i     = 0;
            int count = elementList.Count;

            while (i < count)
            {
                UXElement uXElement2 = elementList[i];
                if ((elementList[i].Tag as SortableEquipment).Equipment == null)
                {
                    uXElement = uXElement2;
                    break;
                }
                i++;
            }
            if (uXElement != null)
            {
                this.RemoveCardFromGrid(grid, uXElement);
            }
        }
Example #28
0
        private bool RemoveScreenHelper(UXElement screen)
        {
            int i     = 0;
            int count = this.screens.Count;

            while (i < count)
            {
                ScreenInfo screenInfo = this.screens[i];
                if (screenInfo.Screen == screen)
                {
                    this.RestoreDepths(i);
                    this.screens.RemoveAt(i);
                    if (i == this.screens.Count)
                    {
                        Service.EventManager.SendEvent(EventId.NewTopScreen, null);
                    }
                    return(true);
                }
                i++;
            }
            return(false);
        }
Example #29
0
        public void UpdateCurrencyTrayAttachment()
        {
            UXElement uXElement = base.GetOptionalElement <UXElement>("CurrencyTray");

            if (uXElement == null)
            {
                if (base.HasCollider())
                {
                    uXElement = this;
                }
                else
                {
                    uXElement = base.GetElement <UXElement>(this.root.name + "_main_widget");
                }
            }
            if (uXElement != null)
            {
                Service.Get <UXController>().MiscElementsManager.AttachCurrencyTrayToScreen(uXElement, this.GetDisplayCurrencyTrayType());
                return;
            }
            Service.Get <StaRTSLogger>().Warn("Cannot attach currency tray");
        }
Example #30
0
        private void AddUnlockedSlotsToGrid()
        {
            this.unlockedItemsGrid.SetTemplateItem("SlotCard");
            PerkManager perkManager             = Service.Get <PerkManager>();
            string      squadLevelUIDFromLevel  = GameUtils.GetSquadLevelUIDFromLevel(this.squadLevel - 1);
            string      squadLevelUIDFromLevel2 = GameUtils.GetSquadLevelUIDFromLevel(this.squadLevel);
            int         availableSlotsCount     = perkManager.GetAvailableSlotsCount(squadLevelUIDFromLevel);
            int         availableSlotsCount2    = perkManager.GetAvailableSlotsCount(squadLevelUIDFromLevel2);
            int         num = availableSlotsCount2 - availableSlotsCount;

            if (num > 0)
            {
                for (int i = 0; i < num; i++)
                {
                    string    itemUid    = "UnlockedSlot" + i;
                    UXElement item       = this.unlockedItemsGrid.CloneTemplateItem(itemUid);
                    UXLabel   subElement = this.unlockedItemsGrid.GetSubElement <UXLabel>(itemUid, "LabelSlotTitleUpCard");
                    subElement.Text = this.lang.Get("SQUAD_LEVEL_UP_CELEBRATION_SLOT", new object[0]);
                    this.unlockedItemsGrid.AddItem(item, this.unlockedItemsGrid.Count);
                }
            }
        }