コード例 #1
0
ファイル: GameController.cs プロジェクト: lmumar/FreeSO
        public void ShowCity()
        {
            var screen = new CoreGameScreen();

            GameFacade.Screens.RemoveCurrent();
            GameFacade.Screens.AddScreen(screen);
        }
コード例 #2
0
ファイル: GameController.cs プロジェクト: simscolony/FreeSims
 public void ShowCity(CoreGameScreen screen)
 {
     if (screen != null)
     {
         screen.ZoomLevel = 4;
     }
 }
コード例 #3
0
        public UIUCP(UIScreen owner)
        {
            this.RenderScript("ucp.uis");

            Game = (CoreGameScreen)owner;

            Background = new UIImage(BackgroundGameImage);
            this.AddAt(0, Background);
            Background.BlockInput();


            BackgroundMatchmaker   = new UIImage(BackgroundMatchmakerImage);
            BackgroundMatchmaker.Y = 81;
            this.AddAt(0, BackgroundMatchmaker);
            BackgroundMatchmaker.BlockInput();

            TimeText.Caption              = "12:00 am";
            TimeText.CaptionStyle         = TimeText.CaptionStyle.Clone();
            TimeText.CaptionStyle.Shadow  = true;
            MoneyText.Caption             = "§0";
            MoneyText.CaptionStyle        = TimeText.CaptionStyle.Clone();
            MoneyText.CaptionStyle.Shadow = true;

            CurrentPanel = -1;

            OptionsModeButton.OnButtonClick += new ButtonClickDelegate(OptionsModeButton_OnButtonClick);
            LiveModeButton.OnButtonClick    += new ButtonClickDelegate(LiveModeButton_OnButtonClick);
            BuyModeButton.OnButtonClick     += new ButtonClickDelegate(BuyModeButton_OnButtonClick);
            BuildModeButton.OnButtonClick   += BuildModeButton_OnButtonClick;

            ZoomOutButton.OnButtonClick += new ButtonClickDelegate(ZoomControl);
            ZoomInButton.OnButtonClick  += new ButtonClickDelegate(ZoomControl);
            PhoneButton.OnButtonClick   += new ButtonClickDelegate(PhoneButton_OnButtonClick);

            CloseZoomButton.OnButtonClick    += new ButtonClickDelegate(SetCityZoom);
            MediumZoomButton.OnButtonClick   += new ButtonClickDelegate(SetCityZoom);
            FarZoomButton.OnButtonClick      += new ButtonClickDelegate(SetCityZoom);
            NeighborhoodButton.OnButtonClick += new ButtonClickDelegate(SetCityZoom);
            WorldButton.OnButtonClick        += new ButtonClickDelegate(SetCityZoom);

            HouseViewSelectButton.OnButtonClick += new ButtonClickDelegate(WallsViewPopup);
            WallsDownButton.OnButtonClick       += new ButtonClickDelegate(WallsViewPopup);
            WallsUpButton.OnButtonClick         += new ButtonClickDelegate(WallsViewPopup);
            WallsCutawayButton.OnButtonClick    += new ButtonClickDelegate(WallsViewPopup);
            RoofButton.OnButtonClick            += new ButtonClickDelegate(WallsViewPopup);

            RotateClockwiseButton.OnButtonClick        += new ButtonClickDelegate(RotateClockwise);
            RotateCounterClockwiseButton.OnButtonClick += new ButtonClickDelegate(RotateCounterClockwise);

            FirstFloorButton.OnButtonClick  += FirstFloor;
            SecondFloorButton.OnButtonClick += SecondFloor;

            SecondFloorButton.Selected = (Game.Level == Game.Stories);
            FirstFloorButton.Selected  = (Game.Level == 1);

            MoneyText.CaptionStyle = MoneyText.CaptionStyle.Clone();

            SetInLot(false);
            SetMode(UCPMode.CityMode);
        }
コード例 #4
0
ファイル: GameController.cs プロジェクト: lmumar/FreeSO
        public void ShowLotDebug()
        {
            var screen = new CoreGameScreen(); //new LotDebugScreen();

            GameFacade.Screens.RemoveCurrent();
            GameFacade.Screens.AddScreen(screen);
            //screen.InitTestLot();
            //screen.ZoomLevel = 1;
        }
コード例 #5
0
ファイル: UIExitDialog.cs プロジェクト: simscolony/FreeSims
        private void ReLoginButton_OnButtonClick(UIElement button)
        {
            UIScreen.RemoveDialog(this);

            UIOptions options = (UIOptions)Parent;

            CoreGameScreen screen = ((UIUCP)options.Parent).Game;

            GameFacade.Controller.ShowCity(screen);
        }
コード例 #6
0
        public CoreGameScreenController(CoreGameScreen view, Network.Network network, IClientDataService dataService, IKernel kernel, LotConnectionRegulator joinLotRegulator)
        {
            this.Screen           = view;
            this.Network          = network;
            this.DataService      = dataService;
            this.Chat             = new MessagingController(this, view.MessageTray, network, dataService);
            this.JoinLotRegulator = joinLotRegulator;
            this.RoommateProtocol = new RoommateRequestController(this, network, dataService);

            joinLotRegulator.OnTransition += JoinLotRegulator_OnTransition;

            var shard = Network.MyShard;

            Terrain = kernel.Get <TerrainController>(new ConstructorArgument("parent", this));
            view.Initialize(shard.Name, int.Parse(shard.Map), Terrain);
        }
コード例 #7
0
        public void LinkEveryController()
        {
            //obvious question - "why":
            //this is for mono ahead of time compilation. By referencing everything here,
            //we make sure these classes and generic variants are AOT compiled

            var load  = new LoadingScreen();
            var loadc = new LoadingScreenController(null, null, null);


            var screen = new PersonSelectionEdit();
            var t      = new TerrainController(null, null, null, null, null);
            var n      = new Network.Network(null, null, null, null);
            var v      = new Credits();
            var cd     = new Common.DataService.ClientDataService(null, null, null);
            var c      = new CoreGameScreen();
            var cc     = new CoreGameScreenController(null, null, null, null, null);
            var s      = new SandboxGameScreen();
            var ps     = new PersonSelection(null, null);
            var psc    = new PersonSelectionController(null, null, null, null);
            var cl1    = new Server.Clients.AuthClient("");
            var cl2    = new Server.Clients.CityClient("");
            var cl3    = new Server.Clients.ApiClient("");
            var ls     = new LoginScreen(null);
            var lc     = new LoginController(null, null);
            var lr     = new Regulators.LoginRegulator(null, null, null);

            var seled    = new PersonSelectionEditController(null, null);
            var casr     = new Regulators.CreateASimRegulator(null);
            var purch    = new Regulators.PurchaseLotRegulator(null);
            var conn     = new Regulators.LotConnectionRegulator(null, null, null);
            var t2       = new Regulators.CityConnectionRegulator(null, null, null, null, Kernel, null);
            var neigh    = new Regulators.GenericActionRegulator <NhoodRequest, NhoodResponse>(null);
            var bulletin = new Regulators.GenericActionRegulator <BulletinRequest, BulletinResponse>(null);
            var regu     = new Regulators.RegulatorsModule();

            var prov = new CacheProvider();
            var clip = new AuthClientProvider(null);
            var citp = new CityClientProvider(null);
            var ar   = new Server.Clients.AriesClient(null);
            var tso  = new cTSOSerializerProvider(null);
            var ser  = new Server.Protocol.Voltron.DataService.cTSOSerializer(null);
            var mods = new ModelSerializerProvider(null);
            var dbs  = new Common.DatabaseService.DatabaseService(null);
            var cds  = new Common.DataService.ClientDataService(null, null, null);

            var arp  = new Server.Protocol.Aries.AriesProtocolDecoder(null);
            var are  = new Server.Protocol.Aries.AriesProtocolEncoder(null);
            var serc = new Common.Serialization.SerializationContext(null, null);

            var ff   = new FieldFont();
            var fa   = new FieldAtlas();
            var fg   = new FieldGlyph();
            var kp   = new KerningPair();
            var met  = new Metrics();
            var dict = new Dictionary <char, FieldGlyph>();

            var packets = new object[]
            {
                new ClientOnlinePDU(),
                new HostOnlinePDU(),
                new SetIgnoreListPDU(),
                new SetIgnoreListResponsePDU(),
                new SetInvinciblePDU(),
                new RSGZWrapperPDU(),
                new TransmitCreateAvatarNotificationPDU(),
                new DataServiceWrapperPDU(),
                new DBRequestWrapperPDU(),
                new OccupantArrivedPDU(),
                new ClientByePDU(),
                new ServerByePDU(),
                new FindPlayerPDU(),
                new FindPlayerResponsePDU(),
                new ChatMsgPDU(),
                new AnnouncementMsgPDU(),

                new MessagingWindowController(null, null, null),
                new Controllers.Panels.SecureTradeController(null, null),
                new GizmoSearchController(null, null, null),
                new GizmoTop100Controller(null, null, null, null, null),
                new LotAdmitController(null, null, null),
                new GizmoController(null, null, null),
                new PersonPageController(null, null, null),
                new LotPageController(null, null),
                new BookmarksController(null, null, null),
                new RelationshipDialogController(null, null, null, null),
                new InboxController(null, null, null, null),
                new JoinLotProgressController(null, null),
                new DisconnectController(null, null, null, null, null),
                new GenericSearchController(null, null),
                new NeighPageController(null, null),
                new RatingListController(null, null, null),
                new RatingSummaryController(null, null, null),
                new NeighborhoodActionController(null),

                ImmutableList.Create <uint>(),
                ImmutableList.Create <JobLevel>(),
                ImmutableList.Create <Relationship>(),
                ImmutableList.Create <Bookmark>(),
                ImmutableList.Create <bool>(),

                new cTSOGenericData(),
            };
        }
コード例 #8
0
        public override void Update(UpdateState state)
        {
            if (Visible)
            {  //if we're not visible, do not update CityRenderer state...
                CoreGameScreen CurrentUIScr = (CoreGameScreen)GameFacade.Screens.CurrentUIScreen;

                m_LastMouseState = m_MouseState;
                m_MouseState     = Mouse.GetState();

                m_MouseMove = (m_MouseState.RightButton == ButtonState.Pressed);

                if (m_HandleMouse)
                {
                    if (m_MouseState.RightButton == ButtonState.Pressed && m_LastMouseState.RightButton == ButtonState.Released)
                    {
                        m_MouseStart = new Vector2(m_MouseState.X, m_MouseState.Y);  //if middle mouse button activated, record where we started pressing it (to use for panning)
                    }

                    else if (m_MouseState.LeftButton == ButtonState.Released && m_LastMouseState.LeftButton == ButtonState.Pressed)  //if clicked...
                    {
                        if (!m_Zoomed)
                        {
                            m_Zoomed = true;
                            double ResScale = 768.0 / m_ScrHeight;
                            double isoScale = (Math.Sqrt(0.5 * 0.5 * 2) / 5.10) * ResScale;
                            double hb       = m_ScrWidth * isoScale;
                            double vb       = m_ScrHeight * isoScale;

                            m_TargVOffX = (float)(-hb + m_MouseState.X * isoScale * 2);
                            m_TargVOffY = (float)(vb - m_MouseState.Y * isoScale * 2);  //zoom into approximate location of mouse cursor if not zoomed already
                        }
                        else
                        {
                            if (m_SelTile[0] != -1 && m_SelTile[1] != -1)
                            {
                                m_SelTileTmp[0] = m_SelTile[0];
                                m_SelTileTmp[1] = m_SelTile[1];

                                UIAlertOptions AlertCoords = new UIAlertOptions();
                                AlertCoords.Title = GameFacade.Strings.GetString("246", "1");
                                //AlertOptions.Message = GameFacade.Strings.GetString("215", "23", new string[]
                                //{ m_LotCost.ToString(), CurrentUIScr.ucp.MoneyText.Caption });

                                AlertCoords.Message = m_SelTile[0].ToString() + " " + m_SelTile[1].ToString();


                                foreach (LotTileEntry Lot in m_HousesData.LotTileData)
                                {
                                    if (Lot.x == m_SelTile[0] && Lot.y == m_SelTile[1])
                                    {
                                        m_CurrentLot = Lot;
                                    }
                                }


                                if (m_CurrentLot != null)
                                {
                                    UIAlertOptions AlertOptions = new UIAlertOptions();
                                    AlertOptions.Title = GameFacade.Strings.GetString("246", "1");
                                    //AlertOptions.Message = GameFacade.Strings.GetString("215", "23", new string[]
                                    //{ m_LotCost.ToString(), CurrentUIScr.ucp.MoneyText.Caption });

                                    AlertOptions.Message = m_CurrentLot.x.ToString() + " " + m_CurrentLot.y.ToString();
                                    //AlertOptions.Buttons = UIAlertButtons.YesNo;
                                }
                            }
                        }

                        CurrentUIScr.ucp.UpdateZoomButton();
                    }
                }
                else
                {
                    m_SelTile = new int[] { -1, -1 };
                }

                GameTime time = new GameTime();

                m_SecondsBehind += time.ElapsedGameTime.TotalSeconds;
                m_SecondsBehind -= 1 / 60;
                SetTimeOfDay(m_DayNightCycle % 1); //calculates sun/moon light colour and position
                m_DayNightCycle += 0.001;          //adjust the cycle speed here. When ingame, set m_DayNightCycle to to the percentage of time passed through the day. (0 to 1)

                m_ViewOffX = (m_TargVOffX) * m_ZoomProgress;
                m_ViewOffY = (m_TargVOffY) * m_ZoomProgress;
            }
        }