Inheritance: FSO.Client.UI.Framework.UIContainer
Esempio n. 1
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);
        }
Esempio n. 2
0
        public UIGizmoPropertyFilters(UIScript script, UIGizmo parent)
        {
            Background = script.Create <UIImage>("BackgroundImageFilters");
            this.Add(Background);

            var ui         = Content.Content.Get().CustomUI;
            var commFilter = new UIButton(ui.Get("lotp_community_large.png").Get(GameFacade.GraphicsDevice));

            commFilter.ID       = "PropertyFilterButton_Community";
            var where           = parent.GetChildren().First(x => x.ID == "PropertyFilterButton_WhereIveBeen");
            commFilter.Position = where.Position - new Microsoft.Xna.Framework.Vector2(1, 3);
            commFilter.Tooltip  = GameFacade.Strings.GetString("f115", "92");
            parent.Add(commFilter);
            where.X += 47;

            var filterChildren = parent.GetChildren().Where(x => x.ID != null && x.ID.StartsWith("PropertyFilterButton_")).ToList();

            foreach (var child in filterChildren)
            {
                child.Parent.Remove(child);
                this.Add(child);

                ((UIButton)child).OnButtonClick += FilterClicked;
            }
        }
Esempio n. 3
0
        public UIGizmoSearch(UIScript script, UIGizmo parent)
        {
            Background = script.Create <UIImage>("BackgroundImageSearch");
            this.Add(Background);

            script.LinkMembers(this, true);

            SearchText.CurrentText            = "freeso.ml";
            NarrowSearchButton.OnButtonClick += JoinServerLot;
        }
Esempio n. 4
0
        public UIGizmoSearch(UIScript script, UIGizmo parent)
        {
            Main = parent;

            Background = script.Create <UIImage>("BackgroundImageSearch");
            this.Add(Background);

            script.LinkMembers(this, true);

            SearchText.CurrentText            = GlobalSettings.Default.LoginServerIP;
            NarrowSearchButton.OnButtonClick += JoinServerLot;
        }
Esempio n. 5
0
        public UIGizmoPropertyFilters(UIScript script, UIGizmo parent)
        {
            Background = script.Create <UIImage>("BackgroundImageFilters");
            this.Add(Background);

            var filterChildren = parent.GetChildren().Where(x => x.ID != null && x.ID.StartsWith("PropertyFilterButton_")).ToList();

            foreach (var child in filterChildren)
            {
                child.Parent.Remove(child);
                this.Add(child);
            }
        }
Esempio n. 6
0
        public UIImage Background; //public so we can disable visibility when not selected... workaround to stop background mouse blocking still happening when panel is hidden

        public UIGizmoTop100(UIScript script, UIGizmo parent)
        {
            Background = script.Create <UIImage>("BackgroundImageTop100Lists");
            this.Add(Background);

            script.LinkMembers(this, true);

            Top100Slider.AttachButtons(Top100ListScrollUpButton, Top100ListScrollDownButton, 1);
            Top100ResultList.AttachSlider(Top100Slider);

            populateWithXMLHouses();

            Top100ResultList.OnDoubleClick += Top100ItemSelect;
            UpdateCooldown = 100;
        }
Esempio n. 7
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. 8
0
        public UIGizmoTop100(UIScript script, UIGizmo parent)
        {
            Background = script.Create<UIImage>("BackgroundImageTop100Lists");
            this.Add(Background);

            script.LinkMembers(this, true);

            Top100Slider.AttachButtons(Top100ListScrollUpButton, Top100ListScrollDownButton, 1);
            Top100ResultList.AttachSlider(Top100Slider);

            populateWithXMLHouses();

            Top100ResultList.OnDoubleClick += Top100ItemSelect;
            UpdateCooldown = 100;
        }
Esempio n. 9
0
        public UIGizmoSearch(UIScript script, UIGizmo parent)
        {
            Background = script.Create<UIImage>("BackgroundImageSearch");
            this.Add(Background);

            script.LinkMembers(this, true);

            SearchText.CurrentText = "127.0.0.1";
            NarrowSearchButton.OnButtonClick += JoinServerLot;
        }
Esempio n. 10
0
        public UIGizmoPropertyFilters(UIScript script, UIGizmo parent)
        {
            Background = script.Create<UIImage>("BackgroundImageFilters");
            this.Add(Background);

            var filterChildren = parent.GetChildren().Where(x => x.ID != null && x.ID.StartsWith("PropertyFilterButton_")).ToList();
            foreach (var child in filterChildren)
            {
                child.Parent.Remove(child);
                this.Add(child);
            }
        }
Esempio n. 11
0
        public CoreGameScreen()
            : base()
        {
            /** City Scene **/
            ListenForMouse(new Rectangle(0, 0, ScreenWidth, ScreenHeight), new UIMouseEvent(MouseHandler));

            CityRenderer = new Terrain(GameFacade.Game.GraphicsDevice); //The Terrain class implements the ThreeDAbstract interface so that it can be treated as a scene but manage its own drawing and updates.

            city = "Queen Margaret's";
            if (PlayerAccount.CurrentlyActiveSim != null)
                city = PlayerAccount.CurrentlyActiveSim.ResidingCity.Name;

            CityRenderer.m_GraphicsDevice = GameFacade.GraphicsDevice;

            CityRenderer.Initialize(city, GameFacade.CDataRetriever);
            CityRenderer.LoadContent(GameFacade.GraphicsDevice);
            CityRenderer.RegenData = true;

            CityRenderer.SetTimeOfDay(0.5);
            StateChanges = new Queue<SimConnectStateChange>();

            /**
            * Music
            */
            CityMusic = new string[]{
                GlobalSettings.Default.StartupPath + "\\music\\modes\\map\\tsobuild1.mp3",
                GlobalSettings.Default.StartupPath + "\\music\\modes\\map\\tsobuild3.mp3",
                GlobalSettings.Default.StartupPath + "\\music\\modes\\map\\tsomap2_v2.mp3",
                GlobalSettings.Default.StartupPath + "\\music\\modes\\map\\tsomap3.mp3",
                GlobalSettings.Default.StartupPath + "\\music\\modes\\map\\tsomap4_v1.mp3"
            };
            HITVM.Get().PlaySoundEvent(UIMusic.Map);

            /*VMDebug = new UIButton()
            {
                Caption = "Simantics",
                Y = 45,
                Width = 100,
                X = GlobalSettings.Default.GraphicsWidth - 110
            };
            VMDebug.OnButtonClick += new ButtonClickDelegate(VMDebug_OnButtonClick);
            this.Add(VMDebug);*/

            SaveHouseButton = new UIButton()
            {
                Caption = "Save House",
                Y = 10,
                Width = 100,
                X = GlobalSettings.Default.GraphicsWidth - 110
            };
            SaveHouseButton.OnButtonClick += new ButtonClickDelegate(SaveHouseButton_OnButtonClick);
            this.Add(SaveHouseButton);

            ucp = new UIUCP(this);
            ucp.Y = ScreenHeight - 210;
            ucp.SetInLot(false);
            ucp.UpdateZoomButton();
            ucp.MoneyText.Caption = PlayerAccount.Money.ToString();
            this.Add(ucp);

            gizmo = new UIGizmo();
            gizmo.X = ScreenWidth - 500;
            gizmo.Y = ScreenHeight - 300;
            this.Add(gizmo);

            Title = new UIGameTitle();
            Title.SetTitle(city);
            this.Add(Title);

            //OpenInbox();

            this.Add(GameFacade.MessageController);
            GameFacade.MessageController.OnSendLetter += new LetterSendDelegate(MessageController_OnSendLetter);
            GameFacade.MessageController.OnSendMessage += new MessageSendDelegate(MessageController_OnSendMessage);

            NetworkFacade.Controller.OnNewTimeOfDay += new OnNewTimeOfDayDelegate(Controller_OnNewTimeOfDay);
            NetworkFacade.Controller.OnPlayerJoined += new OnPlayerJoinedDelegate(Controller_OnPlayerJoined);

            //THIS IS KEPT HERE AS A DOCUMENTATION OF THE MESSAGE PASSING API FOR NOW.
            /*
            MessageAuthor Author = new MessageAuthor();
            Author.Author = "Whats His Face";
            Author.GUID = Guid.NewGuid().ToString();

            GameFacade.MessageController.PassMessage(Author, "you suck");
            GameFacade.MessageController.PassMessage(Author, "no rly");
            GameFacade.MessageController.PassMessage(Author, "jk im just testing message recieving please love me");

            Author.Author = "yer maw";
            Author.GUID = Guid.NewGuid().ToString();

            GameFacade.MessageController.PassMessage(Author, "dont let whats his face get to you");
            GameFacade.MessageController.PassMessage(Author, "i will always love you");

            Author.Author = "M.O.M.I";
            Author.GUID = Guid.NewGuid().ToString();

            GameFacade.MessageController.PassEmail(Author, "Ban Notice", "You have been banned for playing too well. \r\n\r\nWe don't know why you still have access to the game, but it's probably related to you playing the game pretty well. \r\n\r\nPlease stop immediately.\r\n\r\n - M.O.M.I. (this is just a test message btw, you're not actually banned)");
            */

            GameFacade.Scenes.Add(CityRenderer);

            ZoomLevel = 5; //screen always starts at far zoom, city visible.
        }