Ejemplo n.º 1
0
        private void FinishedAccountRequest(EventArgs <string> e)
        {
            if (e.Error)
            {
                SetInteractive(true);

                ErrorWindow window = (ErrorWindow)GameMenu.SingletonInstance.AddWindow(Window.ERROR);
                window.SetText(e.ErrorText);
            }
        }
Ejemplo n.º 2
0
        public void OnOfflineClick()
        {
            if (nameField.text == "")
            {
                ErrorWindow errorWindow = (ErrorWindow)GameMenu.SingletonInstance.AddWindow(Window.ERROR);
                errorWindow.SetText("A name for the offline player is required!");
                return;
            }

            LoadPlayerFile(nameField.text);
            LoginFinished();
        }
Ejemplo n.º 3
0
        private void FinishedLoginRequest(EventArgs <string> e)
        {
            SetInteractive(true);

            if (e.Error)
            {
                ErrorWindow window = (ErrorWindow)GameMenu.SingletonInstance.AddWindow(Window.ERROR);
                window.SetText(e.ErrorText);
            }
            else
            {
                PlayerSave.current = player;
                GameMenu.SingletonInstance.CloseWindow();
                GameMenu.SingletonInstance.CloseWindow();
            }
        }
Ejemplo n.º 4
0
        public void OnLoginClick()
        {
            SetInteractive(false);
            LoadPlayerFile(nameField.text);

            PlayerSave.current.OnLoginFinished += (sender, e) => GameInfo.info.RunOnMainThread(() =>
            {
                SetInteractive(true);
                if (!e.Error)
                {
                    LoginFinished();
                }
                else
                {
                    ErrorWindow errorWindow = (ErrorWindow)GameMenu.SingletonInstance.AddWindow(Window.ERROR);
                    errorWindow.SetText(e.ErrorText);
                }
            });
            PlayerSave.current.StartLogin(passField.text);
        }