Ejemplo n.º 1
0
        public LoadingScreen() : base()
        {
            HITVM.Get().PlaySoundEvent(UIMusic.LoadLoop);

            Background = new UISetupBackground();

            //TODO: Letter spacing is a bit wrong on this label
            var lbl = new UILabel();

            lbl.Caption = GameFacade.Strings.GetString("154", "5");
            lbl.X       = 0;
            lbl.Size    = new Microsoft.Xna.Framework.Vector2(800, 100);
            lbl.Y       = 508;

            var style = lbl.CaptionStyle.Clone();

            style.Size       = 17;
            lbl.CaptionStyle = style;
            Background.BackgroundCtnr.Add(lbl);
            this.Add(Background);

            ProgressLabel1 = new UILabel
            {
                X            = 0,
                Y            = 550,
                Size         = new Microsoft.Xna.Framework.Vector2(800, 100),
                CaptionStyle = style
            };

            ProgressLabel2 = new UILabel
            {
                X            = 0,
                Y            = 550,
                Size         = new Microsoft.Xna.Framework.Vector2(800, 100),
                CaptionStyle = style
            };

            Background.BackgroundCtnr.Add(ProgressLabel1);
            Background.BackgroundCtnr.Add(ProgressLabel2);

            PreloadLabels = new string[] {
                GameFacade.Strings.GetString("155", "6"),
                GameFacade.Strings.GetString("155", "7"),
                GameFacade.Strings.GetString("155", "8"),
                GameFacade.Strings.GetString("155", "9")
            };

            CurrentPreloadLabel = 0;
            AnimateLabel("", PreloadLabels[0]);

            CheckProgressTimer          = new Timer();
            CheckProgressTimer.Interval = 5;
            CheckProgressTimer.Elapsed += new ElapsedEventHandler(CheckProgressTimer_Elapsed);
            CheckProgressTimer.Start();

            //GameFacade.Screens.Tween.To(rect, 10.0f, new Dictionary<string, float>() {
            //    {"X", 500.0f}
            //}, TweenQuad.EaseInOut);
        }
Ejemplo n.º 2
0
        public LoadingScreen() : base()
        {
            Background = new UISetupBackground();

            //TODO: Letter spacing is a bit wrong on this label
            var lbl = new UILabel
            {
                Caption = GameFacade.Strings.GetString("154", "5"),
                X       = 0,
                Size    = new Vector2(800, 100),
                Y       = 508
            };

            var style = lbl.CaptionStyle.Clone();

            style.Size       = 17;
            lbl.CaptionStyle = style;
            Background.BackgroundCtnr.Add(lbl);
            Add(Background);

            ProgressLabel1 = new UILabel
            {
                X            = 0,
                Y            = 550,
                Size         = new Vector2(800, 100),
                CaptionStyle = style
            };

            ProgressLabel2 = new UILabel
            {
                X            = 0,
                Y            = 550,
                Size         = new Vector2(800, 100),
                CaptionStyle = style
            };

            Background.BackgroundCtnr.Add(ProgressLabel1);
            Background.BackgroundCtnr.Add(ProgressLabel2);

            PreloadLabels = new string[] {
                GameFacade.Strings.GetString("155", "6"),
                GameFacade.Strings.GetString("155", "7"),
                GameFacade.Strings.GetString("155", "8"),
                GameFacade.Strings.GetString("155", "9")
            };

            CurrentPreloadLabel = 0;
            AnimateLabel("", PreloadLabels[0]);


            CheckProgressTimer = GameThread.SetInterval(CheckProgressTimer_Elapsed, 5);

            //GameFacade.Screens.Tween.To(rect, 10.0f, new Dictionary<string, float>() {
            //    {"X", 500.0f}
            //}, TweenQuad.EaseInOut);
        }
Ejemplo n.º 3
0
        public TSOVersionPatchScreen() : base()
        {
            Background = new UISetupBackground();
            Add(Background);

            Version   = Content.Content.Get().VersionString;
            CanUpdate = Version == Patchable;

            GameThread.NextUpdate((state) =>
            {
                UIAlert.Alert(GameFacade.Strings.GetString("f101", "14"),
                              GameFacade.Strings.GetString("f101", "15", new string[] {
                    Version, GameFacade.Strings.GetString("f101", CanUpdate ? "16" : "17")
                }),
                              true);
            });
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Creates a new CityTransitionScreen.
        /// </summary>
        /// <param name="SelectedCity">The city being transitioned to.</param>
        /// <param name="CharacterCreated">If transitioning from CreateASim, this should be true.
        /// A CharacterCreateCity packet will be sent to the CityServer. Otherwise, this should be false.
        /// A CityToken packet will be sent to the CityServer.</param>
        public TransitionScreen()
        {
            /** Background image **/
            GameFacade.Cursor.SetCursor(Common.Rendering.Framework.CursorType.Hourglass);
            m_Background = new UISetupBackground();

            var lbl = new UILabel();

            lbl.Caption = "Version " + GlobalSettings.Default.ClientVersion;
            lbl.X       = 20;
            lbl.Y       = 558;
            m_Background.BackgroundCtnr.Add(lbl);
            this.Add(m_Background);

            m_LoginProgress         = new UILoginProgress();
            m_LoginProgress.X       = (ScreenWidth - (m_LoginProgress.Width + 20));
            m_LoginProgress.Y       = (ScreenHeight - (m_LoginProgress.Height + 20));
            m_LoginProgress.Opacity = 0.9f;
            this.Add(m_LoginProgress);
        }
Ejemplo n.º 5
0
        public LoginScreen(LoginRegulator regulator)
        {
            try
            {
                if (File.Exists("update2.exe"))
                {
                    File.Delete("update.exe");
                    File.Move("update2.exe", "update.exe");
                }
            } catch (Exception) {
                //maybe signal to user that the updater update failed
            }

            this.Regulator = regulator;
            regulator.Logout();

            HITVM.Get().PlaySoundEvent(UIMusic.None);
            GlobalSettings.Default.Save();

            if (Content.Content.Get().TS1)
            {
                //load the sandbox screen in neighbourhood view mode
                GameThread.NextUpdate(x =>
                {
                    FSOFacade.Controller.EnterSandboxMode("", false);
                });
            }

            Background = new UISetupBackground();

            /** Client version **/
            var lbl = new UILabel();

            lbl.Caption = "Version " + GlobalSettings.Default.ClientVersion;
            lbl.X       = 20;
            lbl.Y       = 558;
            Background.BackgroundCtnr.Add(lbl);
            this.Add(Background);

            /** Progress bar **/
            LoginProgress         = new UILoginProgress();
            LoginProgress.X       = (ScreenWidth - (LoginProgress.Width + 20));
            LoginProgress.Y       = (ScreenHeight - (LoginProgress.Height + 20));
            LoginProgress.Opacity = 0.9f;
            this.Add(LoginProgress);

            /** Login dialog **/
            LoginDialog         = new UILoginDialog(Login);
            LoginDialog.Opacity = 0.9f;
            //Center
            LoginDialog.X = (ScreenWidth - LoginDialog.Width) / 2;
            LoginDialog.Y = (ScreenHeight - LoginDialog.Height) / 2;
            this.Add(LoginDialog);

            bool usernamePopulated = false;

            var loginIniFile = GameFacade.GameFilePath("login.ini");

            if (File.Exists(loginIniFile))
            {
                var iniFile = IniFile.Read(loginIniFile);
                if (iniFile.ContainsKey("LastSession"))
                {
                    LoginDialog.Username = iniFile["LastSession"]["UserName"];
                    usernamePopulated    = true;
                }
            }

            if (!FSOEnvironment.SoftwareKeyboard)
            {
                if (usernamePopulated)
                {
                    LoginDialog.FocusPassword();
                }
                else
                {
                    LoginDialog.FocusUsername();
                }
            }

            var gameplayButton = new UIButton()
            {
                Caption = "Sandbox Mode",
                Y       = 10,
                Width   = 125,
                X       = 10
            };

            this.Add(gameplayButton);
            gameplayButton.OnButtonClick += new ButtonClickDelegate(gameplayButton_OnButtonClick);

            Regulator.OnError      += AuthRegulator_OnError;
            Regulator.OnTransition += AuthRegulator_OnTransition;

            var compat = GlobalSettings.Default.CompatState;

            if (compat != -1 && compat < GlobalSettings.TARGET_COMPAT_STATE)
            {
                GameThread.NextUpdate(x =>
                {
                    GlobalShowAlert(new UIAlertOptions()
                    {
                        Message = GameFacade.Strings.GetString("f105", "2")
                    }, true);
                    var settings                = GlobalSettings.Default;
                    settings.CompatState        = 0;
                    settings.LightingMode       = 0;
                    settings.SurroundingLotMode = 0;
                    settings.CityShadows        = false;
                    settings.AntiAlias          = 0;
                    settings.Save();

                    LotView.WorldConfig.Current = new LotView.WorldConfig()
                    {
                        LightingMode    = settings.LightingMode,
                        SmoothZoom      = settings.SmoothZoom,
                        SurroundingLots = settings.SurroundingLotMode,
                        AA                = settings.AntiAlias,
                        Weather           = settings.Weather,
                        Directional       = settings.DirectionalLight3D,
                        Complex           = settings.ComplexShaders,
                        EnableTransitions = settings.EnableTransitions
                    };
                });
            }
            GameThread.NextUpdate(x =>
            {
                FSOFacade.Hints.TriggerHint("screen:login");

                //UIScreen.GlobalShowDialog(new Panels.Neighborhoods.UIBulletinDialog(), false);
                //Content.Content.Get().UIGraphics.ExportAll(GameFacade.GraphicsDevice);
            });
        }