public UIPropertySelectContainer()
        {
            Add(SelectedLotName = new UILabel()
            {
                Size      = new Vector2(341, 25),
                Alignment = TextAlignment.Center | TextAlignment.Top,
                Caption   = "<no property selected>"
            });

            Add(Dropdown = new UIInboxDropdown()
            {
                Position = new Vector2(0, 25)
            });
            Dropdown.OnSearch += (query) =>
            {
                FindController <GenericSearchController>()?.SearchLots(query, false, (results) =>
                {
                    Dropdown.SetResults(results);
                });
            };
            Dropdown.OnSelect += SelectLot;;
            Add(Dropdown);

            var ctr = ControllerUtils.BindController <GenericSearchController>(this);
        }
Esempio n. 2
0
        private Message AddMessage(Message message)
        {
            if (ActiveMessages.Count(x => x.Type == message.Type) >= 3)
            {
                HIT.HITVM.Get().PlaySoundEvent("ui_call_q_full");
                return(null);
            }

            var existing = (message.Type == MessageType.ReadLetter)?GetLetterByID(message.LetterID):GetMessageByUser(message.Type, message.User.Type, message.User.Id);

            if (existing != null)
            {
                return(existing);
            }

            var window = new UIMessageWindow();

            ControllerUtils.BindController <MessagingWindowController>(window).Init(message, this);
            Game.AddWindow(window);
            MessageWindows.Add(message, window);
            ActiveMessages.Add(message);

            Tray.SetItems(ActiveMessages);
            UpdateTray();

            return(message);
        }
Esempio n. 3
0
        public UIBulletinDialog(uint nhoodID) : base(UIDialogStyle.Close, true)
        {
            Board              = new UIBulletinBoard();
            Board.OnSelection += SelectedPost;
            Post         = new UIBulletinPost();
            Post.Opacity = 0;
            Post.Visible = false;
            Post.OnBack += Return;
            DynamicOverlay.Add(Board);
            DynamicOverlay.Add(Post);

            CurrentNeigh = new Binding <Neighborhood>()
                           .WithBinding(this, "Caption", "Neighborhood_Name", (name) =>
            {
                return(GameFacade.Strings.GetString("f120", "1", new string[] { (string)name }));
            })
                           .WithBinding(this, "MayorID", "Neighborhood_MayorID");

            Caption = GameFacade.Strings.GetString("f120", "1", new string[] { "" });
            SetSize(600, 610);

            var controller = ControllerUtils.BindController <BulletinDialogController>(this);

            controller.LoadNhood(nhoodID);

            GlobalInstance = this;
        }
Esempio n. 4
0
        private void ChangeState <TView, TController>(Callback <TView, TController> onCreated) where TView : UIScreen
        {
            Binding.DisposeAll();
            GameThread.InUpdate(() =>
            {
                GameFacade.Cursor.SetCursor(Common.Rendering.Framework.CursorType.Normal); //reset cursor
                if (CurrentController != null)
                {
                    if (CurrentController is IDisposable)
                    {
                        ((IDisposable)CurrentController).Dispose();
                    }
                }

                var view       = (UIScreen)Kernel.Get <TView>();
                var controller = ControllerUtils.BindController <TController>(view);
                GameFacade.Screens.RemoveCurrent();
                GameFacade.Screens.AddScreen(view);

                CurrentController = controller;
                CurrentView       = view;

                onCreated((TView)view, controller);
            });
        }
Esempio n. 5
0
        public UISecureTradeEOD(UIEODController controller) : base(controller)
        {
            var ctr = ControllerUtils.BindController <SecureTradeController>(this);

            InitUI();
            InitEOD();
        }
Esempio n. 6
0
        public NeighPageController(UINeighPage view, IClientDataService dataService)
        {
            this.View        = view;
            this.DataService = dataService;
            this.Topic       = dataService.CreateTopicSubscription();

            ControllerUtils.BindController <RatingSummaryController>(this.View.MayorRatingBox1);
            ControllerUtils.BindController <RatingSummaryController>(this.View.MayorRatingBox2);
        }
 public override void Update(UpdateState state)
 {
     base.Update(state);
     if (Controller == null)
     {
         var cont = ControllerUtils.BindController <RatingSummaryController>(this);
         cont.SetRating(RatingID);
     }
 }
Esempio n. 8
0
        public void Initialize(string cityName, int cityMap, TerrainController terrainController)
        {
            Title.SetTitle(cityName);
            GameFacade.CurrentCityName = cityName;
            InitializeMap(cityMap);
            InitializeMouse();
            ZoomLevel = 5; //screen always starts at far zoom, city visible.
            CityRenderer.m_ZoomProgress = 0;

            JoinLotProgress = new UIJoinLotProgress();
            ControllerUtils.BindController <JoinLotProgressController>(JoinLotProgress);

            terrainController.Init(CityRenderer);
            CityRenderer.SetController(terrainController);
        }
Esempio n. 9
0
        public override void Update(UpdateState state)
        {
            if (CurrentAvatar == null)
            {
                CurrentAvatar = new Binding <Avatar>()
                                .WithBinding(this, "RatingIDs", "Avatar_ReviewIDs")
                                .WithBinding(this, "Name", "Avatar_Name");
                var cont = ControllerUtils.BindController <RatingListController>(this);
                cont.SetAvatar(AvatarID);

                RatingList.SetSize(475, 349);
                RatingList.VisibleRows = 5;
                RatingList.PositionChildSlider();
            }
            base.Update(state);
        }
Esempio n. 10
0
        //listbox
        //smallThumb | avatarName | buildCheckbox | deleteButton

        public UIManageDonatorDialog(UILotControl lotControl) : base(UIDialogStyle.Standard | UIDialogStyle.OK, true)
        {
            this.LotControl = lotControl;
            Community       = lotControl.vm.TSOState.CommunityLot;

            BuildIcon = new UIImage();
            var ui     = RenderScript("fsodonatorlist.uis");
            var listBg = ui.Create <UIImage>("ListBoxBackground");

            AddAt(4, listBg);
            listBg.With9Slice(25, 25, 25, 25);
            listBg.Width  += 110;
            listBg.Height += 50;

            Dropdown           = ui.Create <UIInboxDropdown>("PullDownMenuSetup");
            Dropdown.OnSearch += (query) =>
            {
                FindController <GenericSearchController>()?.Search(query, false, (results) =>
                {
                    Dropdown.SetResults(results);
                });
            };
            Dropdown.OnSelect += AddDonator;
            Add(Dropdown);

            RoommateListSlider.AttachButtons(RoommateListScrollUpButton, RoommateScrollDownButton, 1);
            RoommateListBox.AttachSlider(RoommateListSlider);
            RoommateListBox.Columns[1].Alignment = Framework.TextAlignment.Left | Framework.TextAlignment.Middle;

            Caption = GameFacade.Strings.GetString("f114", (Community)?"6":"12");
            SetSize(405, 400);

            DonatorsLabel.CaptionStyle        = DonatorsLabel.CaptionStyle.Clone();
            DonatorsLabel.CaptionStyle.Shadow = true;
            DonatorsLabel.Caption             = GameFacade.Strings.GetString("f114", (Community) ? "5" : "13");
            AddAt(5, BuildIcon);

            var ctr = ControllerUtils.BindController <GenericSearchController>(this);

            UpdateDonatorList();
            OKButton.OnButtonClick += (btn) =>
            {
                UIScreen.RemoveDialog(this);
            };
        }
Esempio n. 11
0
        public void Initialize(string cityName, int cityMap, TerrainController terrainController)
        {
            CalculateMatrix();
            CityFloatingContainer.ScaleX = 1f / Scale.X;
            CityFloatingContainer.ScaleY = 1f / Scale.Y;

            Title.SetTitle(cityName);
            GameFacade.CurrentCityName = cityName;
            InitializeMap(cityMap);
            InitializeMouse();
            ZoomLevel = 5; //screen always starts at far zoom, city visible.
            CityRenderer.m_ZoomProgress = 0;

            JoinLotProgress = new UIJoinLotProgress();
            ControllerUtils.BindController <JoinLotProgressController>(JoinLotProgress);

            terrainController.Init(CityRenderer);
            CityRenderer.SetController(terrainController);

            GameThread.NextUpdate(x =>
            {
                FSOFacade.Hints.TriggerHint("screen:city");
            });
        }
Esempio n. 12
0
        void SetMode(UIElement button)
        {
            if (button == HouseInfoButton)
            {
                var controller = GameFacade.Screens.CurrentUIScreen.FindController <CoreGameScreenController>();
                if (controller != null)
                {
                    controller.ShowLotPage(controller.GetCurrentLotID());
                    return;
                }
            }

            var btn      = (UIButton)button;
            int newPanel = -1;

            BtnToMode.TryGetValue(btn, out newPanel);

            foreach (var ui in BtnToMode.Keys)
            {
                ui.Selected = false;
            }

            if (CurrentPanel != -1)
            {
                if (Panel is IDisposable)
                {
                    ((IDisposable)Panel)?.Dispose();
                }
                Remove(Panel);
            }
            if (newPanel != CurrentPanel)
            {
                btn.Selected = true;
                switch (newPanel)
                {
                case 1:
                    Panel = new UIStatsPanel(LotControl);
                    break;

                case 2:
                    Panel = new UIRoommatesPanel(LotControl);
                    break;

                case 3:
                    Panel = new UILogPanel(LotControl);
                    break;

                case 4:
                    Panel = new UIAdmitBanPanel(LotControl);
                    var ctr = ControllerUtils.BindController <LotAdmitController>(Panel);
                    break;

                case 5:
                    Panel = new UIEnvPanel(LotControl)
                    {
                        X = 232,
                        Y = 0
                    };
                    break;

                case 7:
                    Panel = new UIBuildableAreaPanel(LotControl);
                    break;

                default:
                    btn.Selected = false;
                    break;
                }
                if (Panel != null)
                {
                    if (newPanel != 5)
                    {
                        Panel.X = 225; //TODO: use uiscript positions
                        Panel.Y = 9;
                    }
                    Add(Panel);
                    CurrentPanel = newPanel;
                }
            }
            else
            {
                CurrentPanel = -1;
            }
        }
Esempio n. 13
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);
        }
Esempio n. 14
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);
        }
Esempio n. 15
0
        public CoreGameScreen() : base()
        {
            DiscordRpcEngine.SendFSOPresence(null, 0, 0, 0, 0);
            StateChanges = new Queue <SimConnectStateChange>();

            /**
             * Music
             */
            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 = "0";// PlayerAccount.Money.ToString();
            this.Add(ucp);

            gizmo = new UIGizmo();
            ControllerUtils.BindController <GizmoController>(gizmo);
            gizmo.X = ScreenWidth - 430;
            gizmo.Y = ScreenHeight - 230;
            this.Add(gizmo);

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

            this.Add(FSOFacade.MessageController);

            MessageTray   = new UIMessageTray();
            MessageTray.X = ScreenWidth - 70;
            MessageTray.Y = 12;
            this.Add(MessageTray);

            WindowContainer = new UIContainer();
            Add(WindowContainer);

            PersonPage         = new UIPersonPage();
            PersonPage.Visible = false;
            ControllerUtils.BindController <PersonPageController>(PersonPage);
            WindowContainer.Add(PersonPage);

            LotPage         = new UILotPage();
            LotPage.Visible = false;
            ControllerUtils.BindController <LotPageController>(LotPage);
            WindowContainer.Add(LotPage);

            Bookmarks         = new UIBookmarks();
            Bookmarks.Visible = false;
            ControllerUtils.BindController <BookmarksController>(Bookmarks);
            WindowContainer.Add(Bookmarks);

            Relationships         = new UIRelationshipDialog();
            Relationships.Visible = false;
            ControllerUtils.BindController <RelationshipDialogController>(Relationships);
            WindowContainer.Add(Relationships);

            Inbox         = new UIInbox();
            Inbox.Visible = false;
            ControllerUtils.BindController <InboxController>(Inbox);
            WindowContainer.Add(Inbox);
        }
Esempio n. 16
0
        private void SetMode(Framework.UIElement button)
        {
            if (button == HouseInfoButton)
            {
                var controller = GameFacade.Screens.CurrentUIScreen.FindController <FSO.Client.Controllers.CoreGameScreenController>();
                if (controller != null)
                {
                    controller.ShowLotPage(controller.GetCurrentLotID());
                    return;
                }
            }

            var btn      = (UIButton)button;
            int newPanel = -1;

            BtnToMode.TryGetValue(btn, out newPanel);

            foreach (var ui in BtnToMode.Keys)
            {
                ui.Selected = false;
            }

            if (CurrentPanel != -1)
            {
                if (Panel is IDisposable)
                {
                    ((IDisposable)Panel)?.Dispose();
                }
                if (Panel is UIDialog)
                {
                    UIScreen.RemoveDialog(Panel);
                }
                this.Remove(Panel);
            }
            if (newPanel != CurrentPanel)
            {
                btn.Selected = true;
                switch (newPanel)
                {
                case 1:
                    Panel = new UIStatsPanel(LotControl);
                    break;

                case 2:
                    Panel = new Panels.Neighborhoods.UIManageDonatorDialog(LotControl);
                    break;

                case 3:
                    Panel = new UILogPanel(LotControl);
                    break;

                case 4:
                    Panel = new UIAdmitBanPanel(LotControl);
                    var ctr = ControllerUtils.BindController <LotAdmitController>(Panel);
                    break;

                case 5:
                    Panel   = new UIEnvPanel(LotControl);
                    Panel.X = 232;
                    Panel.Y = 0;
                    break;

                case 7:
                    Panel = new UIBuildableAreaPanel(LotControl);
                    break;

                default:
                    btn.Selected = false;
                    break;
                }
                if (Panel != null)
                {
                    if (Panel is UIDialog)
                    {
                        UIScreen.GlobalShowDialog(Panel, false);
                    }
                    else
                    {
                        if (newPanel != 5)
                        {
                            Panel.X = 225; //TODO: use uiscript positions
                            Panel.Y = 9;
                        }
                        this.Add(Panel);
                    }
                    CurrentPanel = newPanel;
                }
            }
            else
            {
                CurrentPanel = -1;
            }
        }