public void SelectTab(CampaignMode.InteractionType tab) { selectedTab = tab; for (int i = 0; i < tabs.Length; i++) { if (tabs[i] != null) { tabs[i].Visible = (int)selectedTab == i; } } locationInfoPanel.Visible = tab == CampaignMode.InteractionType.Map && selectedLocation != null; switch (selectedTab) { case CampaignMode.InteractionType.Repair: repairHullsButton.Enabled = (Campaign.PurchasedHullRepairs || Campaign.Money >= CampaignMode.HullRepairCost) && Campaign.AllowedToManageCampaign(); repairHullsButton.GetChild <GUITickBox>().Selected = Campaign.PurchasedHullRepairs; repairItemsButton.Enabled = (Campaign.PurchasedItemRepairs || Campaign.Money >= CampaignMode.ItemRepairCost) && Campaign.AllowedToManageCampaign(); repairItemsButton.GetChild <GUITickBox>().Selected = Campaign.PurchasedItemRepairs; if (GameMain.GameSession?.SubmarineInfo == null || !GameMain.GameSession.SubmarineInfo.SubsLeftBehind) { replaceShuttlesButton.Enabled = false; replaceShuttlesButton.GetChild <GUITickBox>().Selected = false; } else { replaceShuttlesButton.Enabled = (Campaign.PurchasedLostShuttles || Campaign.Money >= CampaignMode.ShuttleReplaceCost) && Campaign.AllowedToManageCampaign(); replaceShuttlesButton.GetChild <GUITickBox>().Selected = Campaign.PurchasedLostShuttles; } break; case CampaignMode.InteractionType.Store: Store.RefreshItemsToSell(); Store.Refresh(); break; case CampaignMode.InteractionType.Crew: CrewManagement.UpdateCrew(); break; case CampaignMode.InteractionType.PurchaseSub: if (submarineSelection == null) { submarineSelection = new SubmarineSelection(false, () => Campaign.ShowCampaignUI = false, tabs[(int)CampaignMode.InteractionType.PurchaseSub].RectTransform); } submarineSelection.RefreshSubmarineDisplay(true); break; } }
public GUIComponent GetTabContainer(CampaignMode.InteractionType tab) { var tabFrame = tabs[(int)tab]; return(tabFrame?.GetChildByUserData("container") ?? tabFrame); }
partial void AssignCampaignInteractionTypeProjSpecific(CampaignMode.InteractionType interactionType) { GameMain.NetworkMember.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.AssignCampaignInteraction }); }