예제 #1
0
        public void SetIAPRewardIcon(UXSprite iconSprite, string uid)
        {
            IDataController     dataController      = Service.Get <IDataController>();
            InAppPurchaseTypeVO inAppPurchaseTypeVO = dataController.Get <InAppPurchaseTypeVO>(uid);
            string rewardUid;

            if (Service.Get <CurrentPlayer>().Faction == FactionType.Empire)
            {
                rewardUid = inAppPurchaseTypeVO.RewardEmpire;
            }
            else
            {
                rewardUid = inAppPurchaseTypeVO.RewardRebel;
            }
            if (inAppPurchaseTypeVO.CurrencyType.Equals("hard") || inAppPurchaseTypeVO.CurrencyType.Equals("pack"))
            {
                UXUtils.SetupGeometryForIcon(iconSprite, inAppPurchaseTypeVO.CurrencyIconId);
                return;
            }
            RewardType  rewardType = RewardType.Invalid;
            IGeometryVO config;

            Service.Get <RewardManager>().GetFirstRewardAssetName(rewardUid, ref rewardType, out config);
            RewardUtils.SetRewardIcon(iconSprite, config, AnimationPreference.NoAnimation);
        }
예제 #2
0
        protected override void OnScreenLoaded()
        {
            this.InitButtons();
            this.playerNameLabel       = base.GetElement <UXLabel>("LabelPlayerName");
            this.attacksRemainingLabel = base.GetElement <UXLabel>("LabelAttacksRemaining");
            this.uplinksAvailableLabel = base.GetElement <UXLabel>("LabelUplinksAvailable");
            this.factionSprite         = base.GetElement <UXSprite>("SpriteFactionIcon");
            this.factionDefaultSprite  = base.GetElement <UXSprite>("SpriteFactionIconZero");
            this.playerDetailTexture   = base.GetElement <UXTexture>("TexturePlayerDetails");
            StaticDataController staticDataController = Service.StaticDataController;
            TextureVO            optional             = staticDataController.GetOptional <TextureVO>("squadwars_playerdetails_bg");

            if (optional != null)
            {
                this.playerDetailTexture.LoadTexture(optional.AssetName);
            }
            for (int i = 1; i <= 3; i++)
            {
                this.requirements.Add(base.GetElement <UXLabel>(string.Format("LabelStarRequirement{0}", i)));
                this.uplinks.Add(base.GetElement <UXSprite>(string.Format("SpriteUplink{0}", i)));
                this.checks.Add(base.GetElement <UXSprite>(string.Format("SpriteCheck{0}", i)));
                this.stars.Add(base.GetElement <UXElement>(string.Format("DamageStars{0}", i)));
            }
            this.RefreshView();
        }
예제 #3
0
        public void Init(FactionToggle factionToggle)
        {
            this.filterOptions      = this.uxFactory.GetElement <UXElement>("FilterOptions");
            this.filterBtn          = this.uxFactory.GetElement <UXButton>("BtnFilter");
            this.filterBtnLabel     = this.uxFactory.GetElement <UXLabel>("LabelBtnFilter");
            this.filterSprite       = this.uxFactory.GetElement <UXSprite>("SpriteBtnFilterSymbol");
            this.empireBtn          = this.uxFactory.GetElement <UXCheckbox>("BtnEmpire");
            this.empireBtnLabel     = this.uxFactory.GetElement <UXLabel>("LabelBtnEmpire");
            this.empireBtn.Selected = false;
            this.rebelBtn           = this.uxFactory.GetElement <UXCheckbox>("BtnRebel");
            this.rebelBtnLabel      = this.uxFactory.GetElement <UXLabel>("LabelBtnRebel");
            this.rebelBtn.Selected  = false;
            this.bothBtn            = this.uxFactory.GetElement <UXCheckbox>("BtnBoth");
            this.bothBtnLabel       = this.uxFactory.GetElement <UXLabel>("LabelBtnBoth");
            this.bothBtn.Selected   = true;
            Lang lang = Service.Lang;

            this.empireBtnLabel.Text  = lang.Get("s_Empire", new object[0]);
            this.rebelBtnLabel.Text   = lang.Get("s_Rebel", new object[0]);
            this.bothBtnLabel.Text    = lang.Get("s_Both", new object[0]);
            this.filterBtn.OnClicked  = new UXButtonClickedDelegate(this.FilterButtonClicked);
            this.empireBtn.OnSelected = new UXCheckboxSelectedDelegate(this.EmpireTabClicked);
            this.rebelBtn.OnSelected  = new UXCheckboxSelectedDelegate(this.RebelTabClicked);
            this.bothBtn.OnSelected   = new UXCheckboxSelectedDelegate(this.BothTabClicked);
            this.SelectFaction(factionToggle, false);
        }
예제 #4
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.Get <ViewTimeEngine>().RegisterClockTimeObserver(this, 1f);
        }
예제 #5
0
 protected override void SetupControls()
 {
     base.GetElement <UXLabel>("TickerDialogSmall").Visible = false;
     this.titleLabel.Text     = this.title;
     this.payButton.Visible   = true;
     this.payButton.OnClicked = new UXButtonClickedDelegate(this.OnPayButtonClicked);
     UXUtils.SetupCostElements(this, "Cost", null, 0, 0, 0, this.crystals, false, null);
     if (this.multiItemSpriteNames != null && this.multiItemLabelTexts != null)
     {
         this.groupMultipleItems.Visible = true;
         this.centerLabel.Visible        = false;
         this.rightLabel.Visible         = false;
         this.multiItemMessageLabel.Text = this.message;
         this.sprite.Visible             = false;
         this.textureImageInset.Enabled  = false;
         if (this.multiItemTable != null && this.multiItemSpriteNames.Count == this.multiItemLabelTexts.Count)
         {
             this.multiItemTable.Clear();
             int i     = 0;
             int count = this.multiItemSpriteNames.Count;
             while (i < count)
             {
                 string    itemUid     = i.ToString();
                 UXElement item        = this.multiItemTable.CloneTemplateItem(itemUid);
                 UXSprite  subElement  = this.multiItemTable.GetSubElement <UXSprite>(itemUid, "SpriteImageAndTextMultiple");
                 UXLabel   subElement2 = this.multiItemTable.GetSubElement <UXLabel>(itemUid, "LabelItemImageAndTextMultiple");
                 UXUtils.SetupGeometryForIcon(subElement, this.multiItemSpriteNames[i]);
                 subElement2.Text = this.multiItemLabelTexts[i];
                 this.multiItemTable.AddItem(item, i);
                 i++;
             }
         }
     }
 }
예제 #6
0
        protected override void OnScreenLoaded()
        {
            BuildingLookupController buildingLookupController = Service.BuildingLookupController;

            Service.UXController.HUD.Visible = false;
            this.InitButtons();
            this.SetUIText();
            this.LoadFx();
            UXSprite       element        = base.GetElement <UXSprite>("SpriteInstructions");
            BuildingTypeVO buildingTypeVO = null;

            if (this.isSpecialAttack)
            {
                if (buildingLookupController.HasStarshipCommand())
                {
                    FleetCommandNode head = buildingLookupController.FleetCommandNodeList.Head;
                    buildingTypeVO = head.BuildingComp.BuildingType;
                }
            }
            else
            {
                buildingTypeVO = buildingLookupController.GetHighestAvailableBuildingVOForTroop((TroopTypeVO)this.subjectVO);
            }
            if (buildingTypeVO != null)
            {
                ProjectorConfig projectorConfig = ProjectorUtils.GenerateGeometryConfig(buildingTypeVO, element, false);
                projectorConfig.AnimPreference = AnimationPreference.AnimationPreferred;
                ProjectorUtils.GenerateProjector(projectorConfig);
            }
            else
            {
                element.Visible = false;
            }
            this.fadingOutSubject = false;
        }
예제 #7
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();
 }
예제 #8
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;
 }
예제 #9
0
        private void SetupItemGrid()
        {
            this.itemGrid = base.GetElement <UXGrid>("UnlockItemsGrid");
            this.itemGrid.SetTemplateItem("UnlockItemsTemplate");
            BuildingLookupController         buildingLookupController = Service.Get <BuildingLookupController>();
            Dictionary <BuildingTypeVO, int> buildingsUnlockedBy      = buildingLookupController.GetBuildingsUnlockedBy(this.headQuarter);
            int num = 0;

            foreach (KeyValuePair <BuildingTypeVO, int> current in buildingsUnlockedBy)
            {
                BuildingTypeVO key   = current.get_Key();
                int            value = current.get_Value();
                if (key.Type == BuildingType.Turret && key.BuildingRequirement != this.headQuarter.Uid)
                {
                    if (num == 0)
                    {
                        num = value;
                    }
                }
                else
                {
                    string          uid             = key.Uid;
                    UXElement       item            = this.itemGrid.CloneTemplateItem(uid);
                    UXSprite        subElement      = this.itemGrid.GetSubElement <UXSprite>(uid, "SpriteItemImage");
                    ProjectorConfig projectorConfig = ProjectorUtils.GenerateBuildingConfig(key, subElement);
                    projectorConfig.AnimPreference = AnimationPreference.AnimationPreferred;
                    ProjectorUtils.GenerateProjector(projectorConfig);
                    UXLabel subElement2 = this.itemGrid.GetSubElement <UXLabel>(uid, "LabelUnlockCount");
                    if (key.Type == BuildingType.Turret)
                    {
                        subElement2.Visible = false;
                    }
                    else
                    {
                        subElement2.Text = this.lang.Get("TROOP_MULTIPLIER", new object[]
                        {
                            value
                        });
                    }
                    this.itemGrid.AddItem(item, key.Order);
                }
            }
            UXElement item2       = this.itemGrid.CloneTemplateItem("TURRETS");
            UXSprite  subElement3 = this.itemGrid.GetSubElement <UXSprite>("TURRETS", "SpriteItemImage");

            subElement3.Visible = false;
            UXLabel subElement4 = this.itemGrid.GetSubElement <UXLabel>("TURRETS", "LabelUnlockCount");

            subElement4.Visible = false;
            UXLabel subElement5 = this.itemGrid.GetSubElement <UXLabel>("TURRETS", "LabelTurrets");

            subElement5.Visible = true;
            subElement5.Text    = this.lang.Get("HQ_UPGRADE_TURRETS_UNLOCKED", new object[]
            {
                num
            });
            this.itemGrid.AddItem(item2, 99999999);
            this.itemGrid.RepositionItems();
            this.itemGrid.Scroll((this.itemGrid.Count > 7) ? 0f : 0.5f);
        }
예제 #10
0
        private void SetupDeployableShardProgress(string itemUID, ShardVO shard)
        {
            CurrentPlayer          currentPlayer          = Service.Get <CurrentPlayer>();
            TroopUpgradeCatalog    troopUpgradeCatalog    = Service.Get <TroopUpgradeCatalog>();
            StarshipUpgradeCatalog starshipUpgradeCatalog = Service.Get <StarshipUpgradeCatalog>();
            UXSlider subElement  = this.rewardsGrid.GetSubElement <UXSlider>(itemUID, "pBarRewardItemFrag");
            UXSprite subElement2 = this.rewardsGrid.GetSubElement <UXSprite>(itemUID, "SpriteRewardItempBarFrag");

            subElement.Visible = true;
            UXLabel       subElement3 = this.rewardsGrid.GetSubElement <UXLabel>(itemUID, "LabelFragProgress");
            UXElement     subElement4 = this.rewardsGrid.GetSubElement <UXElement>(itemUID, "IconUpgrade");
            IDeployableVO deployableVO;
            IDeployableVO byLevel;

            if (shard.TargetType == "specialAttack")
            {
                int nextLevel = currentPlayer.UnlockedLevels.Starships.GetNextLevel(shard.TargetGroupId);
                deployableVO = starshipUpgradeCatalog.GetByLevel(shard.TargetGroupId, nextLevel);
                byLevel      = starshipUpgradeCatalog.GetByLevel(shard.TargetGroupId, nextLevel - 1);
            }
            else
            {
                int nextLevel = currentPlayer.UnlockedLevels.Troops.GetNextLevel(shard.TargetGroupId);
                deployableVO = troopUpgradeCatalog.GetByLevel(shard.TargetGroupId, nextLevel);
                byLevel      = troopUpgradeCatalog.GetByLevel(shard.TargetGroupId, nextLevel - 1);
            }
            if (deployableVO == null)
            {
                subElement3.Text = this.lang.Get("MAX_LEVEL", new object[0]);
                subElement.Value = 1f;
                return;
            }
            bool flag = Service.Get <UnlockController>().IsMinLevelUnlocked(deployableVO);

            if (!flag)
            {
                deployableVO = byLevel;
            }
            int shardAmount       = Service.Get <DeployableShardUnlockController>().GetShardAmount(deployableVO.UpgradeShardUid);
            int upgradeShardCount = deployableVO.UpgradeShardCount;

            subElement3.Text = this.lang.Get("FRACTION", new object[]
            {
                shardAmount,
                upgradeShardCount
            });
            if (upgradeShardCount == 0)
            {
                Service.Get <StaRTSLogger>().ErrorFormat("CMS Error: Shards required for {0} is zero", new object[]
                {
                    deployableVO.Uid
                });
                return;
            }
            float sliderValue = (float)shardAmount / (float)upgradeShardCount;

            UXUtils.SetShardProgressBarValue(subElement, subElement2, sliderValue);
            subElement4.Visible = (flag && shardAmount >= upgradeShardCount);
        }
예제 #11
0
 public static void SetupFragmentIconSprite(UXSprite fragmentSprite, int quality)
 {
     if (fragmentSprite != null)
     {
         fragmentSprite.Visible    = true;
         fragmentSprite.SpriteName = string.Format("icoDataFragQ{0}", quality);
     }
 }
예제 #12
0
        private void OnInfoClicked(UXButton button)
        {
            this.labelItemInfo.Visible = !this.labelItemInfo.Visible;
            this.buttonInfo.Visible    = !this.labelItemInfo.Visible;
            UXSprite element = base.GetElement <UXSprite>((!this.useStorageGroup) ? "BldgImageFrame" : "BldgImageFrameStorage");

            element.Visible = !this.labelItemInfo.Visible;
        }
예제 #13
0
        private void OnInfoStorageClicked(UXButton button)
        {
            this.labelItemInfoStorage.Visible = !this.labelItemInfoStorage.Visible;
            this.buttonInfoStorage.Visible    = !this.labelItemInfoStorage.Visible;
            UXSprite element = base.GetElement <UXSprite>("BldgImageFrameStorage");

            element.Visible = !this.labelItemInfoStorage.Visible;
        }
예제 #14
0
 private static void HideIconMinX(UXSprite icon, ref Vector3 minP)
 {
     if (icon != null)
     {
         icon.Visible = false;
         minP.x       = Mathf.Min(minP.x, icon.LocalPosition.x);
     }
 }
예제 #15
0
 protected override void OnScreenLoaded()
 {
     this.lockedSprite = base.GetElement <UXSprite>("SpriteIconTitleLockedPlanet");
     this.InitLabels();
     this.InitButtons();
     this.SetupCurrentPlanetElements();
     this.InitFeaturedRewardsGrid();
 }
예제 #16
0
        private void UpdateCurrentTournamentTier()
        {
            TournamentRank tournamentFinalRank = base.Player.TournamentProgress.GetTournamentFinalRank(this.currentTournamentVO.Uid);

            if (tournamentFinalRank != null && !string.IsNullOrEmpty(tournamentFinalRank.TierUid))
            {
                this.OnTournamentRankUpdated(null, tournamentFinalRank, this.currentTournamentVO.Uid);
            }
            else
            {
                UXLabel arg_90_0 = this.endedTierLabel;
                string  text     = base.LangController.Get("CONFLICT_TIER_LOADING", new object[0]);
                this.inProgressTopTierLabel.Text = text;
                text = text;
                this.inProgressNextTierLabel.Text = text;
                text = text;
                this.inProgressCurrentTierLabel.Text = text;
                arg_90_0.Text = text;
                UXLabel arg_CD_0 = this.inProgressCurrentRewardLabel;
                text = base.LangController.Get("s_Loading", new object[0]);
                this.inProgressTopRewardLabel.Text = text;
                text = text;
                this.inProgressNextRewardLabel.Text = text;
                arg_CD_0.Text = text;
                UXSprite arg_131_0 = this.inProgressNextTierIconSprite;
                text = string.Empty;
                this.endedTierIconSprite.SpriteName = text;
                text = text;
                this.inProgressTopRewardSprite.SpriteName = text;
                text = text;
                this.inProgressNextRewardSprite.SpriteName = text;
                text = text;
                this.inProgressCurrentRewardSprite.SpriteName = text;
                text = text;
                this.inProgressTopTierIconSprite.SpriteName = text;
                text = text;
                this.inProgressCurrentTierIconSprite.SpriteName = text;
                arg_131_0.SpriteName = text;
                UXLabel arg_16B_0 = this.endedTierPercentLabel;
                text = string.Empty;
                this.inProgressTopTierPercentLabel.Text = text;
                text = text;
                this.inProgressNextTierPercentLabel.Text = text;
                text = text;
                this.inProgressCurrentTierPercentLabel.Text = text;
                arg_16B_0.Text = text;
                this.inProgressCurrentRewardItemCardBasic.Visible    = false;
                this.inProgressCurrentRewardItemCardAdvanced.Visible = false;
                this.inProgressCurrentRewardItemCardElite.Visible    = false;
                this.inProgressNextRewardItemCardBasic.Visible       = false;
                this.inProgressNextRewardItemCardAdvanced.Visible    = false;
                this.inProgressNextRewardItemCardElite.Visible       = false;
                this.inProgressTopRewardItemCardBasic.Visible        = false;
                this.inProgressTopRewardItemCardAdvanced.Visible     = false;
                this.inProgressTopRewardItemCardElite.Visible        = false;
                this.tournamentController.UpdatePlayerRank(new TournamentController.PlayerRankUpdatedCallback(this.OnTournamentRankUpdated), this.currentTournamentVO);
            }
        }
예제 #17
0
        private void InitRewardsGrid()
        {
            this.rewardsGrid = base.GetElement <UXGrid>("GridRewardsList");
            this.rewardsGrid.SetTemplateItem("TemplateRewards");
            if (this.filteredFlyoutItems.Count == 0)
            {
                base.GetElement <UXElement>("PanelGroupRewardPreview").Visible = false;
                this.rewardsGrid.Visible       = false;
                this.labelRewardChance.Visible = false;
                return;
            }
            int i     = 0;
            int count = this.filteredFlyoutItems.Count;

            while (i < count)
            {
                CrateFlyoutItemVO crateFlyoutItemVO = this.filteredFlyoutItems[i];
                string            uid        = crateFlyoutItemVO.Uid;
                UXElement         uXElement  = this.rewardsGrid.CloneTemplateItem(uid);
                UXLabel           subElement = this.rewardsGrid.GetSubElement <UXLabel>(uid, "LabelChance");
                subElement.Text = this.lang.Get(crateFlyoutItemVO.ListChanceString, new object[0]);
                UXLabel subElement2 = this.rewardsGrid.GetSubElement <UXLabel>(uid, "LabelRewardName");
                subElement2.Text = this.lang.Get(crateFlyoutItemVO.ListDescString, new object[0]);
                UXElement subElement3 = this.rewardsGrid.GetSubElement <UXElement>(uid, "Group2Option");
                UXSprite  subElement4 = this.rewardsGrid.GetSubElement <UXSprite>(uid, "Sprite2OptionA");
                UXLabel   subElement5 = this.rewardsGrid.GetSubElement <UXLabel>(uid, "LabelConjunction");
                UXSprite  subElement6 = this.rewardsGrid.GetSubElement <UXSprite>(uid, "Sprite2OptionB");
                UXSprite  subElement7 = this.rewardsGrid.GetSubElement <UXSprite>(uid, "SpriteGridReward");
                string[]  listIcons   = crateFlyoutItemVO.ListIcons;
                if (listIcons != null)
                {
                    if (listIcons.Length == 1)
                    {
                        subElement7.SpriteName = listIcons[0];
                        subElement3.Visible    = false;
                    }
                    else if (listIcons.Length == 2)
                    {
                        subElement4.SpriteName = listIcons[0];
                        subElement6.SpriteName = listIcons[1];
                        subElement5.Text       = this.lang.Get("OR", new object[0]);
                        subElement7.Visible    = false;
                    }
                }
                else
                {
                    subElement3.Visible = false;
                    subElement7.Visible = false;
                }
                this.UpdateRowHighlight(uid, false);
                UXButton uXButton = (UXButton)uXElement;
                uXButton.Tag       = i;
                uXButton.OnClicked = new UXButtonClickedDelegate(this.OnGridItemButtonClicked);
                this.rewardsGrid.AddItem(uXElement, i);
                i++;
            }
            this.rewardsGrid.RepositionItems();
        }
예제 #18
0
        private void SetupProjectorWithUpdatedConfig(IGeometryVO geometryVO)
        {
            UXSprite frameSprite = this.projector.Config.FrameSprite;

            this.projector.Destroy();
            ProjectorConfig config = ProjectorUtils.GenerateBuildingConfig(geometryVO as BuildingTypeVO, frameSprite);

            this.projector = ProjectorUtils.GenerateProjector(config);
        }
예제 #19
0
 public void Initialize()
 {
     this.stashPanel        = this.hud.GetElement <UXElement>("StashPanelHolder");
     this.stashTray         = this.hud.GetElement <UXSprite>("SpriteStashTray");
     this.newJewelContainer = this.hud.GetElement <UXElement>("ContainerJewelBattleActivateStash");
     this.InitLabels();
     this.InitButtons();
     this.InitGrid();
 }
예제 #20
0
 private static void SetSpriteAndVisibility(UXSprite sprite, string spriteName)
 {
     if (spriteName != null)
     {
         sprite.SpriteName = spriteName;
         sprite.Visible    = true;
         return;
     }
     sprite.Visible = false;
 }
예제 #21
0
        protected virtual void InitImages()
        {
            IGeometryVO     imageGeometryConfig = this.GetImageGeometryConfig();
            UXSprite        element             = base.GetElement <UXSprite>((!this.useStorageGroup) ? "BldgImageFrame" : "BldgImageFrameStorage");
            ProjectorConfig projectorConfig     = ProjectorUtils.GenerateBuildingConfig(imageGeometryConfig as BuildingTypeVO, element);

            projectorConfig.AnimPreference = AnimationPreference.AnimationAlways;
            this.projector = ProjectorUtils.GenerateProjector(projectorConfig);
            base.GetElement <UXSprite>("SpriteSquadSymbol").Visible = false;
        }
예제 #22
0
 public override void Destroy()
 {
     base.Destroy();
     Service.EventManager.UnregisterObserver(this, EventId.WarVictoryPointsUpdated);
     this.participantState  = null;
     this.labelTroopTooltip = null;
     this.spritePoint1      = null;
     this.spritePoint2      = null;
     this.spritePoint3      = null;
 }
예제 #23
0
        private void InitSymbolSelector()
        {
            this.containerSymbols = base.GetElement <UXElement>("ContainerSquadIcons");
            UXLabel element = base.GetElement <UXLabel>("LabelSelectSymbolInner");

            element.Text = this.lang.Get("SELECT_SQUAD_SYMBOL", new object[0]);
            UXLabel element2 = base.GetElement <UXLabel>("LabelSelectSymbol");

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

            element3.Text = this.lang.Get("s_Confirm", new object[0]);
            UXButton element4 = base.GetElement <UXButton>("BtnConfirm");

            element4.OnClicked = new UXButtonClickedDelegate(this.OnConfirmSymbolClicked);
            UXButton element5 = base.GetElement <UXButton>("BtnSelectSymbol");

            element5.OnClicked        = new UXButtonClickedDelegate(this.OnShowSymbolsClicked);
            this.spriteSelectedSymbol = base.GetElement <UXSprite>("SpriteBtnSelectSymbol");
            for (int i = 1; i <= 16; i++)
            {
                string name = string.Format("Toggle{0:D2}", new object[]
                {
                    i
                });
                string tag = string.Format("SquadSymbols_{0:D2}", new object[]
                {
                    i
                });
                UXCheckbox element6 = base.GetElement <UXCheckbox>(name);
                element6.Tag        = tag;
                element6.OnSelected = new UXCheckboxSelectedDelegate(this.OnSymbolSelected);
            }
            string text;
            string text2;

            if (Service.Get <CurrentPlayer>().Faction == FactionType.Empire)
            {
                text  = "MakerEmpire";
                text2 = "MakerRebel";
            }
            else
            {
                text  = "MakerRebel";
                text2 = "MakerEmpire";
            }
            UXCheckbox element7 = base.GetElement <UXCheckbox>("Toggle" + text);

            element7.Tag        = "SquadSymbols_" + text;
            element7.OnSelected = new UXCheckboxSelectedDelegate(this.OnSymbolSelected);
            UXCheckbox element8 = base.GetElement <UXCheckbox>("Toggle" + text2);

            element8.Visible = false;
        }
예제 #24
0
        private void HideStickerVisuals(StoreTab tab)
        {
            string    text            = string.Format("Texture{0}Icon", tab.ToString());
            string    name            = string.Format("Widget{0}Special", tab.ToString());
            string    text2           = string.Format("SpriteBannerGradient{0}Special", tab.ToString());
            string    text3           = string.Format("SpriteBanner{0}Special", tab.ToString());
            string    text4           = string.Format("LabelSee{0}Deals", tab.ToString());
            string    text5           = string.Format("SpriteSee{0}DealsStroke", tab.ToString());
            string    text6           = string.Format("SpriteSee{0}DealsIcon", tab.ToString());
            string    text7           = string.Format("SpriteBkgStrokeTab{0}", tab.ToString());
            string    text8           = string.Format("SpriteBkgDetailRightTab{0}", tab.ToString());
            string    text9           = string.Format("SpriteBkgDetailLeftTab{0}", tab.ToString());
            string    text10          = string.Format("SpriteBkgInnerGlowTab{0}", tab.ToString());
            UXTexture optionalElement = this.parentStoreScreen.GetOptionalElement <UXTexture>(text);

            if (optionalElement != null && this.orginalTextureNames.ContainsKey(text))
            {
                optionalElement.LoadTexture(this.orginalTextureNames[text]);
            }
            UXElement optionalElement2 = this.parentStoreScreen.GetOptionalElement <UXElement>(name);

            if (optionalElement2 != null)
            {
                optionalElement2.Visible = false;
            }
            UXSprite optionalElement3 = this.parentStoreScreen.GetOptionalElement <UXSprite>(text2);

            this.RestoreOriginalSpriteColor(text2, optionalElement3);
            UXSprite optionalElement4 = this.parentStoreScreen.GetOptionalElement <UXSprite>(text3);

            this.RestoreOriginalSpriteColor(text3, optionalElement4);
            UXLabel optionalElement5 = this.parentStoreScreen.GetOptionalElement <UXLabel>(text4);

            this.RestoreOriginalLabelColor(text4, optionalElement5);
            UXSprite optionalElement6 = this.parentStoreScreen.GetOptionalElement <UXSprite>(text5);

            this.RestoreOriginalSpriteColor(text5, optionalElement6);
            UXSprite optionalElement7 = this.parentStoreScreen.GetOptionalElement <UXSprite>(text6);

            this.RestoreOriginalSpriteColor(text6, optionalElement7);
            UXSprite optionalElement8 = this.parentStoreScreen.GetOptionalElement <UXSprite>(text7);

            this.RestoreOriginalSpriteColor(text7, optionalElement8);
            UXSprite optionalElement9 = this.parentStoreScreen.GetOptionalElement <UXSprite>(text8);

            this.RestoreOriginalSpriteColor(text8, optionalElement9);
            UXSprite optionalElement10 = this.parentStoreScreen.GetOptionalElement <UXSprite>(text9);

            this.RestoreOriginalSpriteColor(text9, optionalElement10);
            UXSprite optionalElement11 = this.parentStoreScreen.GetOptionalElement <UXSprite>(text10);

            this.RestoreOriginalSpriteColor(text10, optionalElement11);
        }
예제 #25
0
        private static void AddBuffIcon(AbstractUXList list, string buffBaseId, int order, StaticDataController dc)
        {
            WarBuffVO warBuffVO = dc.Get <WarBuffVO>(buffBaseId);
            UXElement uXElement = list.CloneTemplateItem(buffBaseId);
            UXSprite  uXSprite  = uXElement as UXSprite;

            if (uXSprite != null)
            {
                uXSprite.SpriteName = warBuffVO.BuffIcon;
            }
            list.AddItem(uXElement, order);
        }
예제 #26
0
 private void UpdateTierInfoUI(TournamentTierVO tierVO, float percentile, UXSprite sprite, UXLabel tierName, UXLabel tierPercent)
 {
     if (tierVO != null)
     {
         sprite.SpriteName = this.tournamentController.GetTierIconName(tierVO);
         tierName.Text     = this.GetTierTitleString(tierVO);
         tierPercent.Text  = base.LangController.Get("CONFLICT_TIER_PERCENTILE", new object[]
         {
             Math.Round((double)percentile, 2)
         });
     }
 }
예제 #27
0
 public LongPressView()
 {
     this.cams              = Service.Get <CameraManager>();
     this.time              = Service.Get <ViewTimeEngine>();
     this.uxc               = Service.Get <UXController>();
     this.preFadeDuration   = GameConstants.EDIT_LONG_PRESS_PRE_FADE;
     this.fadeDuration      = GameConstants.EDIT_LONG_PRESS_FADE;
     this.longPress         = this.uxc.MiscElementsManager.CreateLongPress("LongPress", this.uxc.WorldAnchor);
     this.longPress.Visible = false;
     this.longPressFill     = this.uxc.MiscElementsManager.GetChildElementSprite(this.longPress, "SpriteLongPressFill");
     this.longPressBkg      = this.uxc.MiscElementsManager.GetChildElementSprite(this.longPress, "SpriteLongPressBkg");
     this.registered        = false;
 }
예제 #28
0
        private void CreateGenericTableButton(string btnID, string displayText, string spriteName, UXButtonClickedDelegate onClicked, int index)
        {
            UXButton uXButton = (UXButton)this.genericTransmissionButtonTable.CloneTemplateItem(btnID);

            uXButton.OnClicked = onClicked;
            UXLabel subElement = this.genericTransmissionButtonTable.GetSubElement <UXLabel>(btnID, "LabelBtnPrimary");

            subElement.Text = displayText;
            UXSprite subElement2 = this.genericTransmissionButtonTable.GetSubElement <UXSprite>(btnID, "SpriteBkgPrimary");

            subElement2.SpriteName = spriteName;
            this.genericTransmissionButtonTable.AddItem(uXButton, index);
        }
        public override void OnScreenLoaded()
        {
            this.chatFilterPanel                 = this.screen.GetElement <UXElement>("ChatFilterOptionsPanel");
            this.chatFilterPanel.Visible         = false;
            this.chatShowAllBtn                  = this.screen.GetElement <UXCheckbox>("BtnShowAll");
            this.chatShowAllBtn.Tag              = ChatFilterType.ShowAll;
            this.chatShowAllBtn.OnSelected       = new UXCheckboxSelectedDelegate(this.OnChatFilterSelected);
            this.chatShowMsgBtn                  = this.screen.GetElement <UXCheckbox>("BtnMessages");
            this.chatShowMsgBtn.Tag              = ChatFilterType.Messages;
            this.chatShowMsgBtn.OnSelected       = new UXCheckboxSelectedDelegate(this.OnChatFilterSelected);
            this.chatShowRequestsBtn             = this.screen.GetElement <UXCheckbox>("BtnRequests");
            this.chatShowRequestsBtn.Tag         = ChatFilterType.Requests;
            this.chatShowRequestsBtn.OnSelected  = new UXCheckboxSelectedDelegate(this.OnChatFilterSelected);
            this.chatShowReplaysBtn              = this.screen.GetElement <UXCheckbox>("BtnReplays");
            this.chatShowReplaysBtn.Tag          = ChatFilterType.Replays;
            this.chatShowReplaysBtn.OnSelected   = new UXCheckboxSelectedDelegate(this.OnChatFilterSelected);
            this.chatShowUpdatesBtn              = this.screen.GetElement <UXCheckbox>("BtnUpdates");
            this.chatShowUpdatesBtn.Tag          = ChatFilterType.Updates;
            this.chatShowUpdatesBtn.OnSelected   = new UXCheckboxSelectedDelegate(this.OnChatFilterSelected);
            this.chatShowVideosBtn               = this.screen.GetElement <UXCheckbox>("BtnVideos");
            this.chatShowVideosBtn.Tag           = ChatFilterType.Videos;
            this.chatShowVideosBtn.OnSelected    = new UXCheckboxSelectedDelegate(this.OnChatFilterSelected);
            this.chatOpenFiltersButton           = this.screen.GetElement <UXButton>("BtnFilterChat");
            this.chatOpenFiltersButton.OnClicked = new UXButtonClickedDelegate(this.OnChatFilterButton);
            this.chatOpenFiltersLabel            = this.screen.GetElement <UXLabel>("LabelBtnFilterChat");
            this.chatFilterBG        = this.screen.GetElement <UXSprite>("SpriteFilterBg");
            this.chatFilterBGNoVideo = this.screen.GetElement <UXSprite>("SpriteFilterBg2");
            if (GameConstants.IsMakerVideoEnabled())
            {
                this.chatFilterBG.Visible        = true;
                this.chatFilterBGNoVideo.Visible = false;
                this.chatShowVideosBtn.Visible   = true;
            }
            else
            {
                this.chatFilterBG.Visible        = false;
                this.chatFilterBGNoVideo.Visible = true;
                this.chatShowVideosBtn.Visible   = false;
            }
            this.chatBadge     = JewelControl.Create(this.screen, "SocialChat");
            this.messageBadge  = JewelControl.Create(this.screen, "Messages");
            this.requestsBadge = JewelControl.Create(this.screen, "Requests");
            this.replaysBadge  = JewelControl.Create(this.screen, "Replays");
            this.updatesBadge  = JewelControl.Create(this.screen, "Updates");
            this.videosBadge   = JewelControl.Create(this.screen, "Videos");
            SquadController squadController = Service.Get <SquadController>();
            uint            squadPlayerPref = this.GetSquadPlayerPref("ChatFilterType", 1u);

            squadController.StateManager.SetSquadScreenChatFilterType((ChatFilterType)squadPlayerPref);
            this.RefreshView();
        }
예제 #30
0
        public DeployableTroopControl(UXCheckbox troopCheckbox, UXLabel troopCountLabel, UXSprite dimmerSprite, UXElement optionalGlowSprite, UXElement optionalActivateFxSprite, GeometryProjector optionalGeometry, bool isHero, bool isStarship, string uid, UXElement equipmentFX)
        {
            this.IsHero                  = isHero;
            this.IsStarship              = isStarship;
            this.DeployableUid           = uid;
            this.TroopCheckbox           = troopCheckbox;
            this.TroopCountLabel         = troopCountLabel;
            this.AbilityState            = HeroAbilityState.Dormant;
            this.cardDimmer              = dimmerSprite;
            this.glowElement             = optionalGlowSprite;
            this.abilityActivateFxSprite = optionalActivateFxSprite;
            this.geometry                = optionalGeometry;
            this.EquipmentFX             = equipmentFX;
            if (this.abilityActivateFxSprite != null)
            {
                this.abilityActivateFxSprite.Visible = false;
            }
            this.Enable();
            if (this.EquipmentFX == null)
            {
                return;
            }
            StaticDataController staticDataController = Service.StaticDataController;

            if (this.IsEquipmentActiveOnDeployable(staticDataController, this.DeployableUid))
            {
                EventManager eventManager = Service.EventManager;
                eventManager.RegisterObserver(this, EventId.WorldInTransitionComplete);
                eventManager.RegisterObserver(this, EventId.HoloCommScreenDestroyed, EventPriority.AfterDefault);
                this.observingStarshipEvents       = this.IsStarship;
                this.observingTroopEquipmentEvents = !this.IsStarship;
            }
            if (this.IsHero)
            {
                EventManager eventManager2 = Service.EventManager;
                string       ability       = staticDataController.Get <TroopTypeVO>(this.DeployableUid).Ability;
                if (!string.IsNullOrEmpty(ability))
                {
                    TroopAbilityVO troopAbilityVO = staticDataController.Get <TroopAbilityVO>(ability);
                    if (!troopAbilityVO.Auto)
                    {
                        this.totalCoolDownTime = (troopAbilityVO.CoolDownTime + troopAbilityVO.Duration) * 0.001f;
                        eventManager2.RegisterObserver(this, EventId.HeroDeployed);
                        eventManager2.RegisterObserver(this, EventId.HeroKilled);
                        eventManager2.RegisterObserver(this, EventId.TroopAbilityDeactivate);
                        eventManager2.RegisterObserver(this, EventId.TroopAbilityCoolDownComplete);
                        this.observingHeroEvents = true;
                    }
                }
            }
        }