Ejemplo n.º 1
0
        public void CreateWindow()
        {
            ThisWindow.CreateWindow("Selection", SelectionSize, false);

            Content      = new GameObject();
            Content.name = "Content";
            Content.transform.position = ThisWindow.WindowContainer.transform.position;
            Content.transform.parent   = ThisWindow.WindowContainer.transform;

            SelectionPrompt      = Object.Instantiate(Resources.Load("Prefabs/MessageWindow/SelectorCursor")) as GameObject;
            SelectionPrompt.name = "SelectionCursor";
            SelectionPrompt.transform.position  = ThisWindow.WindowContainer.transform.position;
            SelectionPrompt.transform.position += new Vector3(((ThisWindow.WindowSize.x * -1) + 1 * 0.40f), (ThisWindow.WindowSize.y) + TopPadding);
            SelectionPrompt.transform.parent    = ThisWindow.WindowContainer.transform;

            GameObject SelectionBack;

            for (int i = 0; i < (ThisWindow.WindowSize.x * 2) - 1; i++)
            {
                SelectionBack      = Object.Instantiate(Resources.Load("Prefabs/MessageWindow/SelectionBack")) as GameObject;
                SelectionBack.name = "SelectionBack";
                SelectionBack.transform.position  = SelectionPrompt.transform.position;
                SelectionBack.transform.position += new Vector3(i + 0.80f, 0, 0);
                SelectionBack.transform.parent    = SelectionPrompt.transform;
            }
        }
        public void Confirm()
        {
            if (SelectedAddressDataWrapper != null)
            {
                SelectedAddressDataWrapper.PropertyChanged -= AddressMapEditViewModel_PropertyChanged;
            }

            ThisWindow.DialogResult = true;
            ThisWindow.Close();
        }
Ejemplo n.º 3
0
        public void disconnect()
        {
            ThisWindow.Close();
            MainWindow x = new MainWindow();

            x.Show();
            MahApps.Metro.Controls.MetroWindow wd = Window.GetWindow(x) as MahApps.Metro.Controls.MetroWindow;
            if (wd != null)
            {
                wd.ShowMessageAsync("You were Disconnected ", " You were disconnected and sent back to login Window");
            }
        }
Ejemplo n.º 4
0
        public int Read(PlayerControl Player)
        {
            InputisHere = true;
            if (ThisWindow.ReturnHandler() && Reading)
            {
                Reading = false;
                ClearContent();
                HideWindow();
                Player.NotDoShomething();
                return(SelectionIndex);
            }
            else if (Input.GetKeyDown(KeyCode.Escape) && InputisHere && !NonEscapable)
            {
                Reading = false;
                ClearContent();
                HideWindow();
                Player.NotDoShomething();
                return(0);
            }
            else
            {
                Player.DoShomething();
                if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow))
                {
                    if (SelectionIndex - 1 >= 1)
                    {
                        SelectionIndex--; SelectionPrompt.transform.position += new Vector3(0, 1, 0);
                    }
                    else if (SelectionIndex - 1 < 1)
                    {
                        SelectionIndex = Selections.Count; SelectionPrompt.transform.position += new Vector3(0, (Selections.Count * -1) + 1, 0);
                    }
                }

                if (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow))
                {
                    if (SelectionIndex + 1 <= Selections.Count)
                    {
                        SelectionIndex++; SelectionPrompt.transform.position += new Vector3(0, -1, 0);
                    }
                    else if (SelectionIndex + 1 > Selections.Count)
                    {
                        SelectionIndex = 1; SelectionPrompt.transform.position += new Vector3(0, (Selections.Count * 1) - 1, 0);
                    }
                }
            }

            return(0);
        }
Ejemplo n.º 5
0
        private void ChangeConvertPanel(bool toState)
        {
            if (isOpen == toState)
            {
                return;
            }

            if (!toState)
            {
                ThisWindow.BeginAnimation(Window.WidthProperty, WindowClosingAnim);
                SaveColumn.BeginAnimation(ColumnDefinition.WidthProperty, GridClosingAnim);
            }
            else
            {
                ThisWindow.BeginAnimation(Window.WidthProperty, WindowOpeningAnim);
                SaveColumn.BeginAnimation(ColumnDefinition.WidthProperty, GridOpeningAnim);
            }
        }
 public void Read()
 {
     if (ThisWindow.ReturnHandler() && Reading && CanEscape)
     {
         if (RemainingCharactersCount == 0)
         {
             Message = string.Empty;
             Reading = false;
             ClearMessage();
             ClearContent();
             HideWindow();
         }
         else if (RemainingCharactersCount > 0)
         {
             ClearMessage();
             ClearContent();
             CreateCharacters();
         }
     }
 }
Ejemplo n.º 7
0
        public MainWindow()
        {
            InitializeComponent();
            RenderOptions.SetBitmapScalingMode(this, BitmapScalingMode.Fant);
            mainDispatcher = this.Dispatcher;
            DataContext    = vm;

            GridOpeningAnim.Duration = TimeSpan.FromSeconds(duration);
            GridClosingAnim.Duration = TimeSpan.FromSeconds(duration);

            GridOpeningAnim.From = new GridLength(0, GridUnitType.Star);
            GridOpeningAnim.To   = new GridLength(563, GridUnitType.Star);

            GridClosingAnim.From = new GridLength(563, GridUnitType.Star);
            GridClosingAnim.To   = new GridLength(0, GridUnitType.Star);


            QuarticEase easer = new QuarticEase();

            easer.EasingMode = EasingMode.EaseOut;

            GridOpeningAnim.EasingFunction   = easer;
            GridClosingAnim.EasingFunction   = easer;
            WindowOpeningAnim.EasingFunction = easer;
            WindowClosingAnim.EasingFunction = easer;
            SaveMessageClose.EasingFunction  = easer;
            SaveMessageOpen.EasingFunction   = easer;

            ThisWindow.BeginAnimation(Window.WidthProperty, WindowClosingAnim);
            SaveColumn.BeginAnimation(ColumnDefinition.WidthProperty, GridClosingAnim);
            SuccessfulSaveMessage.RenderTransform.BeginAnimation(ScaleTransform.ScaleXProperty, SaveMessageClose);
            FailedSaveMessage.RenderTransform.BeginAnimation(ScaleTransform.ScaleXProperty, SaveMessageClose);

            vm.PropertyChanged += (source, args) =>
            {
                if (args.PropertyName == "SaveSuccess")
                {
                    mainDispatcher.BeginInvoke(new Action(() => ChangeSaveMessageVisibility(vm.SaveSuccess)));
                }
            };
        }
        public void CreateWindow(GameObject Player)
        {
            switch (WindowLocation)
            {
            case WindowLocation.BOTTOM:
            {
                CurrentLocation = new Vector3(0, -3);
                break;
            }

            case WindowLocation.TOP:
            {
                CurrentLocation = new Vector3(0, 3);
                break;
            }

            case WindowLocation.CENTER:
            {
                CurrentLocation = Vector3.zero;
                break;
            }

            default:
            {
                CurrentLocation = new Vector3(0, 3);
                WindowLocation  = WindowLocation.BOTTOM;
                break;
            }
            }

            //
            ThisWindow.CreateWindow("Message", new Vector2(5, 1), CurrentLocation, false, Player);

            //
            NextPrompt      = Object.Instantiate(Resources.Load("Prefabs/MessageWindow/NextCursor")) as GameObject;
            NextPrompt.name = "NextCursor";
            NextPrompt.transform.position  = ThisWindow.WindowContainer.transform.position;
            NextPrompt.transform.position += new Vector3(0, ThisWindow.WindowSize.y - 2.5f, 0);
            NextPrompt.transform.parent    = ThisWindow.WindowContainer.transform;
        }
Ejemplo n.º 9
0
        public int ReadNoEscape()
        {
            if (ThisWindow.ReturnHandler() && Reading)
            {
                Reading = false;
                ClearContent();
                HideWindow();
                return(SelectionIndex);
            }
            else
            {
                if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow))
                {
                    if (SelectionIndex - 1 >= 1)
                    {
                        SelectionIndex--; SelectionPrompt.transform.position += new Vector3(0, 1, 0);
                    }
                    else if (SelectionIndex - 1 < 1)
                    {
                        SelectionIndex = Selections.Count; SelectionPrompt.transform.position += new Vector3(0, (Selections.Count * -1) + 1, 0);
                    }
                }

                if (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow))
                {
                    if (SelectionIndex + 1 <= Selections.Count)
                    {
                        SelectionIndex++; SelectionPrompt.transform.position += new Vector3(0, -1, 0);
                    }
                    else if (SelectionIndex + 1 > Selections.Count)
                    {
                        SelectionIndex = 1; SelectionPrompt.transform.position += new Vector3(0, (Selections.Count * 1) - 1, 0);
                    }
                }
            }

            return(0);
        }
Ejemplo n.º 10
0
 public void connect()
 {
     if (pass != null && name != null)
     {
         UserSet USER = new UserSet();
         USER = ctx.UserSets.SingleOrDefault(u => u.login == name);
         if (USER != null)
         {
             if (USER.password == pass && (Roles(USER) == 1 || Roles(USER) == 2 || Roles(USER) == 3))
             {
                 acceuil acceuil = new acceuil(USER.profile);
                 acceuil.Show();
                 ThisWindow.Close();
                 MahApps.Metro.Controls.MetroWindow window = Window.GetWindow(acceuil) as MahApps.Metro.Controls.MetroWindow;
                 if (window != null)
                 {
                     DateTime dt = DateTime.Today;
                     string   mt = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(dt.Month);
                     window.ShowMessageAsync("Hello " + USER.login, "It is ' " + dt.DayOfWeek + " the " + dt.Day + " of " + mt + " '. ");
                 }
             }
             else
             {
                 MessageBox.Show("Wrong Pass! Please verify");
             }
         }
         else
         {
             MessageBox.Show("User Doesn't Exist ! Please verify");
         }
     }
     else
     {
         MessageBox.Show("Wrong UserName! Please verify");
     }
 }
Ejemplo n.º 11
0
 public void RefreshWindow()
 {
     ThisWindow.RefreshContent(Content);
 }
Ejemplo n.º 12
0
 public void HideWindow()
 {
     Reading = false;
     ThisWindow.HideWindow();
 }
Ejemplo n.º 13
0
 public void ShowWindow()
 {
     ThisWindow.ShowWindow(SelectionLocation);
 }
 public void ShowWindow()
 {
     ThisWindow.ShowWindow(CurrentLocation);
 }