예제 #1
0
        public InboxController(UIInbox view, IClientDataService dataService, IDatabaseService database, Network.Network net)
        {
            this.View            = view;
            this.DataService     = dataService;
            this.DatabaseService = database;
            this.Network         = net;

            this.InboxStore = UIMessageStore.Store;
            try
            {
                InboxStore.Load((int)net.MyCharacter);
            } catch
            {
                //oops, we couldnt load the local data...
                //assuming it failed anywhere, it will download from server as if timestamp were 0.
            }

            this.Network.CityClient.AddSubscriber(this);

            Network.CityClient.Write(new MailRequest
            {
                Type        = MailRequestType.POLL_INBOX, //we're ready to recieve any pending roommate requests
                TimestampID = InboxStore.LastMessageTime
            });

            GameThread.NextUpdate(x =>
            {
                View.UpdateInbox();
            });
        }
예제 #2
0
 public void OpenInbox()
 {
     if (Inbox == null)
     {
         Inbox = new UIInbox();
         this.Add(Inbox);
         Inbox.X = GlobalSettings.Default.GraphicsWidth / 2 - 332;
         Inbox.Y = GlobalSettings.Default.GraphicsHeight / 2 - 184;
     }
     //todo, on already visible move to front
 }
예제 #3
0
 public void CloseInbox()
 {
     this.Remove(Inbox);
     Inbox = null;
 }
예제 #4
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);
        }