protected override void OnScreenLoaded() { base.OnScreenLoaded(); UIPanel component = this.panel.Root.GetComponent <UIPanel>(); component.topAnchor.absolute = -10; base.TabClicked(true, this.initialTab); this.titleLabel.Text = this.lang.Get("JOIN_A_SQUAD", new object[0]); this.InitSearch(); base.GetElement <UXElement>("FilterOptions").Visible = false; base.GetElement <UXButton>("BtnFilter").Visible = false; this.navigationRow.Visible = false; if (Service.Get <LeaderboardController>().ShouldRefreshData(PlayerListType.FeaturedSquads, null)) { Service.Get <LeaderboardController>().UpdateFeaturedSquads(new LeaderboardController.OnUpdateData(this.OnGetFeaturedSquads)); } if (GameConstants.SQUAD_INVITES_ENABLED) { EventManager eventManager = Service.Get <EventManager>(); eventManager.RegisterObserver(this, EventId.SquadJoinInviteReceived); eventManager.RegisterObserver(this, EventId.SquadJoinInviteRemoved); this.squadIdsRequiringDetails = new List <string>(); this.invitesJewel = JewelControl.Create(this, "Invites"); List <SquadInvite> squadInvites = Service.Get <SquadController>().StateManager.SquadInvites; if (squadInvites != null) { this.UpdateSquadDataForInvites(squadInvites); this.UpdateInvitesJewel(); return; } eventManager.RegisterObserver(this, EventId.SquadJoinInvitesReceived); this.invitesJewel.Value = 0; } }
public override void OnScreenLoaded() { this.perkContainerGroup = this.screen.GetElement <UXElement>("PerksContainer"); this.perkContainerGroup.Visible = false; UXElement element = this.screen.GetElement <UXElement>(SquadScreenBasePerkInfoView.PERK_ACTIVATION_INFO_VIEW); element.Visible = false; this.perkCurrencyTrayGroup = this.screen.GetElement <UXElement>("PanelContainerCurrencyTrayPerks"); UXElement element2 = this.screen.GetElement <UXElement>(SquadScreenConfirmPerkUpgradeView.PERK_INVEST_CONFIRM_VIEW); element2.Visible = false; this.squadTitleLabel = this.screen.GetElement <UXLabel>("LabelTitlePerks"); this.squadTitleLabel.Text = this.lang.Get("PERK_MAIN_TITLE", new object[0]); UXButton element3 = this.screen.GetElement <UXButton>("SquadLevelMainGroupPerks"); element3.OnClicked = new UXButtonClickedDelegate(this.OnSquadLevelSelected); this.squadLevelLabel = this.screen.GetElement <UXLabel>("LabelSquadLvlPerks"); this.squadLevelProgressLabel = this.screen.GetElement <UXLabel>("LabelSquadLvlProgressPerks"); this.squadLevelProgressBar = this.screen.GetElement <UXSlider>("PBarSquadLevelMainPerks"); this.tabButton = this.screen.GetElement <UXCheckbox>("SocialPerksBtn"); this.tabButton.OnSelected = new UXCheckboxSelectedDelegate(this.OnTabButtonSelected); this.perkTabBadge = JewelControl.Create(this.screen, "Perks"); this.InitPerkTabs(); this.RefreshSquadLevel(); this.RegisterEvents(); }
protected override void OnScreenLoaded() { Service.Get <BuildingController>().CancelEditModeTimer(); base.InitAnimations("ChatHolder", "anim_chat_display"); this.chatHolderPanel = base.GetElement <UXElement>("ChatHolderPanel"); this.squadSlideBtn = base.GetElement <UXButton>("ButtonChat"); this.squadSlideBtn.OnClicked = new UXButtonClickedDelegate(this.OnSquadSlideClicked); this.bgDialog = base.GetElement <UXElement>("BgDialog"); this.bgDialog.Visible = false; this.squadNavigation = base.GetElement <UXElement>("SquadNavigation"); this.squadNavigation.Visible = false; this.squadBadge = JewelControl.Create(this, "Chat"); this.closeSquadBtn = base.GetElement <UXButton>("BtnCloseSquad"); this.closeSquadBtn.OnClicked = new UXButtonClickedDelegate(this.OnCloseSquad); EventManager eventManager = Service.Get <EventManager>(); eventManager.RegisterObserver(this, EventId.CurrentPlayerMemberDataUpdated); eventManager.RegisterObserver(this, EventId.GameStateChanged); eventManager.RegisterObserver(this, EventId.HUDVisibilityChanged); eventManager.RegisterObserver(this, EventId.SquadLeft); eventManager.RegisterObserver(this, EventId.SquadUpdated); eventManager.RegisterObserver(this, EventId.WarRewardClaimed); this.chatView.OnScreenLoaded(); this.membersView.OnScreenLoaded(); this.overviewView.OnScreenLoaded(); this.troopDonationView.OnScreenLoaded(); this.warButtonView.OnScreenLoaded(); this.warLogView.OnScreenLoaded(); this.advancementView.OnScreenLoaded(); this.HideAllViews(); }
private void SetupSticker(StoreTab tab) { JewelControl jewelControl; if (this.tabStickers.ContainsKey(tab)) { jewelControl = this.tabStickers[tab]; } else { string name = tab.ToString(); string parentName = tab.ToString() + "Special"; jewelControl = JewelControl.CreateSticker(this.parentStoreScreen, name, parentName); if (jewelControl == null) { return; } this.tabStickers.Add(tab, jewelControl); } if (tab == StoreTab.Crystals) { this.SetupCrystalsSticker(jewelControl); } else { this.SetupTabSticker(jewelControl, tab); } }
private void InitTabJewels() { this.cratesJewel = JewelControl.Create(this, "Crates"); this.buildingsJewel = JewelControl.Create(this, "Buildings"); this.troopsJewel = JewelControl.Create(this, "Troops"); this.currencyJewel = JewelControl.Create(this, "Currency"); this.UpdateTabJewels(); }
private void InitElements() { this.campaignDetailsGroup = base.GetElement <UXElement>("PanelCampaignDetails"); this.campaignSelectGroup = base.GetElement <UXElement>("PanelCampaignSelect"); this.planetDetailsTop = base.GetElement <UXElement>("PlanetDetailsTop"); this.planetDetailsBottom = base.GetElement <UXElement>("PlanetDetailsBottom"); this.galaxyJewel = JewelControl.Create(this, "Galaxy"); this.labelPlanetPrev = base.GetElement <UXLabel>("LabelBtnPlanetPrev"); this.labelPlanetPrev.Text = this.lang.Get("PLANETS_PLAYSCREEN_PREVIOUS_WORLD", new object[0]); this.labelPlanetNext = base.GetElement <UXLabel>("LabelBtnPlanetNext"); this.labelPlanetNext.Text = this.lang.Get("PLANETS_PLAYSCREEN_NEXT_WORLD", new object[0]); this.planetLockedInfo = base.GetElement <UXElement>("LockedInfo"); }
public override void OnScreenLoaded() { this.viewContainer = this.screen.GetElement <UXElement>("WarlogContainer"); this.labelEmptyWarlog = this.screen.GetElement <UXLabel>("LabelEmptyWarlog"); this.tabButton = this.screen.GetElement <UXCheckbox>("SocialWarLogBtn"); this.tabButton.OnSelected = new UXCheckboxSelectedDelegate(this.OnTabButtonSelected); this.gridWarLog = this.screen.GetElement <UXGrid>("GridWarlog"); this.gridWarLog.SetTemplateItem("ItemWarlog"); if (this.warLogBadge == null) { this.warLogBadge = JewelControl.Create(this.screen, "SocialWarLog"); } }
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(); }
public int RefreshBadge() { SquadController squadController = Service.SquadController; SquadMemberWarData currentMemberWarData = squadController.WarManager.GetCurrentMemberWarData(); uint serverTime = Service.ServerAPI.ServerTime; int unclaimedSquadWarRewardsCount = SquadUtils.GetUnclaimedSquadWarRewardsCount(currentMemberWarData, serverTime); if (this.warLogBadge == null) { this.warLogBadge = JewelControl.Create(this.screen, "SocialWarLog"); } this.warLogBadge.Value = unclaimedSquadWarRewardsCount; return(unclaimedSquadWarRewardsCount); }
private void SetupTabSticker(JewelControl jewel, StoreTab tab) { if (this.parentStoreScreen.IsTabLocked(tab)) { this.HideStickerVisuals(tab); return; } StickerType stickerTypeFromStoreTab = this.GetStickerTypeFromStoreTab(tab); StickerController stickerController = Service.StickerController; StickerVO storeStickerToDisplay = stickerController.GetStoreStickerToDisplay(stickerTypeFromStoreTab); jewel.EndTime = 0; if (storeStickerToDisplay == null) { jewel.Cleanup(); this.HideStickerVisuals(tab); return; } jewel.EndTime = storeStickerToDisplay.EndTime; this.SetupStickerVisuals(tab, storeStickerToDisplay); }
private void SetupCrystalsSticker(JewelControl jewel) { StickerController stickerController = Service.StickerController; StickerVO storeStickerToDisplay = stickerController.GetStoreStickerToDisplay(StickerType.CrystalShop); Lang lang = Service.Lang; bool flag = storeStickerToDisplay != null && this.parentStoreScreen.HasInAppPurchaseItems(); this.parentStoreScreen.GetElement <UXElement>("PanelCrystalsSpecial").Visible = false; this.parentStoreScreen.GetElement <UXElement>("WidgetCrystalsNormal").Visible = true; jewel.EndTime = 0; if (!flag) { jewel.Cleanup(); return; } jewel.EndTime = storeStickerToDisplay.EndTime; string assetName = "storeicon_lg_crystals_special"; string factionBasedTextureAsset = stickerController.GetFactionBasedTextureAsset(storeStickerToDisplay); if (!string.IsNullOrEmpty(factionBasedTextureAsset)) { assetName = factionBasedTextureAsset; } this.parentStoreScreen.GetElement <UXTexture>("TextureCrystalsIconSpecial").LoadTexture(assetName, new Action(this.OnCrystalsSpecialTextureLoaded)); jewel.Text = lang.Get(storeStickerToDisplay.LabelText, new object[0]); string iconAsset = storeStickerToDisplay.IconAsset; bool flag2 = !string.IsNullOrEmpty(iconAsset); if (flag2) { jewel.Icon = iconAsset; } this.parentStoreScreen.GetElement <UXElement>("particlesJewelCrystals").Visible = flag2; if (jewel.TimerLabel != null) { jewel.TimerLabel.TextColor = UXUtils.COLOR_CRYSTALS_EXPIRE_LABEL_NORMAL; CountdownControl countdownControl = new CountdownControl(jewel.TimerLabel, lang.Get("crystal_sale_sticker_expiration_timer", new object[0]), storeStickerToDisplay.EndTime); countdownControl.SetThreshold(GameConstants.CRYSTAL_STORE_SALE_EXPIRATION_TIMER_WARNING, UXUtils.COLOR_CRYSTALS_EXPIRE_LABEL_WARNING); } }
protected void SetupPerkBadge(PerkVO perkVO, string perkItemID, string jewelId) { PerkViewController perkViewController = Service.PerkViewController; PerkManager perkManager = Service.PerkManager; bool flag = true; Squad currentSquad = Service.SquadController.StateManager.GetCurrentSquad(); int level = currentSquad.Level; Dictionary <string, string> available = currentSquad.Perks.Available; if (perkManager.IsPerkLevelLocked(perkVO, level) || perkManager.IsPerkReputationLocked(perkVO, level, available)) { flag = false; } string perkGroup = perkVO.PerkGroup; JewelControl jewelControl; if (this.perkBadgeMap.ContainsKey(perkGroup)) { jewelControl = this.perkBadgeMap[perkGroup]; } else { string name = UXUtils.FormatAppendedName(jewelId, perkItemID); jewelControl = JewelControl.Create(this.screen, name); this.perkBadgeMap.Add(perkGroup, jewelControl); } if (jewelControl != null) { bool flag2 = perkViewController.IsPerkGroupBadged(perkVO.PerkGroup); if (flag2 && flag) { jewelControl.Text = "!"; } else { jewelControl.Value = 0; } } }