public AbstractHolonetTab(HolonetScreen screen, HolonetControllerType holonetControllerType) { this.screen = screen; this.HolonetControllerType = holonetControllerType; this.lang = Service.Lang; this.eventManager = Service.EventManager; this.deferredTextures = new List <UXTexture>(); }
public void OpenTab(HolonetControllerType tabType) { if (this.tabs == null) { return; } if (this.currentTab != null && this.currentTab.HolonetControllerType != tabType) { this.PreviousTab = this.currentTab; } int i = 0; int count = this.tabs.Count; while (i < count) { if (this.currentTab == null || (this.tabs[i].HolonetControllerType == tabType && this.tabs[i].HolonetControllerType != this.currentTab.HolonetControllerType)) { this.currentTab = this.tabs[i]; this.currentTab.OnTabOpen(); if (this.PreviousTab != null && this.PreviousTab != this.currentTab) { this.eventManager.SendEvent(EventId.HolonetTabClosed, this.PreviousTab.GetBITabName()); } this.eventManager.SendEvent(EventId.HolonetTabOpened, this.currentTab.GetBITabName()); } i++; } if (this.PreviousTab != null && this.PreviousTab != this.currentTab) { this.PreviousTab.OnTabClose(); } if (this.currentTab == this.commandCenterTab) { this.anims.ShowCommandCenter(); return; } if (this.currentTab == this.devNotesTab) { this.anims.ShowDevNotes(); return; } if (this.currentTab == this.videosTab) { this.anims.ShowVideos(); return; } if (this.currentTab == this.transmissionsTab) { this.anims.ShowTransmissionLog(); } }
public TransmissionsHolonetTab(HolonetScreen holoScreen, HolonetControllerType holonetControllerType) : base(holoScreen, holonetControllerType) { base.InitializeTab("TransmissionsLogTab", "hn_transmissions_tab"); List <TransmissionVO> transmissions = Service.HolonetController.TransmissionsController.Transmissions; int count = transmissions.Count; this.table = holoScreen.GetElement <UXTable>("TransmissionsLogTable"); this.table.SetTemplateItem("TransmissionsLogItem"); string title = string.Empty; string body = string.Empty; for (int i = 0; i < count; i++) { bool flag = false; TransmissionVO transmissionVO = transmissions[i]; switch (transmissionVO.Type) { case TransmissionType.Research: title = this.lang.Get("hn_transmission_research_title", new object[] { this.GetResearchDisplayName(transmissionVO.TransData) }); body = this.lang.Get("hn_transmission_research_body", new object[] { this.GetResearchDisplayName(transmissionVO.TransData), transmissionVO.Btn1Data }); flag = true; break; case TransmissionType.HqUpgrade: title = this.lang.Get("hn_transmission_hqupgrade_title", new object[0]); body = this.lang.Get("hn_transmission_hqupgrade_body", new object[] { transmissionVO.Btn1Data }); flag = true; break; case TransmissionType.NavigationCenterUpgrade: title = this.lang.Get("hn_transmission_pcupgrade_title", new object[0]); body = this.lang.Get("hn_transmission_pcupgrade_body", new object[] { transmissionVO.Btn1Data }); flag = true; break; case TransmissionType.Conflict: { string text = string.Empty; string text2 = string.Empty; StaticDataController staticDataController = Service.StaticDataController; TournamentVO optional = staticDataController.GetOptional <TournamentVO>(transmissionVO.TransData); TournamentTierVO optional2 = staticDataController.GetOptional <TournamentTierVO>(transmissionVO.Btn1Data); if (optional != null && optional2 != null) { text = LangUtils.GetPlanetDisplayName(optional.PlanetId); text2 = this.lang.Get(optional2.RankName, new object[0]) + " " + this.lang.Get(optional2.Division, new object[0]); } title = this.lang.Get("hn_transmission_conflict_title", new object[0]); body = this.lang.Get("hn_transmission_conflict_body", new object[] { text, text2 }); flag = true; break; } case TransmissionType.WarPreparation: title = this.lang.Get(LangUtils.AppendPlayerFactionToKey("transm_war_prep_title"), new object[0]); body = this.lang.Get(LangUtils.AppendPlayerFactionToKey("transm_war_prep_body"), new object[0]); flag = true; break; case TransmissionType.WarStart: title = this.lang.Get(LangUtils.AppendPlayerFactionToKey("transm_war_start_title"), new object[0]); body = this.lang.Get(LangUtils.AppendPlayerFactionToKey("transm_war_start_body"), new object[0]); flag = true; break; case TransmissionType.WarEnded: title = this.lang.Get(LangUtils.AppendPlayerFactionToKey("transm_war_end_title"), new object[0]); body = this.lang.Get(LangUtils.AppendPlayerFactionToKey("transm_war_end_body"), new object[0]); flag = true; break; case TransmissionType.SquadChange: { object[] array = (transmissionVO.TransData ?? string.Empty).Split(new char[] { '\\' }); if (array.Length > 1) { title = this.lang.Get("hn_squad_application_accepted_title", new object[] { array[1] }); body = this.lang.Get("hn_squad_application_accepted_body", array); } flag = true; break; } case TransmissionType.GuildLevelUp: title = this.lang.Get("hn_perks_squad_level_up_title", new object[0]); body = this.lang.Get("hn_perks_squad_level_up_body", new object[] { transmissionVO.SquadLevel }); flag = true; break; case TransmissionType.DailyCrateReward: { title = this.lang.Get("hn_daily_crate_reward_title", new object[0]); CrateVO crateVO = Service.StaticDataController.Get <CrateVO>(transmissionVO.CrateId); body = this.lang.Get("hn_daily_crate_reward_body", new object[] { LangUtils.GetCrateDisplayName(crateVO) }); flag = true; break; } } if (flag) { this.AddCustomTransmission(transmissionVO, title, body, i); } else { this.AddGenericTransmission(transmissionVO, i); } } }
public void HandleCallToActionButton(string action, string data, object cookie) { if (Service.ScreenController.GetHighestLevelScreen <HolonetScreen>() == null) { Service.Logger.Warn("CTA actions only work in Holonet."); return; } switch (action) { case "conflict": this.OpenPlanetView(data); return; case "planet": this.OpenPlanetView(data); return; case "battle": this.GoToBattleLog(); return; case "leader": this.GoToLeaderBoard(); return; case "galaxy": this.GoToGalaxyView(data); return; case "home": this.holonetScreen.Close(null); return; case "gotowarboard": this.GoToWarBoard(); return; case "web": GameUtils.OpenURL(data); return; case "reward": { string contextUid = (string)cookie; this.ClaimReward(data, contextUid); return; } case "conflictend": this.OpenPrizeInventoryScreen(); return; case "store": Service.ScreenController.CloseAll(); this.OpenStore(action, data); return; case "holonet": if (this.holonetScreen != null && this.holonetScreen.IsLoaded()) { HolonetControllerType tabType = StringUtils.ParseEnum <HolonetControllerType>(data); this.holonetScreen.OpenTab(tabType); } return; case "story": this.holonetScreen.Close(null); new ActionChain(data); return; case "relocate": this.OpenRelocateView(data); return; case "squadchat": this.GoToSquadMessage(); return; case "squadlist": this.GoToFeatureSquad(); return; case "squadlevelup": this.GoToSquadAdvancement(); return; case "dailycratereward": this.OpenPrizeInventoryScreen(); return; } Service.Logger.Warn("Unknown button1 action: " + action + " data: " + data); }
public DevNotesHolonetTab(HolonetScreen screen, HolonetControllerType holonetControllerType) : base(screen, holonetControllerType) { base.InitializeTab("NotesTab", "hn_devnotes_tab"); this.notesTable = screen.GetElement <UXTable>("NotesTable"); this.notesTable.SetTemplateItem("NotesItem"); List <DevNoteEntryVO> devNotes = Service.HolonetController.DevNotesController.DevNotes; int i = 0; int count = devNotes.Count; while (i < count) { DevNoteEntryVO devNoteEntryVO = devNotes[i]; UXElement item = this.notesTable.CloneTemplateItem(devNoteEntryVO.Uid); this.notesTable.GetSubElement <UXLabel>(devNoteEntryVO.Uid, "NotesItemLabelTitle").Text = this.lang.Get(devNoteEntryVO.TitleText, new object[0]); UXButton subElement = this.notesTable.GetSubElement <UXButton>(devNoteEntryVO.Uid, "NotesItemBtnAction"); UXLabel subElement2 = this.notesTable.GetSubElement <UXLabel>(devNoteEntryVO.Uid, "NotesItemBtnActionLabel"); base.PrepareButton(devNoteEntryVO, 1, subElement, subElement2); this.notesTable.GetSubElement <UXButton>(devNoteEntryVO.Uid, "NotesBackCollider").OnClicked = new UXButtonClickedDelegate(this.ClickedLink); UXTexture subElement3 = this.notesTable.GetSubElement <UXTexture>(devNoteEntryVO.Uid, "NotesThumbTexture"); UXSprite subElement4 = this.notesTable.GetSubElement <UXSprite>(devNoteEntryVO.Uid, "SpriteNotesThumbnailFrame"); string text = this.lang.Get(devNoteEntryVO.BodyText, new object[0]); List <string> list = new List <string>(); List <UXTexture> list2 = new List <UXTexture>(); MiscElementsManager miscElementsManager = Service.UXController.MiscElementsManager; if (text.Contains("src=")) { string[] separator = new string[] { "[img]" }; string[] array = text.Split(separator, StringSplitOptions.None); int j = 0; int num = array.Length; while (j < num) { list.Add(array[j]); j++; } this.notesTable.GetSubElement <UXLabel>(devNoteEntryVO.Uid, "NotesItemLabelBody").Text = string.Empty; } else { this.notesTable.GetSubElement <UXLabel>(devNoteEntryVO.Uid, "NotesItemLabelBody").Text = text; } int k = 0; int count2 = list.Count; while (k < count2) { if (list[k].Contains("src=")) { UXTexture uXTexture = miscElementsManager.CloneUXTexture(subElement3, "newImage #" + k, subElement3.Root.transform.parent.gameObject); string[] array2 = list[k].Split(new char[] { '=' }); string assetName = array2[1]; uXTexture.Visible = true; uXTexture.LoadTexture(assetName); list2.Add(uXTexture); string oldValue = "[img]" + list[k] + "[img]"; text = text.Replace(oldValue, "IMAGE_TOKEN"); } k++; } if (text.Contains("IMAGE_TOKEN")) { string[] separator2 = new string[] { "IMAGE_TOKEN" }; string[] array3 = text.Split(separator2, StringSplitOptions.None); int l = 0; int num2 = array3.Length; while (l < num2) { UXLabel uXLabel = miscElementsManager.CloneUXLabel(this.notesTable.GetSubElement <UXLabel>(devNoteEntryVO.Uid, "NotesItemLabelBody"), "thisLabel #" + l, subElement3.Root.transform.parent.gameObject); uXLabel.LocalPosition = new Vector2(this.notesTable.GetSubElement <UXLabel>(devNoteEntryVO.Uid, "NotesItemLabelBody").LocalPosition.x, this.notesTable.GetSubElement <UXLabel>(devNoteEntryVO.Uid, "NotesItemLabelBody").LocalPosition.y); uXLabel.Text = array3[l]; if (list2.Count > 0) { list2[0].LocalPosition = new Vector2(uXLabel.LocalPosition.x - 115f * uXLabel.UXCamera.Camera.transform.localScale.x, uXLabel.LocalPosition.y - uXLabel.Height); list2.Remove(list2[0]); } UXButton uXButton = miscElementsManager.CloneUXButton(this.notesTable.GetSubElement <UXButton>(devNoteEntryVO.Uid, "NotesBackCollider"), "thisButton #" + l, subElement3.Root.transform.parent.gameObject); uXButton.LocalPosition = uXLabel.LocalPosition; uXButton.GetUIWidget.SetAnchor(uXLabel.GetUIWidget.transform); uXButton.OnClicked = new UXButtonClickedDelegate(this.ClickedLink); this.notesTable.GetSubElement <UXLabel>(devNoteEntryVO.Uid, "NotesItemLabelBody").LocalPosition = new Vector2(this.notesTable.GetSubElement <UXLabel>(devNoteEntryVO.Uid, "NotesItemLabelBody").LocalPosition.x, this.notesTable.GetSubElement <UXLabel>(devNoteEntryVO.Uid, "NotesItemLabelBody").LocalPosition.y - uXLabel.Height); this.newLabels.Add(uXLabel); l++; } } else { this.newLabels.Add(this.notesTable.GetSubElement <UXLabel>(devNoteEntryVO.Uid, "NotesItemLabelBody")); } if (!string.IsNullOrEmpty(devNoteEntryVO.Image)) { subElement3.Visible = true; subElement4.Visible = true; subElement3.LoadTexture(devNoteEntryVO.Image); } else { subElement3.Visible = false; subElement4.Visible = false; } this.notesTable.AddItem(item, this.notesTable.Count); i++; } }
public void HandleCallToActionButton(string action, string data, object cookie) { if (Service.Get <ScreenController>().GetHighestLevelScreen <HolonetScreen>() == null) { Service.Get <StaRTSLogger>().Warn("CTA actions only work in Holonet."); return; } uint num = < PrivateImplementationDetails >.ComputeStringHash(action); if (num <= 2130426641u) { if (num <= 316263714u) { if (num <= 116839780u) { if (num != 17485778u) { if (num == 116839780u) { if (action == "gotowarboard") { this.GoToWarBoard(); return; } } } else if (action == "relocate") { this.OpenRelocateView(data); return; } } else if (num != 265927825u) { if (num != 270238212u) { if (num == 316263714u) { if (action == "dailycratereward") { this.OpenPrizeInventoryScreen(); return; } } } else if (action == "tapjoy") { return; } } else if (action == "web") { GameUtils.OpenURL(data); return; } } else if (num <= 614761231u) { if (num != 536723741u) { if (num == 614761231u) { if (action == "squadchat") { this.GoToSquadMessage(); return; } } } else if (action == "squadlist") { this.GoToFeatureSquad(); return; } } else if (num != 1608251484u) { if (num != 1939365082u) { if (num == 2130426641u) { if (action == "galaxy") { this.GoToGalaxyView(data); return; } } } else if (action == "reward") { string contextUid = (string)cookie; this.ClaimReward(data, contextUid); return; } } else if (action == "conflictend") { this.OpenPrizeInventoryScreen(); return; } } else if (num <= 2966784228u) { if (num <= 2538552783u) { if (num != 2224108531u) { if (num == 2538552783u) { if (action == "conflict") { this.OpenPlanetView(data); return; } } } else if (action == "planet") { this.OpenPlanetView(data); return; } } else if (num != 2820971575u) { if (num != 2894219868u) { if (num == 2966784228u) { if (action == "leader") { this.GoToLeaderBoard(); return; } } } else if (action == "squadlevelup") { this.GoToSquadAdvancement(); return; } } else if (action == "battle") { this.GoToBattleLog(); return; } } else if (num <= 3353852974u) { if (num != 3018300594u) { if (num != 3310580652u) { if (num == 3353852974u) { if (action == "store") { Service.Get <ScreenController>().CloseAll(); this.OpenStore(action, data); return; } } } else if (action == "holonet") { if (this.holonetScreen != null && this.holonetScreen.IsLoaded()) { HolonetControllerType tabType = StringUtils.ParseEnum <HolonetControllerType>(data); this.holonetScreen.OpenTab(tabType); return; } return; } } else if (action == "story") { this.holonetScreen.Close(null); new ActionChain(data); return; } } else if (num != 3472427884u) { if (num != 3536372366u) { if (num == 3621289194u) { if (action == "offers") { return; } } } else if (action == "home") { this.holonetScreen.Close(null); return; } } else if (action == "video") { this.PlayVideo(data); return; } Service.Get <StaRTSLogger>().Warn("Unknown button1 action: " + action + " data: " + data); }
public DeadHolonetTab(HolonetScreen screen, HolonetControllerType type, string name) : base(screen, type) { this.topLevelGroup = screen.GetElement <UXElement>(name); this.topLevelGroup.Visible = false; }