container.Visibility = Visibility.Collapsed;
transition.Visibility = Visibility.Visible;
double progress = 0;
//战斗
transition.Source = Global.GetImage(string.Format("Battle/{0}.jpg", Global.RandomSeed.Next(5)));
//实景
ImageBrush real = new ImageBrush() { ImageSource = Screenshot() };
//切换
ImageBrush cutover = new ImageBrush() { ImageSource = Global.GetImage(string.Format("Transition/{0}.jpg", Convert.ToInt32(((ComboBoxItem)comboBox4.SelectedItem).Tag))) };
switch (Convert.ToInt32(((ComboBoxItem)comboBox5.SelectedItem).Tag)) {
case 0:
effect = new Transition_RadialWiggle() { RandomSeed = 0, Texture2 = real, TextureMap = cutover };
progress = 100;
break;
case 1:
effect = new Transition_CloudReveal() { Texture2 = real, TextureMap = cutover };
progress = 50;
break;
case 2:
effect = new Transition_RotateCrumble() { RandomSeed = 0, Texture2 = real, TextureMap = cutover };
progress = 100;
break;
case 3:
effect = new Transition_Blood() { RandomSeed = 0, Texture2 = real, TextureMap = cutover };
progress = 100;
break;
}
transition.Effect = effect;
Storyboard storyboard = new Storyboard();
int easing = Convert.ToInt32(((ComboBoxItem)comboBox6.SelectedItem).Tag);
storyboard.Children.Add(Global.CreateDoubleAnimation(effect, "Progress", 0, progress, TimeSpan.FromMilliseconds(slider1.Value), (easing == 2 null:new PowerEase() { EasingMode = (EasingMode)easing })));
storyboard.Completed += delegate {
Global.SetTimeout(delegate {
container.Visibility = Visibility.Visible;
storyboard = new Storyboard();
storyboard.Children.Add(Global.CreateDoubleAnimation(transition, "Opacity", 1, 0, TimeSpan.FromMilliseconds(600), new PowerEase() { EasingMode = EasingMode.EaseOut }));
storyboard.Completed += delegate {
transition.Opacity = 1;
transition.Visibility = Visibility.Collapsed;
};
storyboard.Begin();
}, 600);
};
storyboard.Begin();
};