Esempio n. 1
0
        public void ToggleOpen()
        {
            if (open)
            {
                Background.Texture = backgroundCollapsedImage;
                Background.SetSize(backgroundCollapsedImage.Width, backgroundCollapsedImage.Height);
                MenuListBox.Items.Clear();
            }
            else
            {
                Background.Texture = backgroundExpandedImage;
                Background.SetSize(backgroundExpandedImage.Width, backgroundExpandedImage.Height);
                UIListBoxTextStyle Style = Script.Create <UIListBoxTextStyle>("SimMessageColors", MenuListBox.FontStyle);
                Search(null);

                //TODO: This should eventually be made to show only a player's friends.

                /*foreach (UISim Avatar in Network.NetworkFacade.AvatarsInSession)
                 * {
                 *  UIListBoxItem AvatarItem = new UIListBoxItem(Avatar.GUID, Avatar.Name);
                 *  AvatarItem.CustomStyle = Style;
                 *  MenuListBox.Items.Add(AvatarItem);
                 * }*/
            }

            open = !open;
            MenuSlider.Visible           = open;
            MenuScrollUpButton.Visible   = open;
            MenuScrollDownButton.Visible = open;
            MenuListBox.Visible          = open;
        }
Esempio n. 2
0
        public UIGizmoTop100(UIScript script, UIGizmo parent)
        {
            Background = script.Create <UIImage>("BackgroundImageTop100Lists");
            this.Add(Background);

            script.LinkMembers(this, true);

            HiddenSubSlider = new UISlider();
            Top100SubList.Columns[0].TextureBounds        = new Microsoft.Xna.Framework.Vector2(17, 17);
            Top100SubList.Columns[0].TextureSelectedFrame = 1;
            Top100SubList.Columns[0].TextureHoverFrame    = 2;
            Top100SubList.OnChange += Top100SubList_OnChange;
            Top100SubList.AttachSlider(HiddenSubSlider);
            HiddenSubSlider.AttachButtons(Top100SubListScrollUpButton, Top100SubListScrollDownButton, 1);

            Top100Slider.AttachButtons(Top100ListScrollUpButton, Top100ListScrollDownButton, 1);
            Top100ResultList.AttachSlider(Top100Slider);
            Top100ResultList.Mask = true;
            Top100ResultList.SetSize(150, 138);
            Top100ResultList.OnDoubleClick += Top100ResultList_OnDoubleClick;

            //populateWithXMLHouses();

            Top100ResultList.OnDoubleClick += Top100ItemSelect;
            UpdateCooldown = 100;

            ListBoxColors = script.Create <UIListBoxTextStyle>("ListBoxColors", Top100ResultList.FontStyle);
        }
        public UICitySelector()
            : base(UIDialogStyle.Standard, true)
        {
            this.Opacity = 0.9f;


            CityListBoxBackground = new UIImage(UITextBox.StandardBackground);
            this.Add(CityListBoxBackground);
            CityDescriptionBackground = new UIImage(UITextBox.StandardBackground);
            this.Add(CityDescriptionBackground);

            var script = this.RenderScript("cityselector.uis");

            this.DialogSize = (Point)script.GetControlProperty("DialogSize");

            var cityThumbBG = new UIImage(thumbnailBackgroundImage);

            cityThumbBG.Position = (Vector2)script.GetControlProperty("CityThumbnailBackgroundPosition");
            this.Add(cityThumbBG);
            CityThumb          = new UIImage();
            CityThumb.Position = (Vector2)script.GetControlProperty("CityThumbnailPosition");
            this.Add(CityThumb);

            CityDescriptionSlider.AttachButtons(CityDescriptionScrollUpButton, CityDescriptionDownButton, 1);
            DescriptionText.AttachSlider(CityDescriptionSlider);

            OkButton.Disabled           = true;
            OkButton.OnButtonClick     += new ButtonClickDelegate(OkButton_OnButtonClick);
            CancelButton.OnButtonClick += new ButtonClickDelegate(CancelButton_OnButtonClick);

            this.Caption = (string)script["TitleString"];


            /** Parse the list styles **/
            listStyleNormal   = script.Create <UIListBoxTextStyle>("CityListBoxColors", CityListBox.FontStyle);
            listStyleBusy     = script.Create <UIListBoxTextStyle>("CityListBoxColorsBusy", CityListBox.FontStyle);
            listStyleFull     = script.Create <UIListBoxTextStyle>("CityListBoxColorsFull", CityListBox.FontStyle);
            listStyleReserved = script.Create <UIListBoxTextStyle>("CityListBoxColorsReserved", CityListBox.FontStyle);

            UpdateItems();

            CityListBox.OnChange += new ChangeDelegate(CityListBox_OnChange);
            NetworkFacade.Controller.OnNewCityServer     += new OnNewCityServerDelegate(Controller_OnNewCityServer);
            NetworkFacade.Controller.OnCityServerOffline += new OnCityServerOfflineDelegate(Controller_OnCityServerOffline);
        }
Esempio n. 4
0
        public UIGizmoSearch(UIScript script, UIGizmo parent)
        {
            Background = script.Create <UIImage>("BackgroundImageSearch");
            this.Add(Background);

            script.LinkMembers(this, true);

            NarrowSearchButton.OnButtonClick += SendSearch;
            WideSearchUpButton.OnButtonClick += SendSearch;

            SearchSlider.AttachButtons(SearchScrollUpButton, SearchScrollDownButton, 1);
            SearchResult.AttachSlider(SearchSlider);
            SearchResult.OnDoubleClick += SearchResult_OnDoubleClick;
            SearchResult.Size           = new Microsoft.Xna.Framework.Vector2(188, 108);
            SearchResult.Mask           = true;
            SearchText.OnEnterPress    += (elem) => { SendSearch(WideSearchUpButton); };

            ListBoxColors = script.Create <UIListBoxTextStyle>("ListBoxColors", SearchResult.FontStyle);
        }
Esempio n. 5
0
        public UICitySelector()
            : base(UIDialogStyle.Standard, true)
        {
            this.Opacity = 0.9f;

            CityListBoxBackground = new UIImage(UITextBox.StandardBackground);
            this.Add(CityListBoxBackground);
            CityDescriptionBackground = new UIImage(UITextBox.StandardBackground);
            this.Add(CityDescriptionBackground);

            var script = this.RenderScript("cityselector.uis");
            this.DialogSize = (Point)script.GetControlProperty("DialogSize");

            var cityThumbBG = new UIImage(thumbnailBackgroundImage);
            cityThumbBG.Position = (Vector2)script.GetControlProperty("CityThumbnailBackgroundPosition");
            this.Add(cityThumbBG);
            CityThumb = new UIImage();
            CityThumb.Position = (Vector2)script.GetControlProperty("CityThumbnailPosition");
            this.Add(CityThumb);

            CityDescriptionSlider.AttachButtons(CityDescriptionScrollUpButton, CityDescriptionDownButton, 1);
            DescriptionText.AttachSlider(CityDescriptionSlider);

            OkButton.Disabled = true;
            OkButton.OnButtonClick += new ButtonClickDelegate(OkButton_OnButtonClick);
            CancelButton.OnButtonClick += new ButtonClickDelegate(CancelButton_OnButtonClick);

            this.Caption = (string)script["TitleString"];

            /** Parse the list styles **/
            listStyleNormal = script.Create<UIListBoxTextStyle>("CityListBoxColors", CityListBox.FontStyle);
            listStyleBusy = script.Create<UIListBoxTextStyle>("CityListBoxColorsBusy", CityListBox.FontStyle);
            listStyleFull = script.Create<UIListBoxTextStyle>("CityListBoxColorsFull", CityListBox.FontStyle);
            listStyleReserved = script.Create<UIListBoxTextStyle>("CityListBoxColorsReserved", CityListBox.FontStyle);

            UpdateItems();

            CityListBox.OnChange += new ChangeDelegate(CityListBox_OnChange);
            NetworkFacade.Controller.OnNewCityServer += new OnNewCityServerDelegate(Controller_OnNewCityServer);
            NetworkFacade.Controller.OnCityServerOffline += new OnCityServerOfflineDelegate(Controller_OnCityServerOffline);
        }