private void refreshGalleryOut() { if (this.isShowingCG) { return; } foreach (var btn in this.Canvas_Gallery_ButtonsWarp.Children) { if (btn is Image) { if (((Image)btn).Name.StartsWith("Warp_Gallery_Btn_")) { ((Image)btn).Opacity = 1; } } } this.Canvas_Gallery_ContentWarp.IsHitTestVisible = false; this.GalleryContentWarpSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(this.GalleryContentWarpSprite, new Duration(TimeSpan.FromMilliseconds(300)), 0, 0, cb: (_, __) => { this.Canvas_Gallery_ButtonsWarp.IsHitTestVisible = true; this.Canvas_Gallery_ContentWarp.Visibility = Visibility.Hidden; this.currentGalleryStage = "root"; }); }
private void Art_Image_Preview_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { var image = sender as Image; var row = Grid.GetRow(image) == 2 ? 1 : 0; var col = Grid.GetColumn(image); var isOpened = this.OpenVect[row, col]; if (isOpened) { viewSprite = rm.GetPicture("CG_" + (row * 4 + col + 1) + ".png", ResourceManager.FullImageRect); SpriteDescriptor desc = new SpriteDescriptor() { ResourceType = ResourceType.Pictures }; viewSprite.Descriptor = desc; this.Art_Image_Viewbox.Margin = new Thickness(0, 0, 0, 0); this.RollCounter = 0; this.Art_Image_Viewbox.Source = viewSprite.SpriteBitmapImage; this.Art_Image_Viewbox.Visibility = Visibility.Visible; this.Art_Image_Viewbox.Opacity = 0; desc.ToOpacity = 1; viewSprite.DisplayBinding = viewSprite.AnimationElement = this.Art_Image_Viewbox; SpriteAnimation.OpacityToAnimation(viewSprite, TimeSpan.FromMilliseconds(500), 1); if (GlobalConfigContext.GAME_PERFORMANCE_TYPE == GlobalConfigContext.PerformanceType.HighQuality) { SpriteAnimation.BlurMutexAnimation(canvasSprite, TimeSpan.FromMilliseconds(800), 0, 50); } this.Art_Grid_Controls.IsHitTestVisible = false; } }
public void PrepareOpen() { lock (this) { this.Image_StoryBook_BgTransitor.Source = null; this.Grid_StoryBook.Background = new SolidColorBrush(Colors.Transparent); DecorateSprite.Descriptor.ToOpacity = 1; SpriteAnimation.OpacityToAnimation(DecorateSprite, TimeSpan.FromMilliseconds(300), 1); //SpriteAnimation.BlurMutexAnimation(MainFrameSprite, TimeSpan.FromMilliseconds(300), 0, 30); this.ShowingBackground = false; this.IsStoryBranching = false; this.StackPanel_DialogList.Children.Clear(); BacklogStack.Clear(); IntentBacklog = null; // 检查回调标志位 //CallbackTarget = SymbolTable.GetInstance().GlobalCtxDao.GlobalSymbolTable.Fetch("tracing_callback").ToString(); // 从全局变量挑选故事载入 //var trace_idx = Convert.ToInt32(SymbolTable.GetInstance().GlobalCtxDao.GlobalSymbolTable.Fetch("tracing_idx")); PendingMessageQueue = this.ReloadTraceStory(0); if (PendingMessageQueue == null) { LogUtils.LogLine("Load tracing story, but NULL", "LongStoryPage", LogLevel.Warning); this.PrepareClose(); return; } LongStoryPage.IsStoryBooking = true; CurrentMessageQueue = PendingMessageQueue.Dequeue(); // 主动调用一次左键 this.StoryBookForwardNextSteady(); } }
public void PrepareClose() { lock (this) { DecorateSprite.Descriptor.ToOpacity = 0; BgTransitorSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(DecorateSprite, TimeSpan.FromMilliseconds(500), 0); SpriteAnimation.OpacityToAnimation(BgTransitorSprite, TimeSpan.FromMilliseconds(500), 0); //SpriteAnimation.BlurMutexAnimation(MainFrameSprite, TimeSpan.FromMilliseconds(500), 30, 0); this.parent.onBonusExit(); } //LongStoryPage.IsStoryBooking = false; //PersistContextDAO.Assign("Callback_tracing_chosen", ChosenDescriptor); //if (CallbackTarget != String.Empty) //{ // var callbackNtr = new Interrupt() // { // Detail = "StoryBookCallbackNTR", // InterruptSA = null, // Type = InterruptType.ButtonJump, // ReturnTarget = CallbackTarget, // ExitWait = true // }; // // 提交回到中断到主调用堆栈 // Director.RunMana.CallStack.Submit(callbackNtr); // // 重置回调 // CallbackTarget = String.Empty; // Director.RunMana.Symbols.GlobalCtxDao.GlobalSymbolTable.Assign("tracing_callback", String.Empty); //} //ViewPageManager.CollapseUIPage(); }
private void BlackAnimationBeforeLeave(StartPageExitAniCallback exitCb) { this.MaskSprite.DisplayBinding.Visibility = Visibility.Visible; this.MaskSprite.Descriptor.ToOpacity = 1; SpriteAnimation.OpacityToAnimation(this.MaskSprite, new Duration(TimeSpan.FromMilliseconds(1000)), 1, 0, cb: (_, __) => { exitCb?.Invoke(); }); }
private void Image_Button_Backlog_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { this.LoadBacklogItems(); this.Scroll_BacklogBoxing.ScrollToEnd(); this.LoadSubTitle("Backlog"); this.BacklogStackSprite.Descriptor.ToOpacity = 1; SpriteAnimation.OpacityToAnimation(this.BacklogStackSprite, new Duration(TimeSpan.FromMilliseconds(250)), 1, 0); this.IntoSubModuleAnimation((tSender, tArgs) => { this.currentStaging = "backlog"; }); }
private void Image_Button_Settings_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { this.LoadSubTitle("Settings"); this.SettingsPageSprite.DisplayBinding.Visibility = Visibility.Visible; this.SettingsPageSprite.Descriptor.ToOpacity = 1; SpriteAnimation.OpacityToAnimation(this.SettingsPageSprite, new Duration(TimeSpan.FromMilliseconds(250)), 1, 0); this.IntoSubModuleAnimation((tSender, tArgs) => { this.currentStaging = "settings"; }); ((LHSettingsPage)this.Frame_Settings.Content).WhenInto(); }
private void Image_ArtDisplayer_MouseDown(object sender, MouseButtonEventArgs e) { if (e.LeftButton == MouseButtonState.Pressed) { this.Image_Art_Displayer.IsHitTestVisible = false; this.GalleryArtSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(this.GalleryArtSprite, TimeSpan.FromMilliseconds(300), 0, 0, cb: (_, __) => { this.Image_Art_Displayer.Visibility = Visibility.Hidden; this.Canvas_ArtItem_Warp.IsHitTestVisible = true; this.isShowingCG = false; }); } }
public void PrepareOpen() { this.currentStaging = "root"; this.isResumingFromLoad = false; this.IsFromAutoChanged = false; this.IsFromReturnTitle = false; this.Image_Button_Auto.Visibility = Visibility.Visible; this.CanvasGroup_EnsureMask.Visibility = Visibility.Hidden; // 检查回调标志位 CallbackTarget = SymbolTable.GetInstance().GlobalCtxDao.GlobalSymbolTable.Fetch("tracing_callback").ToString(); this.EpisodeHint = SymbolTable.GetInstance().GlobalCtxDao.GlobalSymbolTable.Fetch("gb_episode_hint")?.ToString(); this.EpisodeNameHint = SymbolTable.GetInstance().GlobalCtxDao.GlobalSymbolTable.Fetch("gb_episode_name_hint")?.ToString(); this.ReopenTs = DateTime.Now; this.Label_Hint_Episode.Content = this.EpisodeHint; this.Label_Hint_EpName.Content = this.EpisodeNameHint; Storyboard startupSb = new Storyboard(); this.PanelSprite.Descriptor.ToX = 1762; SpriteAnimation.XMoveToAnimation(this.PanelSprite, new Duration(TimeSpan.FromMilliseconds(300)), 1762, -0.8, providedStory: startupSb); this.NameLogoSprite.Descriptor.ToOpacity = 1; SpriteAnimation.OpacityToAnimation(this.NameLogoSprite, new Duration(TimeSpan.FromMilliseconds(300)), 1, 0, providedStory: startupSb); this.EpisodeHintSprite.Descriptor.ToOpacity = 1; SpriteAnimation.OpacityToAnimation(this.EpisodeHintSprite, new Duration(TimeSpan.FromMilliseconds(300)), 1, 0, providedStory: startupSb); this.ButtonGroupSprite.Descriptor.ToOpacity = 1; this.ButtonGroupSprite.Descriptor.ToY = 1080 / 2; SpriteAnimation.OpacityToAnimation(this.ButtonGroupSprite, new Duration(TimeSpan.FromMilliseconds(300)), 1, 0, providedStory: startupSb); SpriteAnimation.YMoveToAnimation(this.ButtonGroupSprite, new Duration(TimeSpan.FromMilliseconds(300)), 1080 / 2, -0.8, providedStory: startupSb); SpriteAnimation.BlurMutexAnimation(this.MainStageSprite, TimeSpan.FromMilliseconds(300), 0, 30, providedStory: startupSb); this.currentStaging = "root"; startupSb.Completed += (_, __) => { this.IsAllowClose = true; }; if (this.core.GetMainRender().IsBranching) { this.Image_Button_Auto.Visibility = Visibility.Hidden; } startupSb.Begin(); }
private void transitToGalleryPanel(bool withWindow) { this.GalleryContentWarpSprite.DisplayBinding.Visibility = Visibility.Hidden; this.GalleryContentWarpSprite.DisplayBinding.IsHitTestVisible = false; this.Grid_WarpHolder.IsHitTestVisible = false; this.Canvas_Gallery.Visibility = Visibility.Visible; this.Canvas_Gallery.IsHitTestVisible = false; this.GalleryContentWarpSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(this.GalleryContentWarpSprite, new Duration(TimeSpan.Zero), 0, 0); this.GalleryWarpSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(this.GalleryWarpSprite, new Duration(TimeSpan.Zero), 0, 0); Storyboard sb = new Storyboard(); if (withWindow) { this.BackGroundSprite.Descriptor.ToScaleX = 1.2; this.BackGroundSprite.Descriptor.ToScaleY = 1.2; this.BackGroundSprite.Descriptor.ToOpacity = 0; SpriteAnimation.ScaleToAnimation(this.BackGroundSprite, new Duration(TimeSpan.FromMilliseconds(300)), 1.2, 1.2, 0.6, 0.6, providedStory: sb); SpriteAnimation.OpacityToAnimation(this.BackGroundSprite, new Duration(TimeSpan.FromMilliseconds(300)), 0, 0.6, providedStory: sb); } this.ForeGroundSprite.Descriptor.ToScaleX = 1.4; this.ForeGroundSprite.Descriptor.ToScaleY = 1.4; this.ForeGroundSprite.Descriptor.ToOpacity = 0; SpriteAnimation.ScaleToAnimation(this.ForeGroundSprite, new Duration(TimeSpan.FromMilliseconds(300)), 1.4, 1.4, 0.6, 0.6, providedStory: sb); SpriteAnimation.OpacityToAnimation(this.ForeGroundSprite, new Duration(TimeSpan.FromMilliseconds(300)), 0, 0.6, providedStory: sb); SpriteAnimation.BlurMutexAnimation(this.ForeGroundSprite, new Duration(TimeSpan.FromMilliseconds(300)), 0, 20, providedStory: sb); this.RootButtonSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(this.RootButtonSprite, new Duration(TimeSpan.FromMilliseconds(300)), 0, 0.6, providedStory: sb); this.GalleryWarpSprite.Descriptor.ToOpacity = 1; SpriteAnimation.OpacityToAnimation(this.GalleryWarpSprite, new Duration(TimeSpan.FromMilliseconds(300)), 1, -0.6, providedStory: sb); sb.Completed += (_, __) => { this.currentSubStage = "gallery"; this.Canvas_Gallery.IsHitTestVisible = true; }; sb.Begin(); }
private void Image_ArtItem_MouseDown(object sender, MouseButtonEventArgs e) { var name = ((Image)sender).Name; var cgName = name.Replace("Image_", "") + ".png"; var cg = ResourceManager.GetInstance().GetPicture(cgName, ResourceManager.FullImageRect); this.Image_Art_Displayer.Source = cg.SpriteBitmapImage; this.Image_Art_Displayer.Visibility = Visibility.Visible; this.isShowingCG = true; this.Canvas_ArtItem_Warp.IsHitTestVisible = false; this.Image_Art_Displayer.IsHitTestVisible = false; this.GalleryArtSprite.Descriptor.ToOpacity = 1; SpriteAnimation.OpacityToAnimation(this.GalleryArtSprite, TimeSpan.FromMilliseconds(300), 1, 0, cb: (_, __) => { this.Image_Art_Displayer.IsHitTestVisible = true; }); }
private void LoadSubTitle(string subTitle) { string sourcePath = "Rclick_SubTitle_" + subTitle + ".png"; BitmapImage rotating; if (this.cachingButtons.ContainsKey(sourcePath)) { rotating = this.cachingButtons[sourcePath]; } else { rotating = resMana.GetPicture(sourcePath, ResourceManager.FullImageRect).SpriteBitmapImage; this.cachingButtons[sourcePath] = rotating; } ((Image)this.SubTitleSprite.DisplayBinding).Source = rotating; this.SubTitleSprite.Descriptor.ToOpacity = 1; SpriteAnimation.OpacityToAnimation(this.SubTitleSprite, new Duration(TimeSpan.FromMilliseconds(200)), 1, 0); }
private void Page_MouseRightButtonUp(object sender, MouseButtonEventArgs e) { if (!this.ShowingBackground) { DecorateSprite.Descriptor.ToOpacity = 0; DialogueSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(DecorateSprite, TimeSpan.FromMilliseconds(200), 0); SpriteAnimation.OpacityToAnimation(DialogueSprite, TimeSpan.FromMilliseconds(200), 0); //SpriteAnimation.BlurMutexAnimation(MainFrameSprite, TimeSpan.FromMilliseconds(200), 30, 0); } else { DecorateSprite.Descriptor.ToOpacity = 1; DialogueSprite.Descriptor.ToOpacity = 1; SpriteAnimation.OpacityToAnimation(DecorateSprite, TimeSpan.FromMilliseconds(100), 1); SpriteAnimation.OpacityToAnimation(DialogueSprite, TimeSpan.FromMilliseconds(100), 1); //SpriteAnimation.BlurMutexAnimation(MainFrameSprite, TimeSpan.FromMilliseconds(100), 0, 30); } this.ShowingBackground = !this.ShowingBackground; }
private void Image_Load_Button_Back_MouseDown(object sender, MouseButtonEventArgs e) { this.Frame_SaveLoad.IsHitTestVisible = false; this.WarpedPageSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(this.WarpedPageSprite, new Duration(TimeSpan.FromMilliseconds(200)), 0, 0, cb: (_, __) => { this.Frame_SaveLoad.IsHitTestVisible = false; this.WarpedPageSprite.DisplayBinding.Visibility = Visibility.Hidden; this.currentSubStage = "root"; this.Grid_WarpHolder.IsHitTestVisible = true; }); switch (this.currentSubStage) { case "load": ((LHSaveLoadPage)this.Frame_SaveLoad.Content).WhenLeave(); break; case "settings": ((LHSettingsPage)this.Frame_Settings.Content).WhenLeave(); break; } }
private void ReturnSubModuleAnimation(SpriteAnimation.SpriteAnimationCallback callback) { Storyboard sb = new Storyboard(); this.PanelSprite.Descriptor.ToX = 1761; SpriteAnimation.XMoveToAnimation(this.PanelSprite, new Duration(TimeSpan.FromMilliseconds(200)), 1761, -0.8, providedStory: sb); this.WhitePanelSprite.Descriptor.ToX = 1920 + 1920 / 2; SpriteAnimation.XMoveToAnimation(this.WhitePanelSprite, new Duration(TimeSpan.FromMilliseconds(200)), 1920 + 1920 / 2, -0.8, providedStory: sb); this.ButtonGroupSprite.Descriptor.ToOpacity = 1; this.ButtonGroupSprite.Descriptor.ToY = 1080 / 2; SpriteAnimation.OpacityToAnimation(this.ButtonGroupSprite, new Duration(TimeSpan.FromMilliseconds(200)), 1, 0, providedStory: sb); SpriteAnimation.YMoveToAnimation(this.ButtonGroupSprite, new Duration(TimeSpan.FromMilliseconds(200)), 1080 / 2, -0.8, (_, __) => { this.ButtonGroupSprite.DisplayBinding.IsHitTestVisible = true; }, providedStory: sb); this.CommonBackButtonSprite.DisplayBinding.IsHitTestVisible = false; this.CommonBackButtonSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(this.CommonBackButtonSprite, new Duration(TimeSpan.FromMilliseconds(200)), 0, 0, providedStory: sb); this.EpisodeHintSprite.Descriptor.ToOpacity = 1; SpriteAnimation.OpacityToAnimation(this.EpisodeHintSprite, new Duration(TimeSpan.FromMilliseconds(300)), 1, 0, providedStory: sb); sb.Completed += (_, __) => callback?.Invoke(_, __); sb.Begin(); }
private void HandleBackward(SpriteAnimation.SpriteAnimationCallback callback) { switch (this.currentStaging) { case "backlog": this.BacklogStackSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(this.BacklogStackSprite, new Duration(TimeSpan.FromMilliseconds(100)), 0, 0, cb: (_, __) => { this.StackPanel_Backlog_MainStack.Children.Clear(); }); break; case "save": case "load": var shouldExit = ((LHSaveLoadPage)this.Frame_SaveLoad.Content).WhenLeave(); if (!shouldExit) { return; } this.SaveLoadPageSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(this.SaveLoadPageSprite, new Duration(TimeSpan.FromMilliseconds(100)), 0, 0, cb: (_, __) => { this.SaveLoadPageSprite.DisplayBinding.Visibility = Visibility.Hidden; }); break; case "settings": ((LHSettingsPage)this.Frame_Settings.Content).WhenLeave(); this.SettingsPageSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(this.SettingsPageSprite, new Duration(TimeSpan.FromMilliseconds(100)), 0, 0, cb: (_, __) => { this.SettingsPageSprite.DisplayBinding.Visibility = Visibility.Hidden; }); break; } this.SubTitleSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(this.SubTitleSprite, new Duration(TimeSpan.FromMilliseconds(100)), 0, 0); this.ReturnSubModuleAnimation(callback); }
private void transitTab(string fromTab, string toTab) { YuriSprite fromSprite = null; YuriSprite toSprite = null; switch (fromTab) { case "Graphic": fromSprite = this.GrahpicTabSprite; break; case "Voice": fromSprite = this.VoiceTabSprite; break; case "Keyboard": fromSprite = this.KeyboardTabSprite; break; case "Others": fromSprite = this.OthersTabSprite; break; } switch (toTab) { case "Graphic": toSprite = this.GrahpicTabSprite; break; case "Voice": toSprite = this.VoiceTabSprite; break; case "Keyboard": toSprite = this.KeyboardTabSprite; break; case "Others": toSprite = this.OthersTabSprite; break; } this.Canvas_SettingsRoot.IsHitTestVisible = false; toSprite.DisplayBinding.Visibility = Visibility.Visible; toSprite.Descriptor.ToX = 1920 / 2 + 100; toSprite.Descriptor.ToOpacity = 0; SpriteAnimation.XMoveToAnimation(toSprite, new Duration(TimeSpan.FromMilliseconds(0)), toSprite.Descriptor.ToX, 0, null); SpriteAnimation.OpacityToAnimation(toSprite, new Duration(TimeSpan.FromMilliseconds(0)), 0, 0, null); Storyboard sb = new Storyboard(); fromSprite.Descriptor.ToX = 1920 / 2 - 100; fromSprite.Descriptor.ToOpacity = 0; toSprite.Descriptor.ToX = 1920 / 2; toSprite.Descriptor.ToOpacity = 1; SpriteAnimation.XMoveToAnimation(fromSprite, new Duration(TimeSpan.FromMilliseconds(200)), fromSprite.Descriptor.ToX, -0.6, null, providedStory: sb); SpriteAnimation.XMoveToAnimation(toSprite, new Duration(TimeSpan.FromMilliseconds(200)), toSprite.Descriptor.ToX, -0.6, null, providedStory: sb); SpriteAnimation.OpacityToAnimation(fromSprite, new Duration(TimeSpan.FromMilliseconds(200)), 0, 0, null, providedStory: sb); SpriteAnimation.OpacityToAnimation(toSprite, new Duration(TimeSpan.FromMilliseconds(200)), 1, 0, null, providedStory: sb); sb.Completed += (_, __) => { this.Canvas_SettingsRoot.IsHitTestVisible = true; fromSprite.DisplayBinding.Visibility = Visibility.Hidden; }; sb.Begin(); }
public void StoryBookForwardNextSteady() { // 如果在看背景就先切回故事模式 if (this.ShowingBackground) { DecorateSprite.Descriptor.ToOpacity = 1; DialogueSprite.Descriptor.ToOpacity = 1; SpriteAnimation.OpacityToAnimation(DecorateSprite, TimeSpan.FromMilliseconds(100), 1); SpriteAnimation.OpacityToAnimation(DialogueSprite, TimeSpan.FromMilliseconds(100), 1); //SpriteAnimation.BlurMutexAnimation(MainFrameSprite, TimeSpan.FromMilliseconds(100), 0, 30); this.ShowingBackground = false; return; } // 选择项就忽略 if (this.IsStoryBranching) { return; } // 打字动画中就跳过 if (MsgStoryboard != null) { lock (MsgStoryboard) { if (MsgStoryboard != null) { MsgStoryboard.SkipToFill(); return; } } } // 瞄下队列头,是否是空队列,是的话说明要换页 if (CurrentMessageQueue.Count == 0) { // 全部都结束啦 if (PendingMessageQueue.Count == 0) { this.PrepareClose(); return; } this.StackPanel_DialogList.Children.Clear(); CurrentMessageQueue = PendingMessageQueue.Dequeue(); if (IntentBacklog != null) { BacklogStack.Push(IntentBacklog); } IntentBacklog = ForkableState.DeepCopyBySerialization(CurrentMessageQueue); } // 取下一条要显示的内容 var currentRun = CurrentMessageQueue.Dequeue(); // 选择支:SELECT@分支1@分支2@... if (currentRun.StartsWith("SELECT@")) { var selectionItem = currentRun.Split('@'); var insertBlock = new TextBlock { Opacity = 1, Margin = new Thickness(10, 16, 10, 50), TextWrapping = TextWrapping.Wrap, Foreground = new SolidColorBrush(Colors.White), FontSize = 30, FontFamily = new FontFamily(new Uri("pack://application:,,,/"), "Resources/#Source Han Serif CN SemiBold"), Text = selectionItem[1] }; this.StackPanel_DialogList.Children.Add(insertBlock); for (var i = 2; i < selectionItem.Length; i++) { var selectionLable = new Label { Background = new SolidColorBrush(Color.FromArgb(70, 0, 0, 0)), Margin = new Thickness(10, 80, 10, 0), Foreground = new SolidColorBrush(Colors.White), Height = 60, FontSize = 30, FontFamily = new FontFamily(new Uri("pack://application:,,,/"), "Resources/#Source Han Serif CN SemiBold"), HorizontalContentAlignment = HorizontalAlignment.Center, VerticalContentAlignment = VerticalAlignment.Center, Content = selectionItem[i], Tag = i.ToString() }; selectionLable.MouseEnter += this.Selection_OnMouseEnter; selectionLable.MouseLeave += this.Selection_OnMouseLeave; selectionLable.MouseLeftButtonUp += this.Selection_OnMouseLeftButtonUp; this.StackPanel_DialogList.Children.Add(selectionLable); } this.IsStoryBranching = true; } // 背景:BG@变换时间@图片资源名 else if (currentRun.StartsWith("BG@")) { var selectionItem = currentRun.Split('@'); var bgTransformTime = Convert.ToInt32(selectionItem[1]); var bgResourceName = selectionItem[2]; if (bgResourceName != String.Empty) { // backlay if (this.Image_StoryBook_BgTransitor.Source == null) { this.Grid_StoryBook.Background = new SolidColorBrush(Colors.Transparent); } else { this.Grid_StoryBook.Background = new ImageBrush(this.Image_StoryBook_BgTransitor.Source); } BgTransitorSprite.Descriptor.Opacity = 0; BgTransitorSprite.DisplayBinding.Opacity = 0; this.Image_StoryBook_BgTransitor.Source = resMana.GetPicture(bgResourceName, ResourceManager.FullImageRect).SpriteBitmapImage; BgTransitorSprite.Descriptor.ToOpacity = 1; SpriteAnimation.OpacityToAnimation(BgTransitorSprite, TimeSpan.FromMilliseconds(bgTransformTime), 1); } else { this.Grid_StoryBook.Background = new SolidColorBrush(Colors.Transparent); BgTransitorSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(BgTransitorSprite, TimeSpan.FromMilliseconds(bgTransformTime), 0); } this.StoryBookForwardNextSteady(); } // 声效:SE@音量@SE资源名 else if (currentRun.StartsWith("SE@")) { var selectionItem = currentRun.Split('@'); var volume = Convert.ToDouble(selectionItem[1]); Musician.GetInstance().PlaySE(resMana.GetSE(selectionItem[2]), (float)volume); this.StoryBookForwardNextSteady(); } else { var dialogItem = currentRun.Split('@'); var fgColor = Colors.White; if (dialogItem.Length > 1) { if (CharacterColorDict.ContainsKey(dialogItem[0])) { fgColor = CharacterColorDict[dialogItem[0]]; } currentRun = dialogItem[1]; } var insertBlock = new TextBlock { Opacity = 1, Margin = new Thickness(10, 16, 10, 10), TextWrapping = TextWrapping.Wrap, Foreground = new SolidColorBrush(fgColor), FontSize = 30, FontFamily = new FontFamily(new Uri("pack://application:,,,/"), "Resources/#Source Han Serif CN SemiBold"), Text = String.Empty }; // 把前一条内容透明化 if (this.StackPanel_DialogList.Children.Count > 0) { var lastMsgBlock = this.StackPanel_DialogList.Children[this.StackPanel_DialogList.Children.Count - 1] as TextBlock; var OpacingDescriptor = new YuriSprite() { DisplayBinding = lastMsgBlock, AnimationElement = lastMsgBlock, Descriptor = new SpriteDescriptor() }; OpacingDescriptor.Descriptor.ToOpacity = 0.4; SpriteAnimation.OpacityToAnimation(OpacingDescriptor, TimeSpan.FromMilliseconds(500), 0.4); } this.StackPanel_DialogList.Children.Add(insertBlock); this.TypeWriter(String.Empty, currentRun, insertBlock, GlobalConfigContext.GAME_MSG_TYPING_DELAY); } }
private void refreshGalleryInto(string type) { lock (this) { if (this.isGalleryAnimating) { return; } this.isGalleryAnimating = true; } this.Canvas_Gallery_ButtonsWarp.IsHitTestVisible = false; foreach (var wrapper in this.Canvas_Gallery_ContentWarp.Children) { if (wrapper is Canvas) { var wrapperCanvas = (Canvas)wrapper; if (wrapperCanvas.Name.EndsWith("_Wrapper")) { if (wrapperCanvas.Name == ("Canvas_Gallery_" + type + "_Wrapper")) { wrapperCanvas.Visibility = Visibility.Visible; wrapperCanvas.Opacity = 1; } else { wrapperCanvas.Visibility = Visibility.Hidden; wrapperCanvas.Opacity = 0; } } } } foreach (var btn in this.Canvas_Gallery_ButtonsWarp.Children) { if (btn is Image) { if (((Image)btn).Name.StartsWith("Warp_Gallery_Btn_") && ((Image)btn).Name != ("Warp_Gallery_Btn_" + type)) { ((Image)btn).Opacity = 0.3; } } } // 进入刷新的具体逻辑 switch (type) { case "EDCard": var loopEndFool = (double)PersistContextDAO.Fetch("loop_end_fool") > 0; if (loopEndFool) { var endPath = this.Image_Gallery_EDCard_FoolEnd.Source.ToString(); if (endPath.EndsWith("NoOpen.png")) { endPath = endPath.Replace("NoOpen.png", "FoolEnd.png"); BitmapImage endRotating; endRotating = new BitmapImage(); endRotating.BeginInit(); endRotating.UriSource = new Uri(endPath); endRotating.EndInit(); this.Image_Gallery_EDCard_FoolEnd.Source = endRotating; } } var loopBadBad = (double)PersistContextDAO.Fetch("loop_end_bad") > 0; if (loopBadBad) { var endPath = this.Image_Gallery_EDCard_BadEnd.Source.ToString(); if (endPath.EndsWith("NoOpen.png")) { endPath = endPath.Replace("NoOpen.png", "BadEnd.png"); BitmapImage endRotating; endRotating = new BitmapImage(); endRotating.BeginInit(); endRotating.UriSource = new Uri(endPath); endRotating.EndInit(); this.Image_Gallery_EDCard_BadEnd.Source = endRotating; } } var loopEndNormal = (double)PersistContextDAO.Fetch("loop_end_normal") > 0; if (loopEndNormal) { var endPath = this.Image_Gallery_EDCard_NormalEnd.Source.ToString(); if (endPath.EndsWith("NoOpen.png")) { endPath = endPath.Replace("NoOpen.png", "NormalEnd.png"); BitmapImage endRotating; endRotating = new BitmapImage(); endRotating.BeginInit(); endRotating.UriSource = new Uri(endPath); endRotating.EndInit(); this.Image_Gallery_EDCard_NormalEnd.Source = endRotating; } } var loopEndTrue = (double)PersistContextDAO.Fetch("loop_end_true") > 0; if (loopEndTrue) { var endPath = this.Image_Gallery_EDCard_TrueEnd.Source.ToString(); if (endPath.EndsWith("NoOpen.png")) { endPath = endPath.Replace("NoOpen.png", "TrueEnd.png"); BitmapImage endRotating; endRotating = new BitmapImage(); endRotating.BeginInit(); endRotating.UriSource = new Uri(endPath); endRotating.EndInit(); this.Image_Gallery_EDCard_TrueEnd.Source = endRotating; } } string loopTimesStr; try { var loopTimes = PersistContextDAO.Fetch("Game_LoopTime"); int loopTimeRaw = Convert.ToInt32(loopTimes); if (loopTimeRaw >= 100) { loopTimesStr = "99+"; } else { loopTimesStr = loopTimeRaw.ToString(); } } catch (Exception e) { loopTimesStr = "N/A"; } this.Label_Gallery_EDCard_LoopTime_Hint.Content = $"通关次数:{loopTimesStr}"; string accTimesStr; try { TimeSpan accTimes = (TimeSpan)PersistContextDAO.Fetch("___YURIRI@ACCDURATION___"); accTimesStr = ""; if (accTimes.Days != 0) { accTimesStr += accTimes.Days + "天"; } if (accTimes.Hours != 0) { accTimesStr += accTimes.Hours + "小时"; } accTimesStr += accTimes.Minutes + "分钟"; } catch (Exception e) { accTimesStr = "N/A"; } this.Label_Gallery_EDCard_AccTime_Hint.Content = $"累计时长:{accTimesStr}"; break; case "Music": this.RefreshMusicPlayingStatus(); break; case "Bonus": try { ((LongStoryPage)this.Frame_BonusStory.Content).PrepareOpen(); } catch (Exception e) { LogUtils.LogLine("cannot open bonus long story page, " + e.ToString(), nameof(LHStartPage), LogLevel.Error); } break; default: break; } this.GalleryContentWarpSprite.DisplayBinding.Visibility = Visibility.Visible; this.GalleryContentWarpSprite.DisplayBinding.IsHitTestVisible = false; this.GalleryContentWarpSprite.Descriptor.ToOpacity = 1; SpriteAnimation.OpacityToAnimation(this.GalleryContentWarpSprite, new Duration(TimeSpan.FromMilliseconds(300)), 1, 0, cb: (_, __) => { this.GalleryContentWarpSprite.DisplayBinding.IsHitTestVisible = true; this.currentGalleryStage = type; this.isGalleryAnimating = false; }); }
private void Warp_Btn_MouseDown(object sender, MouseButtonEventArgs e) { if (e.LeftButton == MouseButtonState.Pressed) { switch (((Image)sender).Name) { case "Warp_Btn_Exit": this.CanvasGroup_EnsureMask.Visibility = Visibility.Visible; break; case "Warp_Btn_Load": case "Warp_Btn_Settings": this.Grid_WarpHolder.IsHitTestVisible = false; if (((Image)sender).Name == "Warp_Btn_Load") { ((LHSaveLoadPage)this.Frame_SaveLoad.Content).CurrentStaging = "load"; this.Frame_SaveLoad.Visibility = Visibility.Visible; this.Frame_Settings.Visibility = Visibility.Hidden; this.refreshTitleSubHead("load"); } else if (((Image)sender).Name == "Warp_Btn_Settings") { this.Frame_SaveLoad.Visibility = Visibility.Hidden; this.Frame_Settings.Visibility = Visibility.Visible; this.refreshTitleSubHead("settings"); } this.WarpedPageSprite.DisplayBinding.Visibility = Visibility.Visible; this.WarpedPageSprite.Descriptor.ToOpacity = 1; SpriteAnimation.OpacityToAnimation(this.WarpedPageSprite, new Duration(TimeSpan.FromMilliseconds(300)), 1, 0, cb: (_, __) => { if (((Image)sender).Name == "Warp_Btn_Load") { this.Frame_SaveLoad.IsHitTestVisible = true; } else if (((Image)sender).Name == "Warp_Btn_Settings") { this.Frame_Settings.IsHitTestVisible = true; } this.currentSubStage = ((Image)sender).Name.Replace("Warp_Btn_", "").ToLower(); }); if (((Image)sender).Name == "Warp_Btn_Load") { ((LHSaveLoadPage)this.Frame_SaveLoad.Content).WhenInto(); } else if (((Image)sender).Name == "Warp_Btn_Settings") { ((LHSettingsPage)this.Frame_Settings.Content).WhenInto(); } break; case "Warp_Btn_Start": this.Grid_WarpHolder.IsHitTestVisible = false; this.BlackAnimationBeforeLeave(() => this.PrepareClose()); break; case "Warp_Btn_Gallery": this.transitToGalleryPanel(true); break; case "Warp_Gallery_Btn_Back": this.transitBackToRoot(true); break; case "Warp_Gallery_Btn_Staff": this.refreshGalleryInto("Staff"); break; case "Warp_Gallery_Btn_EDCard": this.refreshGalleryInto("EDCard"); break; case "Warp_Gallery_Btn_Music": this.refreshGalleryInto("Music"); break; case "Warp_Gallery_Btn_Art": this.refreshGalleryInto("Art"); break; case "Warp_Gallery_Btn_Bonus": this.refreshGalleryInto("Bonus"); break; default: break; } } }
public void PrepareOpen() { ((LHSettingsPage)this.Frame_Settings.Content).RefreshSteadyConfig(); this.currentSubStage = "root"; this.titlePlayingBGM = "2"; this.isLoading = false; this.isTrueEndArrival = (double)PersistContextDAO.Fetch("Game_EndArrival_TE") > 0; this.Warp_Btn_Gallery.Visibility = this.isTrueEndArrival ? Visibility.Visible : Visibility.Hidden; if (isTrueEndArrival) { this.Art_Image_Background_Window.Source = new BitmapImage(new Uri("pack://application:,,,/Yuri;component/Resources/Title_Ground_T2_bg2.png")); this.Art_Image_Fore.Source = new BitmapImage(new Uri("pack://application:,,,/Yuri;component/Resources/Title_Ground_T2_fore.png")); this.Warp_Image_Title.Source = new BitmapImage(new Uri("pack://application:,,,/Yuri;component/Resources/Title_Logo_2.png")); } string titleType = PersistContextDAO.Fetch("system_config_title_type")?.ToString(); if (titleType == "0") { PersistContextDAO.Assign("system_config_title_type", "Timing"); titleType = "Timing"; } if (false == isTrueEndArrival) { String cloudSourcePath; if (((DateTime.Now.Hour >= 5 && DateTime.Now.Hour < 17) || titleType != "Timing")) { cloudSourcePath = ((Image)this.Art_Image_Background_Cloud_1).Source.ToString(); if (cloudSourcePath.EndsWith("_sunset.png")) { cloudSourcePath = cloudSourcePath.Replace("_sunset.png", ".png"); } } else { cloudSourcePath = ((Image)this.Art_Image_Background_Cloud_1).Source.ToString(); if (!cloudSourcePath.EndsWith("_sunset.png")) { cloudSourcePath = cloudSourcePath.Replace(".png", "_sunset.png"); } } BitmapImage rotating; if (this.cachingButtons.ContainsKey(cloudSourcePath)) { rotating = this.cachingButtons[cloudSourcePath]; } else { rotating = new BitmapImage(); rotating.BeginInit(); rotating.UriSource = new Uri(cloudSourcePath); rotating.EndInit(); this.cachingButtons[cloudSourcePath] = rotating; } ((Image)Art_Image_Background_Cloud_1).Source = rotating; ((Image)Art_Image_Background_Cloud_2).Source = rotating; ((Image)Art_Image_Background_Cloud_Static).Source = null; } else { ((Image)Art_Image_Background_Cloud_1).Source = new BitmapImage(new Uri("pack://application:,,,/Yuri;component/Resources/Title_Ground_TE_float.png")); ((Image)Art_Image_Background_Cloud_2).Source = new BitmapImage(new Uri("pack://application:,,,/Yuri;component/Resources/Title_Ground_TE_float.png")); ((Image)Art_Image_Background_Cloud_Static).Source = new BitmapImage(new Uri("pack://application:,,,/Yuri;component/Resources/Title_Ground_TE_bg.png")); } callbackTarget = SymbolTable.GetInstance().GlobalCtxDao.GlobalSymbolTable.Fetch("tracing_callback").ToString(); this.BackGroundSprite.Descriptor.ToScaleX = 1.2; this.BackGroundSprite.Descriptor.ToScaleY = 1.2; this.BackGroundSprite.Descriptor.ToOpacity = 0; SpriteAnimation.ScaleToAnimation(this.BackGroundSprite, new Duration(TimeSpan.FromMilliseconds(0)), 1.2, 1.2, 0, 0); SpriteAnimation.OpacityToAnimation(this.BackGroundSprite, new Duration(TimeSpan.FromMilliseconds(0)), 0, 0); this.CloudSpriteA.Descriptor.ToX = 1920 / 2; this.CloudSpriteB.Descriptor.ToX = 1920 * 1.5; SpriteAnimation.XMoveToAnimation(this.CloudSpriteA, new Duration(TimeSpan.FromSeconds(0)), 1920 / 2, 0); SpriteAnimation.XMoveToAnimation(this.CloudSpriteB, new Duration(TimeSpan.FromSeconds(0)), 1920 * 1.5, 0); this.RootButtonSprite.Descriptor.ToOpacity = 1; SpriteAnimation.OpacityToAnimation(this.RootButtonSprite, new Duration(TimeSpan.FromMilliseconds(0)), 0, 0); this.UiSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(this.UiSprite, new Duration(TimeSpan.FromMilliseconds(0)), 0, 0); this.CloudHolderSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(this.CloudHolderSprite, new Duration(TimeSpan.FromMilliseconds(0)), 0, 0); this.MaskSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(this.MaskSprite, new Duration(TimeSpan.FromMilliseconds(0)), 0, 0); this.MaskSprite.DisplayBinding.Visibility = Visibility.Hidden; this.GalleryWarpSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(this.GalleryWarpSprite, new Duration(TimeSpan.FromMilliseconds(0)), 0, 0); this.Canvas_Gallery.Visibility = Visibility.Hidden; this.BackGroundSprite.Descriptor.ToScaleX = 1.0; this.BackGroundSprite.Descriptor.ToScaleY = 1.0; this.BackGroundSprite.Descriptor.ToOpacity = 1; SpriteAnimation.ScaleToAnimation(this.BackGroundSprite, new Duration(TimeSpan.FromMilliseconds(1000)), 1.0, 1.0, -0.7, -0.7); SpriteAnimation.OpacityToAnimation(this.BackGroundSprite, new Duration(TimeSpan.FromMilliseconds(500)), 1, -0.6); this.ForeGroundSprite.Descriptor.ToScaleX = 1.4; this.ForeGroundSprite.Descriptor.ToScaleY = 1.4; this.ForeGroundSprite.Descriptor.ToOpacity = 0; SpriteAnimation.ScaleToAnimation(this.ForeGroundSprite, new Duration(TimeSpan.FromMilliseconds(0)), 1.4, 1.4, 0, 0); SpriteAnimation.OpacityToAnimation(this.ForeGroundSprite, new Duration(TimeSpan.FromMilliseconds(0)), 0, 0); this.ForeGroundSprite.Descriptor.ToScaleX = 1.0; this.ForeGroundSprite.Descriptor.ToScaleY = 1.0; this.ForeGroundSprite.Descriptor.ToOpacity = 1; SpriteAnimation.ScaleToAnimation(this.ForeGroundSprite, new Duration(TimeSpan.FromMilliseconds(1000)), 1.0, 1.0, -0.7, -0.7, cb: (_, __) => { this.UiSprite.Descriptor.ToOpacity = 1; SpriteAnimation.OpacityToAnimation(this.UiSprite, new Duration(TimeSpan.FromMilliseconds(500)), 1, -0.6); this.Grid_WarpHolder.IsHitTestVisible = true; }); SpriteAnimation.OpacityToAnimation(this.ForeGroundSprite, new Duration(TimeSpan.FromMilliseconds(500)), 1, -0.6); this.CloudHolderSprite.Descriptor.ToOpacity = 1; SpriteAnimation.OpacityToAnimation(this.CloudHolderSprite, new Duration(TimeSpan.FromMilliseconds(500)), 1, -0.6); this.cloudSb = new Storyboard(); this.CloudSpriteA.Descriptor.ToX = -1920 / 2; this.CloudSpriteB.Descriptor.ToX = 1920 / 2; SpriteAnimation.XMoveToAnimation(this.CloudSpriteA, new Duration(TimeSpan.FromSeconds(300)), -1920 / 2, 0, null, cloudSb); SpriteAnimation.XMoveToAnimation(this.CloudSpriteB, new Duration(TimeSpan.FromSeconds(300)), 1920 / 2, 0, null, cloudSb); this.cloudSb.RepeatBehavior = new RepeatBehavior(int.MaxValue); this.cloudSb.Begin(); }
private void Page_PreviewMouseRightButtonUp(object sender, MouseButtonEventArgs e) { if (e != null) { this.core.UpdateMouse(e); } if (this.isResumingFromLoad || (!SpriteAnimation.IsAnyAnimation && this.IsAllowClose)) { if (this.currentStaging == "root") { this.IsAllowClose = false; if (CallbackTarget != String.Empty) { var callbackNtr = new Interrupt() { Detail = "LHRCCallbackNTR", InterruptSA = null, Type = InterruptType.ButtonJump, ReturnTarget = CallbackTarget, ExitWait = true }; // 提交返回主舞台的中断到主调用堆栈 Director.RunMana.CallStack.Submit(callbackNtr); // 重置回调 CallbackTarget = String.Empty; Director.RunMana.Symbols.GlobalCtxDao.GlobalSymbolTable.Assign("tracing_callback", String.Empty); } Storyboard closeSb = new Storyboard(); this.PanelSprite.Descriptor.ToX = 1920 + 1920 / 2; SpriteAnimation.XMoveToAnimation(this.PanelSprite, new Duration(TimeSpan.FromMilliseconds(150)), 1920 + 1920 / 2, -0.8, providedStory: closeSb); this.NameLogoSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(this.NameLogoSprite, new Duration(TimeSpan.FromMilliseconds(150)), 0, 0, providedStory: closeSb); this.EpisodeHintSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(this.EpisodeHintSprite, new Duration(TimeSpan.FromMilliseconds(150)), 0, 0, providedStory: closeSb); this.ButtonGroupSprite.Descriptor.ToOpacity = 0; this.ButtonGroupSprite.Descriptor.ToY = 1080 / 2 + 50; SpriteAnimation.OpacityToAnimation(this.ButtonGroupSprite, new Duration(TimeSpan.FromMilliseconds(150)), 0, 0, providedStory: closeSb); SpriteAnimation.YMoveToAnimation(this.ButtonGroupSprite, new Duration(TimeSpan.FromMilliseconds(150)), 1080 / 2 + 25, 0, providedStory: closeSb); SpriteAnimation.BlurMutexAnimation(this.MainStageSprite, TimeSpan.FromMilliseconds(300), 0, 0, providedStory: closeSb); closeSb.Completed += (_, __) => { this.PrepareClose(); this.core.GetMainRender().ResumeFromRclick(); if (this.IsFromAutoChanged) { RollbackManager.IsRollingBack = false; Director.RunMana.IsAutoplaying = true; Director.RunMana.ExitUserWait(); Director.RunMana.AutoPlayWait(); this.core.GetMainRender().HideMessageTria(); NotificationManager.Notify(String.Empty, "已启用自动播放", String.Empty, 1500); this.IsFromAutoChanged = false; } else if (this.IsFromReturnTitle) { this.IsFromReturnTitle = false; this.core.GetMainRender().Title(); } }; closeSb.Begin(); } else if (this.currentStaging == "backlog") { this.HandleBackward((_, __) => this.currentStaging = "root"); } else if (this.currentStaging == "save") { this.HandleBackward((_, __) => this.currentStaging = "root"); } else if (this.currentStaging == "load") { this.HandleBackward((_, __) => this.currentStaging = "root"); } else if (this.currentStaging == "settings") { this.HandleBackward((_, __) => this.currentStaging = "root"); } } }