private void Redraw() { var isOpen = m_Open; var isClosed = !m_Open; if (isOpen) { SimBox.Position = new Microsoft.Xna.Framework.Vector2(60, 66); } else { SimBox.Position = new Microsoft.Xna.Framework.Vector2(60, 60); } PeopleTabButton.Disabled = View == UIGizmoView.Filters; FiltersButton.Selected = isOpen && View == UIGizmoView.Filters; SearchButton.Selected = isOpen && View == UIGizmoView.Search; Top100ListsButton.Selected = isOpen && View == UIGizmoView.Top100; ButtonContainer.Y = isOpen ? 6 : 0; BackgroundImageGizmo.Visible = isClosed; BackgroundImageGizmoPanel.Visible = isOpen; BackgroundImagePanel.Visible = isOpen; ExpandButton.Visible = isClosed; ContractButton.Visible = isOpen; FiltersProperty.Visible = false; Top100.Visible = false; Top100.Background.Visible = false; Search.Visible = false; PeopleTabButton.Visible = isOpen; HousesTabButton.Visible = isOpen; if (Tab == UIGizmoTab.People && View == UIGizmoView.Filters) { View = UIGizmoView.Search; } if (isOpen) { switch (View) { case UIGizmoView.Filters: FiltersProperty.Visible = true; break; case UIGizmoView.Search: Search.Visible = true; break; case UIGizmoView.Top100: Top100.Visible = true; Top100.Background.Visible = true; break; } } }
private void Redraw() { var isOpen = m_Open; var isClosed = !m_Open; if (isOpen) { PIP.Position = new Microsoft.Xna.Framework.Vector2(6, 30); } else { PIP.Position = new Microsoft.Xna.Framework.Vector2(6, 24); } PeopleTab.Visible = isOpen && Tab == UIGizmoTab.People; HousesTab.Visible = isOpen && Tab == UIGizmoTab.Property; NHoodTab.Visible = isOpen && Tab == UIGizmoTab.Neighborhood; PeopleTabButton.Selected = Tab == UIGizmoTab.People; HousesTabButton.Selected = Tab == UIGizmoTab.Property; NHoodTabButton.Selected = Tab == UIGizmoTab.Neighborhood; NHoodTabButton.Disabled = View == UIGizmoView.Top100; PeopleTabBackground.Visible = isOpen; HousesTabBackground.Visible = isOpen; NHoodTabBackground.Visible = isOpen; PeopleTabButton.Disabled = View == UIGizmoView.Filters; FiltersButton.Selected = isOpen && View == UIGizmoView.Filters; SearchButton.Selected = isOpen && View == UIGizmoView.Search; Top100ListsButton.Selected = isOpen && View == UIGizmoView.Top100; ButtonContainer.Y = isOpen ? 6 : 0; BackgroundImageGizmo.Visible = isClosed; BackgroundImageGizmoPanel.Visible = isOpen; BackgroundImagePanel.Visible = isOpen; ExpandButton.Visible = isClosed; ContractButton.Visible = isOpen; FiltersProperty.Visible = false; Top100.Visible = false; Top100.Background.Visible = false; Search.Visible = false; PeopleTabButton.Visible = isOpen; HousesTabButton.Visible = isOpen; NHoodTabButton.Visible = isOpen; var coreScreen = (UIScreen.Current as CoreGameScreen); if (coreScreen != null) { if (Tab == UIGizmoTab.Neighborhood) { coreScreen.CityRenderer.NeighGeom.TargetBannerPct = 1f; } else { coreScreen.CityRenderer.NeighGeom.TargetBannerPct = 0f; } } if (Tab == UIGizmoTab.People && View == UIGizmoView.Filters) { View = UIGizmoView.Search; } if (isOpen) { switch (View) { case UIGizmoView.Filters: FiltersProperty.Visible = Tab != UIGizmoTab.Neighborhood; break; case UIGizmoView.Search: Search.Visible = true; break; case UIGizmoView.Top100: Top100.Visible = true; Top100.Background.Visible = true; break; } } }
void Top100ListsButton_OnButtonClick(UIElement button) { View = UIGizmoView.Top100; SetOpen(true); }
void SearchButton_OnButtonClick(UIElement button) { View = UIGizmoView.Search; SetOpen(true); }
void FiltersButton_OnButtonClick(UIElement button) { View = UIGizmoView.Filters; SetOpen(true); }
public UIGizmo() { var ui = this.RenderScript("gizmo.uis"); BackgroundImageGizmo = ui.Create<UIImage>("BackgroundImageGizmo"); this.AddAt(0, BackgroundImageGizmo); BackgroundImageGizmoPanel = ui.Create<UIImage>("BackgroundImageGizmoPanel"); this.AddAt(0, BackgroundImageGizmoPanel); BackgroundImagePanel = ui.Create<UIImage>("BackgroundImagePanel"); this.AddAt(0, BackgroundImagePanel); UIUtils.MakeDraggable(BackgroundImageGizmo, this); UIUtils.MakeDraggable(BackgroundImageGizmoPanel, this); UIUtils.MakeDraggable(BackgroundImagePanel, this); ButtonContainer = new UIContainer(); this.Remove(ExpandButton); ButtonContainer.Add(ExpandButton); this.Remove(ContractButton); ButtonContainer.Add(ContractButton); this.Remove(FiltersButton); ButtonContainer.Add(FiltersButton); this.Remove(SearchButton); ButtonContainer.Add(SearchButton); this.Remove(Top100ListsButton); ButtonContainer.Add(Top100ListsButton); this.Add(ButtonContainer); FiltersProperty = new UIGizmoPropertyFilters(ui, this); FiltersProperty.Visible = false; this.Add(FiltersProperty); Search = new UIGizmoSearch(ui, this); Search.Visible = false; this.Add(Search); Top100 = new UIGizmoTop100(ui, this); Top100.Visible = false; Top100.Background.Visible = false; this.Add(Top100); ExpandButton.OnButtonClick += new ButtonClickDelegate(ExpandButton_OnButtonClick); ContractButton.OnButtonClick += new ButtonClickDelegate(ContractButton_OnButtonClick); PeopleTabButton.OnButtonClick += new ButtonClickDelegate(PeopleTabButton_OnButtonClick); HousesTabButton.OnButtonClick += new ButtonClickDelegate(HousesTabButton_OnButtonClick); FiltersButton.OnButtonClick += new ButtonClickDelegate(FiltersButton_OnButtonClick); SearchButton.OnButtonClick += new ButtonClickDelegate(SearchButton_OnButtonClick); Top100ListsButton.OnButtonClick += new ButtonClickDelegate(Top100ListsButton_OnButtonClick); if (PlayerAccount.CurrentlyActiveSim != null) SimBox = new UISim(PlayerAccount.CurrentlyActiveSim.GUID.ToString()); else SimBox = new UISim(""); //var sim = new Sim(Guid.NewGuid().ToString()); //var maleHeads = new Collection(ContentManager.GetResourceFromLongID((ulong)FileIDs.CollectionsFileIDs.ea_male_heads)); //SimCatalog.LoadSim3D(sim, maleHeads.First().PurchasableObject.Outfit, AppearanceType.Light); // //sim.HeadOutfitID = 4853313044493; //sim.AppearanceType = AppearanceType.Light; //sim.BodyOutfitID = 5394478923789; //SimCatalog.LoadSim3D(sim); //SimCatalog.LoadSim3D(sim, SimCatalog.GetOutfit(4462471020557), AppearanceType.Light); //SimBox.Sim = sim; //SimBox.SimScale = 0.4f; //SimBox.Position = new Microsoft.Xna.Framework.Vector2(60, 60); //this.Add(SimBox); View = UIGizmoView.Top100; SetOpen(true); }