Exemplo n.º 1
0
        public SandboxGameScreen() : base()
        {
            StateChanges = new Queue <SimConnectStateChange>();

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

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

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

            if (Content.Content.Get().TS1)
            {
                TS1NeighPanel = new UINeighborhoodSelectionPanel(4);
                TS1NeighPanel.OnHouseSelect += (house) =>
                {
                    ActiveFamily = Content.Content.Get().Neighborhood.GetFamilyForHouse((short)house);
                    InitializeLot(Path.Combine(Content.Content.Get().TS1BasePath, "UserData/Houses/House" + house.ToString().PadLeft(2, '0') + ".iff"), false);// "UserData/Houses/House21.iff"
                    Remove(TS1NeighPanel);
                };
                Add(TS1NeighPanel);
            }
        }
Exemplo n.º 2
0
        public void NeighSelection(NeighSelectionMode mode)
        {
            var nbd = (ushort)((mode == NeighSelectionMode.MoveInMagic) ? 7 : 4);

            TS1NeighPanel = new UINeighborhoodSelectionPanel(nbd);
            var switcher = new UINeighbourhoodSwitcher(TS1NeighPanel, nbd, mode != NeighSelectionMode.Normal);

            TS1NeighPanel.OnHouseSelect += (house) =>
            {
                if (MoveInFamily != null)
                {
                    //move them in first
                    //confirm it
                    UIMobileAlert confirmDialog = null;
                    confirmDialog = new UIMobileAlert(new UIAlertOptions()
                    {
                        Title   = GameFacade.Strings.GetString("132", "0"),
                        Message = GameFacade.Strings.GetString("132", "1"),
                        Buttons = UIAlertButton.YesNo((b) =>
                        {
                            confirmDialog.Close();
                            MoveInAndPlay((short)house, MoveInFamily.Value, switcher);
                        },
                                                      (b) => confirmDialog.Close())
                    });
                    UIScreen.GlobalShowDialog(confirmDialog, true);
                }
                else
                {
                    PlayHouse((short)house, switcher);
                }
            };
            Add(TS1NeighPanel);
            Add(switcher);
        }
Exemplo n.º 3
0
        public void NeighSelection()
        {
            TS1NeighPanel = new UINeighborhoodSelectionPanel(4);
            var switcher = new UINeighbourhoodSwitcher(TS1NeighPanel, 4);

            TS1NeighPanel.OnHouseSelect += (house) =>
            {
                ActiveFamily = Content.Get().Neighborhood.GetFamilyForHouse((short)house);
                InitializeLot(Path.Combine(FSOEnvironment.UserDir, "UserData/Houses/House" + house.ToString().PadLeft(2, '0') + ".iff"), false);// "UserData/Houses/House21.iff"
                Remove(TS1NeighPanel);
                Remove(switcher);
            };
            Add(TS1NeighPanel);
            Add(switcher);
        }
Exemplo n.º 4
0
        public TS1GameScreen() : base()
        {
            Bg          = new UISimitoneBg();
            Bg.Position = (new Vector2(ScreenWidth, ScreenHeight)) / 2;
            Add(Bg);

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

            if (Content.Get().TS1)
            {
                TS1NeighPanel = new UINeighborhoodSelectionPanel(4);
                TS1NeighPanel.OnHouseSelect += (house) =>
                {
                    ActiveFamily = Content.Get().Neighborhood.GetFamilyForHouse((short)house);
                    InitializeLot(Path.Combine(Content.Get().TS1BasePath, "UserData/Houses/House" + house.ToString().PadLeft(2, '0') + ".iff"), false);// "UserData/Houses/House21.iff"
                    Remove(TS1NeighPanel);
                };
                Add(TS1NeighPanel);
            }
        }