Beispiel #1
0
        public UIGizmo()
        {
            var ui = this.RenderScript("gizmo.uis");

            AddAt(0, (PeopleTab = ui.Create <UIImage>("PeopleTab")));
            AddAt(0, (HousesTab = ui.Create <UIImage>("HousesTab")));
            AddAt(0, (NHoodTab = ui.Create <UIImage>("HousesTab")));

            AddAt(0, (PeopleTabBackground = ui.Create <UIImage>("PeopleTabBackground")));
            AddAt(0, (HousesTabBackground = ui.Create <UIImage>("HousesTabBackground")));

            //additional tab: nhood tab

            AddAt(0, (NHoodTabBackground = ui.Create <UIImage>("HousesTabBackground")));
            Add((NHoodTabButton = ui.Create <UIButton>("HousesTabButton")));

            NHoodTabButton.Texture = Content.Content.Get().CustomUI.Get("neighp_infobtn.png").Get(GameFacade.GraphicsDevice);
            NHoodTab.X            += 42;
            NHoodTabBackground.X  += 42;
            NHoodTabButton.X      += 42;
            NHoodTabButton.Tooltip = "Neighborhoods";

            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);
            ControllerUtils.BindController <GizmoSearchController>(Search);
            Search.Visible = false;
            this.Add(Search);

            Top100 = new UIGizmoTop100(ui, this);
            ControllerUtils.BindController <GizmoTop100Controller>(Top100);
            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);
            NHoodTabButton.OnButtonClick  += NHoodTabButton_OnButtonClick;

            FiltersButton.OnButtonClick     += new ButtonClickDelegate(FiltersButton_OnButtonClick);
            SearchButton.OnButtonClick      += new ButtonClickDelegate(SearchButton_OnButtonClick);
            Top100ListsButton.OnButtonClick += new ButtonClickDelegate(Top100ListsButton_OnButtonClick);

            PIP = ui.Create <UIGizmoPIP>("PipSetup");
            PIP.Initialize();
            Add(PIP);

            CurrentAvatar = new Binding <Avatar>()
                            .WithBinding(PIP, "SimBox.Avatar.BodyOutfitId", "Avatar_Appearance.AvatarAppearance_BodyOutfitID")
                            .WithBinding(PIP, "SimBox.Avatar.HeadOutfitId", "Avatar_Appearance.AvatarAppearance_HeadOutfitID")
                            .WithBinding(PIP, "SimBox.Avatar.Appearance", "Avatar_Appearance.AvatarAppearance_SkinTone", (x) => (Vitaboy.AppearanceType)((byte)x))
                            .WithBinding(this, "SimAge", "Avatar_Age")
                            .WithBinding(this, "FilterList", "Avatar_Top100ListFilter.Top100ListFilter_ResultsVec");

            Tab  = UIGizmoTab.Property;
            View = UIGizmoView.Filters;
            SetOpen(true);
        }
Beispiel #2
0
        public UIGizmo()
        {
            var ui = RenderScript("gizmo.uis");

            AddAt(0, PeopleTab = ui.Create <UIImage>("PeopleTab"));
            AddAt(0, HousesTab = ui.Create <UIImage>("HousesTab"));

            AddAt(0, PeopleTabBackground = ui.Create <UIImage>("PeopleTabBackground"));
            AddAt(0, HousesTabBackground = ui.Create <UIImage>("HousesTabBackground"));

            BackgroundImageGizmo = ui.Create <UIImage>("BackgroundImageGizmo");
            AddAt(0, BackgroundImageGizmo);

            BackgroundImageGizmoPanel = ui.Create <UIImage>("BackgroundImageGizmoPanel");
            AddAt(0, BackgroundImageGizmoPanel);

            BackgroundImagePanel = ui.Create <UIImage>("BackgroundImagePanel");
            AddAt(0, BackgroundImagePanel);

            UIUtils.MakeDraggable(BackgroundImageGizmo, this);
            UIUtils.MakeDraggable(BackgroundImageGizmoPanel, this);
            UIUtils.MakeDraggable(BackgroundImagePanel, this);

            ButtonContainer = new UIContainer();
            Remove(ExpandButton);
            ButtonContainer.Add(ExpandButton);
            Remove(ContractButton);
            ButtonContainer.Add(ContractButton);
            Remove(FiltersButton);
            ButtonContainer.Add(FiltersButton);
            Remove(SearchButton);
            ButtonContainer.Add(SearchButton);
            Remove(Top100ListsButton);
            ButtonContainer.Add(Top100ListsButton);
            Add(ButtonContainer);



            FiltersProperty = new UIGizmoPropertyFilters(ui, this)
            {
                Visible = false
            };
            Add(FiltersProperty);

            Search = new UIGizmoSearch(ui, this);
            ControllerUtils.BindController <GizmoSearchController>(Search);
            Search.Visible = false;
            Add(Search);

            Top100 = new UIGizmoTop100(ui, this);
            ControllerUtils.BindController <GizmoTop100Controller>(Top100);
            Top100.Visible            = false;
            Top100.Background.Visible = false;
            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);

            PIP = ui.Create <UIGizmoPIP>("PipSetup");
            PIP.Initialize();
            Add(PIP);

            CurrentAvatar = new Binding <Avatar>()
                            .WithBinding(PIP, "SimBox.Avatar.BodyOutfitId", "Avatar_Appearance.AvatarAppearance_BodyOutfitID")
                            .WithBinding(PIP, "SimBox.Avatar.HeadOutfitId", "Avatar_Appearance.AvatarAppearance_HeadOutfitID")
                            .WithBinding(PIP, "SimBox.Avatar.Appearance", "Avatar_Appearance.AvatarAppearance_SkinTone", (x) => (Vitaboy.AppearanceType)(byte) x)
                            .WithBinding(this, "SimAge", "Avatar_Age")
                            .WithBinding(this, "FilterList", "Avatar_Top100ListFilter.Top100ListFilter_ResultsVec");

            Tab  = UIGizmoTab.Property;
            View = UIGizmoView.Filters;
            SetOpen(true);
        }