Esempio n. 1
0
        private async void Window_Loaded(object sender, RoutedEventArgs e)
        {
            StartupWindow StartupWindow = new StartupWindow();

            StartupWindow.Owner = this;
            this.ShowInTaskbar  = false;
            StartupWindow.ShowDialog();

            try
            {
                BitmapImage BitmapImage = new BitmapImage();
                BitmapImage.BeginInit();
                BitmapImage.UriSource = new Uri(ServersAvatarImageSource);
                BitmapImage.EndInit();
                ControlAvatarImage.Source = BitmapImage;
            }
            catch { }

            this.Cursor = ((TextBlock)this.Resources["CursorMain"]).Cursor;

            DoubleAnimation OpacityAnimation = new DoubleAnimation();

            OpacityAnimation.From     = this.Opacity;
            OpacityAnimation.To       = 1;
            OpacityAnimation.Duration = TimeSpan.FromSeconds(0.5);
            this.BeginAnimation(Window.OpacityProperty, OpacityAnimation);

            await Task.Delay(500);

            DoubleAnimation HardcoreOpacityAnimation = new DoubleAnimation();

            HardcoreOpacityAnimation.From     = ServersHardcore.Opacity;
            HardcoreOpacityAnimation.To       = 1;
            HardcoreOpacityAnimation.Duration = TimeSpan.FromSeconds(0.5);
            ServersHardcore.BeginAnimation(Border.OpacityProperty, HardcoreOpacityAnimation);

            await Task.Delay(300);

            DoubleAnimation VanillaOpacityAnimation = new DoubleAnimation();

            VanillaOpacityAnimation.From     = ServersVanilla.Opacity;
            VanillaOpacityAnimation.To       = 1;
            VanillaOpacityAnimation.Duration = TimeSpan.FromSeconds(0.5);
            ServersVanilla.BeginAnimation(Border.OpacityProperty, VanillaOpacityAnimation);

            await Task.Delay(300);

            DoubleAnimation MinigamesOpacityAnimation = new DoubleAnimation();

            MinigamesOpacityAnimation.From     = ServersMinigames.Opacity;
            MinigamesOpacityAnimation.To       = 1;
            MinigamesOpacityAnimation.Duration = TimeSpan.FromSeconds(0.5);
            ServersMinigames.BeginAnimation(Border.OpacityProperty, MinigamesOpacityAnimation);

            await Task.Delay(300);

            DoubleAnimation RoleplayOpacityAnimation = new DoubleAnimation();

            RoleplayOpacityAnimation.From     = ServersRoleplay.Opacity;
            RoleplayOpacityAnimation.To       = 1;
            RoleplayOpacityAnimation.Duration = TimeSpan.FromSeconds(0.5);
            ServersRoleplay.BeginAnimation(Border.OpacityProperty, RoleplayOpacityAnimation);

            await Task.Delay(300);

            DoubleAnimation DominationOpacityAnimation = new DoubleAnimation();

            DominationOpacityAnimation.From     = ServersDomination.Opacity;
            DominationOpacityAnimation.To       = 1;
            DominationOpacityAnimation.Duration = TimeSpan.FromSeconds(0.5);
            ServersDomination.BeginAnimation(Border.OpacityProperty, DominationOpacityAnimation);

            await Task.Delay(300);

            DoubleAnimation ClaimOpacityAnimation = new DoubleAnimation();

            ClaimOpacityAnimation.From     = Claim.Opacity;
            ClaimOpacityAnimation.To       = 1;
            ClaimOpacityAnimation.Duration = TimeSpan.FromSeconds(0.5);
            Claim.BeginAnimation(Image.OpacityProperty, ClaimOpacityAnimation);

            await Task.Delay(300);

            DoubleAnimation AdvertisementOpacityAnimation = new DoubleAnimation();

            AdvertisementOpacityAnimation.From     = Advertisement.Opacity;
            AdvertisementOpacityAnimation.To       = 1;
            AdvertisementOpacityAnimation.Duration = TimeSpan.FromSeconds(0.5);
            Advertisement.BeginAnimation(Image.OpacityProperty, AdvertisementOpacityAnimation);

            try
            {
                string[] Nicknames = Directory.GetFiles(TotalPath + @"/Storage/Users");

                foreach (string FileName in Nicknames)
                {
                    string Nickname = System.IO.Path.GetFileName(FileName);
                    ProfileNicknameTextbox.Text = Nickname;
                }
            }
            catch { }

            this.IsEnabled = true;

            await Task.Run(() => OnlineChanger());

            await Task.Run(() => SoundPlayer(TotalPath + @"/Resource/Sounds/pop.mp3"));
        }