diff --git a/VPet-Simulator.Core/Display/Main.xaml.cs b/VPet-Simulator.Core/Display/Main.xaml.cs index 6504d47..7144bf6 100644 --- a/VPet-Simulator.Core/Display/Main.xaml.cs +++ b/VPet-Simulator.Core/Display/Main.xaml.cs @@ -1,4 +1,5 @@ -using Panuon.WPF.UI; +using LinePutScript; +using Panuon.WPF.UI; using System; using System.Collections.Generic; using System.Linq; @@ -55,6 +56,8 @@ namespace VPet_Simulator.Core ToolBar = new ToolBar(this); ToolBar.Visibility = Visibility.Collapsed; + ToolBar.MenuWork1.Header = core.Graph.GraphConfig.Str[(gstr)"work1"]; + ToolBar.MenuWork2.Header = core.Graph.GraphConfig.Str[(gstr)"work2"]; UIGrid.Children.Add(ToolBar); MsgBar = new MessageBar(this); MsgBar.Visibility = Visibility.Collapsed; @@ -120,7 +123,7 @@ namespace VPet_Simulator.Core if (DisplayType != GraphCore.GraphType.Default) {//不是nomal! 可能会卡timer,所有全部timer清空下 CleanState(); - if (DisplayStopMove(DisplayNomal)) + if (DisplayStopMove(DisplayToNomal)) return; } Task.Run(() => @@ -218,8 +221,8 @@ namespace VPet_Simulator.Core private bool? wavetop = null; private DateTime wavespan; private void MainGrid_MouseWave(object sender, MouseEventArgs e) - { - if (rasetype >= 0) + { + if (rasetype >= 0 || State != WorkingState.Nomal) return; if ((DateTime.Now - wavespan).TotalSeconds > 2) diff --git a/VPet-Simulator.Core/Display/MainDisplay.cs b/VPet-Simulator.Core/Display/MainDisplay.cs index 6ff8099..0264ed2 100644 --- a/VPet-Simulator.Core/Display/MainDisplay.cs +++ b/VPet-Simulator.Core/Display/MainDisplay.cs @@ -24,6 +24,31 @@ namespace VPet_Simulator.Core /// public int CountNomal = 0; /// + /// 以标准形式显示当前默认状态 + /// + public void DisplayToNomal() + { + switch (State) + { + default: + case WorkingState.Nomal: + DisplayNomal(); + return; + case WorkingState.Sleep: + DisplaySleep(true); + return; + case WorkingState.WorkONE: + DisplayWorkONE(); + return; + case WorkingState.WorkTWO: + DisplayWorkTWO(); + return; + case WorkingState.Study: + DisplayStudy(); + return; + } + } + /// /// 显示默认情况 /// public void DisplayNomal() @@ -67,6 +92,7 @@ namespace VPet_Simulator.Core Display(GraphCore.GraphType.Walk_Right_C_End, EndAction); return true; case GraphType.Sleep_B_Loop: + State = WorkingState.Nomal; Display(GraphCore.GraphType.Sleep_C_End, EndAction); return true; case GraphType.Idel_StateONE_B_Loop: @@ -118,7 +144,7 @@ namespace VPet_Simulator.Core Display(GraphCore.GraphType.Touch_Head_A_Start, () => Display(GraphCore.GraphType.Touch_Head_B_Loop, () => - Display(GraphCore.GraphType.Touch_Head_C_End, DisplayNomal + Display(GraphCore.GraphType.Touch_Head_C_End, DisplayToNomal ))); } /// @@ -147,8 +173,8 @@ namespace VPet_Simulator.Core Core.Graph.RndGraph.Clear(); Display(GraphCore.GraphType.Touch_Body_A_Start, () => Display(GraphCore.GraphType.Touch_Body_B_Loop, () => - Display(GraphCore.GraphType.Touch_Body_C_End, DisplayNomal - , true), true), true); + Display(GraphCore.GraphType.Touch_Body_C_End, DisplayToNomal + ))); } /// /// 显示待机(模式1)情况 @@ -171,7 +197,7 @@ namespace VPet_Simulator.Core DisplayIdel_StateTWO(); break; default: - Display(GraphCore.GraphType.Idel_StateONE_C_End, DisplayNomal); + Display(GraphCore.GraphType.Idel_StateONE_C_End, DisplayToNomal); break; } else @@ -213,7 +239,7 @@ namespace VPet_Simulator.Core private void DisplaySquating() { if (Function.Rnd.Next(++looptimes) > LoopProMax) - Display(GraphCore.GraphType.Squat_C_End, DisplayNomal); + Display(GraphCore.GraphType.Squat_C_End, DisplayToNomal); else Display(GraphCore.GraphType.Squat_B_Loop, DisplaySquating); } @@ -232,7 +258,7 @@ namespace VPet_Simulator.Core private void DisplayBoringing() { if (Function.Rnd.Next(++looptimes) > LoopProMax) - Display(GraphCore.GraphType.Boring_C_End, DisplayNomal); + Display(GraphCore.GraphType.Boring_C_End, DisplayToNomal); else Display(GraphCore.GraphType.Boring_B_Loop, DisplayBoringing); } @@ -246,7 +272,10 @@ namespace VPet_Simulator.Core looptimes = 0; CountNomal = 0; if (force) + { + State = WorkingState.Sleep; Display(GraphCore.GraphType.Sleep_A_Start, DisplaySleepingForce); + } else Display(GraphCore.GraphType.Sleep_A_Start, DisplaySleeping); } @@ -256,7 +285,7 @@ namespace VPet_Simulator.Core private void DisplaySleeping() { if (Function.Rnd.Next(++looptimes) > LoopProMax) - Display(GraphCore.GraphType.Sleep_C_End, DisplayNomal); + Display(GraphCore.GraphType.Sleep_C_End, DisplayToNomal); else Display(GraphCore.GraphType.Sleep_B_Loop, DisplaySleeping); } @@ -268,6 +297,51 @@ namespace VPet_Simulator.Core Display(GraphCore.GraphType.Sleep_B_Loop, DisplaySleepingForce); } + /// + /// 显示工作情况 + /// + public void DisplayWorkONE() + { + State = WorkingState.WorkONE; + Display(GraphCore.GraphType.WorkONE_A_Start, DisplayWorkONEing); + } + /// + /// 显示工作情况循环 + /// + private void DisplayWorkONEing() + { + Display(GraphCore.GraphType.WorkONE_B_Loop, DisplayWorkONEing); + } + /// + /// 显示工作情况 + /// + public void DisplayWorkTWO() + { + State = WorkingState.WorkTWO; + Display(GraphCore.GraphType.WorkTWO_A_Start, DisplayWorkTWOing); + } + /// + /// 显示工作情况循环 + /// + private void DisplayWorkTWOing() + { + Display(GraphCore.GraphType.WorkTWO_B_Loop, DisplayWorkTWOing); + } + /// + /// 显示学习情况 + /// + public void DisplayStudy() + { + State = WorkingState.Study; + Display(GraphCore.GraphType.Study_A_Start, DisplayStudying); + } + /// + /// 显示学习情况 + /// + private void DisplayStudying() + { + Display(GraphCore.GraphType.Study_B_Loop, DisplayStudying); + } /// /// 显示拖拽情况 /// @@ -316,7 +390,7 @@ namespace VPet_Simulator.Core public void DisplayFalled_Left() { Display(GraphCore.GraphType.Fall_Left_C_End, - () => Display(GraphCore.GraphType.Climb_Up_Left, DisplayNomal)); + () => Display(GraphCore.GraphType.Climb_Up_Left, DisplayToNomal)); } /// /// 显示掉到地上 从左边 @@ -324,7 +398,7 @@ namespace VPet_Simulator.Core public void DisplayFalled_Right() { Display(GraphCore.GraphType.Fall_Right_C_End, - () => Display(GraphCore.GraphType.Climb_Up_Right, DisplayNomal)); + () => Display(GraphCore.GraphType.Climb_Up_Right, DisplayToNomal)); } /// /// 显示向左走 (有判断) @@ -358,19 +432,19 @@ namespace VPet_Simulator.Core DisplayFall_Left(() => { MoveTimer.Enabled = false; - Display(GraphCore.GraphType.Walk_Left_C_End, DisplayNomal); + Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal); }); return; case 1: DisplayFall_Right(() => { MoveTimer.Enabled = false; - Display(GraphCore.GraphType.Walk_Left_C_End, DisplayNomal); + Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal); }); return; default: MoveTimer.Enabled = false; - Display(GraphCore.GraphType.Walk_Left_C_End, DisplayNomal); + Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal); return; } } @@ -388,19 +462,19 @@ namespace VPet_Simulator.Core DisplayFall_Left(() => { MoveTimer.Enabled = false; - Display(GraphCore.GraphType.Walk_Left_C_End, DisplayNomal); + Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal); }); break; case 1: DisplayFall_Right(() => { MoveTimer.Enabled = false; - Display(GraphCore.GraphType.Walk_Left_C_End, DisplayNomal); + Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal); }); break; default: MoveTimer.Enabled = false; - Display(GraphCore.GraphType.Walk_Left_C_End, DisplayNomal); + Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal); break; } @@ -438,19 +512,19 @@ namespace VPet_Simulator.Core DisplayClimb_Right_UP(() => { MoveTimer.Enabled = false; - Display(GraphCore.GraphType.Walk_Right_C_End, DisplayNomal); + Display(GraphCore.GraphType.Walk_Right_C_End, DisplayToNomal); }); return; case 1: DisplayClimb_Right_DOWN(() => { MoveTimer.Enabled = false; - Display(GraphCore.GraphType.Walk_Right_C_End, DisplayNomal); + Display(GraphCore.GraphType.Walk_Right_C_End, DisplayToNomal); }); return; default: MoveTimer.Enabled = false; - Display(GraphCore.GraphType.Walk_Right_C_End, DisplayNomal); + Display(GraphCore.GraphType.Walk_Right_C_End, DisplayToNomal); return; } } @@ -468,19 +542,19 @@ namespace VPet_Simulator.Core DisplayFall_Left(() => { MoveTimer.Enabled = false; - Display(GraphCore.GraphType.Walk_Left_C_End, DisplayNomal); + Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal); }); break; case 1: DisplayFall_Right(() => { MoveTimer.Enabled = false; - Display(GraphCore.GraphType.Walk_Left_C_End, DisplayNomal); + Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal); }); break; default: MoveTimer.Enabled = false; - Display(GraphCore.GraphType.Walk_Left_C_End, DisplayNomal); + Display(GraphCore.GraphType.Walk_Left_C_End, DisplayToNomal); break; } @@ -517,19 +591,19 @@ namespace VPet_Simulator.Core DisplayClimb_Left_UP(() => { MoveTimer.Enabled = false; - Display(GraphCore.GraphType.Crawl_Left_C_End, DisplayNomal); + Display(GraphCore.GraphType.Crawl_Left_C_End, DisplayToNomal); }); return; case 1: DisplayClimb_Left_DOWN(() => { MoveTimer.Enabled = false; - Display(GraphCore.GraphType.Crawl_Left_C_End, DisplayNomal); + Display(GraphCore.GraphType.Crawl_Left_C_End, DisplayToNomal); }); return; default: MoveTimer.Enabled = false; - Display(GraphCore.GraphType.Crawl_Left_C_End, DisplayNomal); + Display(GraphCore.GraphType.Crawl_Left_C_End, DisplayToNomal); return; } } @@ -541,7 +615,7 @@ namespace VPet_Simulator.Core else {//停下来 MoveTimer.Enabled = false; - Display(GraphCore.GraphType.Crawl_Left_C_End, DisplayNomal); + Display(GraphCore.GraphType.Crawl_Left_C_End, DisplayToNomal); } } /// @@ -575,19 +649,19 @@ namespace VPet_Simulator.Core DisplayClimb_Right_UP(() => { MoveTimer.Enabled = false; - Display(GraphCore.GraphType.Crawl_Right_C_End, DisplayNomal); + Display(GraphCore.GraphType.Crawl_Right_C_End, DisplayToNomal); }); return; case 1: DisplayClimb_Right_DOWN(() => { MoveTimer.Enabled = false; - Display(GraphCore.GraphType.Crawl_Right_C_End, DisplayNomal); + Display(GraphCore.GraphType.Crawl_Right_C_End, DisplayToNomal); }); return; default: MoveTimer.Enabled = false; - Display(GraphCore.GraphType.Crawl_Right_C_End, DisplayNomal); + Display(GraphCore.GraphType.Crawl_Right_C_End, DisplayToNomal); return; } } @@ -599,7 +673,7 @@ namespace VPet_Simulator.Core else {//停下来 MoveTimer.Enabled = false; - Display(GraphCore.GraphType.Crawl_Right_C_End, DisplayNomal); + Display(GraphCore.GraphType.Crawl_Right_C_End, DisplayToNomal); } } /// @@ -641,7 +715,7 @@ namespace VPet_Simulator.Core return; default: MoveTimer.Enabled = false; - DisplayNomal(); + DisplayToNomal(); return; } } @@ -659,7 +733,7 @@ namespace VPet_Simulator.Core break; default: MoveTimer.Enabled = false; - DisplayNomal(); + DisplayToNomal(); break; } } @@ -695,7 +769,7 @@ namespace VPet_Simulator.Core if (Core.Controller.GetWindowsDistanceDown() < DistanceMin * Core.Controller.ZoomRatio) {//是,停下恢复默认 MoveTimer.Enabled = false; - DisplayNomal(); + DisplayToNomal(); } //不是:继续or停下 if (Function.Rnd.Next(walklength++) < LoopMin) @@ -705,7 +779,7 @@ namespace VPet_Simulator.Core else {//停下来 MoveTimer.Enabled = false; - DisplayNomal(); + DisplayToNomal(); } } /// @@ -748,7 +822,7 @@ namespace VPet_Simulator.Core return; default: MoveTimer.Enabled = false; - DisplayNomal(); + DisplayToNomal(); return; } } @@ -766,7 +840,7 @@ namespace VPet_Simulator.Core break; default: MoveTimer.Enabled = false; - DisplayNomal(); + DisplayToNomal(); break; } } @@ -802,7 +876,7 @@ namespace VPet_Simulator.Core if (Core.Controller.GetWindowsDistanceDown() < DistanceMin * Core.Controller.ZoomRatio) {//是,停下恢复默认 MoveTimer.Enabled = false; - DisplayNomal(); + DisplayToNomal(); } //不是:继续or停下 if (Function.Rnd.Next(walklength++) < LoopMin) @@ -812,7 +886,7 @@ namespace VPet_Simulator.Core else {//停下来 MoveTimer.Enabled = false; - DisplayNomal(); + DisplayToNomal(); } } /// @@ -978,7 +1052,7 @@ namespace VPet_Simulator.Core //Core.Controller.MoveWindows(0, -Core.Controller.GetWindowsDistanceUp() / Core.Controller.ZoomRatio); MoveTimer.Enabled = false; DisplayFalled_Left(); - //DisplayNomal(); + //DisplayToNomal(); } } @@ -1041,7 +1115,7 @@ namespace VPet_Simulator.Core //Core.Controller.MoveWindows(0, -Core.Controller.GetWindowsDistanceUp() / Core.Controller.ZoomRatio); MoveTimer.Enabled = false; DisplayFalled_Right(); - //DisplayNomal(); + //DisplayToNomal(); } } @@ -1052,10 +1126,10 @@ namespace VPet_Simulator.Core /// /// 动画类型 /// 动画结束后操作 - /// 是否储存随机数字典 - public void Display(GraphType Type, Action EndAction = null, bool storernd = false) + ///// 是否储存随机数字典 + public void Display(GraphType Type, Action EndAction = null) { - Display(Core.Graph.FindGraph(Type, Core.Save.Mode, storernd), EndAction); + Display(Core.Graph.FindGraph(Type, Core.Save.Mode), EndAction); } bool petgridcrlf = true; /// diff --git a/VPet-Simulator.Core/Display/MainLogic.cs b/VPet-Simulator.Core/Display/MainLogic.cs index 5db7ebf..3a1676d 100644 --- a/VPet-Simulator.Core/Display/MainLogic.cs +++ b/VPet-Simulator.Core/Display/MainLogic.cs @@ -63,17 +63,38 @@ namespace VPet_Simulator.Core public void FunctionSpend(double TimePass) { Core.Save.CleanChange(); - //饮食等乱七八糟的消耗 - if (Core.Save.StrengthFood >= 50) + switch (State) { - Core.Save.StrengthChange(TimePass); - if (Core.Save.StrengthFood >= 75) - Core.Save.Health += Function.Rnd.Next(0, 1) * TimePass; - } - else if (Core.Save.StrengthFood <= 25) - { - Core.Save.Health -= Function.Rnd.Next(0, 1) * TimePass; + case WorkingState.Sleep: + //睡觉消耗 + if (Core.Save.StrengthFood >= 25) + { + Core.Save.StrengthChange(TimePass * 2); + if (Core.Save.StrengthFood >= 75) + Core.Save.Health += TimePass / 2; + } + break; + case WorkingState.WorkONE: + case WorkingState.WorkTWO: + case WorkingState.Study: + break; + //工作/娱乐等消耗 + default://默认 + //饮食等乱七八糟的消耗 + if (Core.Save.StrengthFood >= 50) + { + Core.Save.StrengthChange(TimePass); + if (Core.Save.StrengthFood >= 75) + Core.Save.Health += Function.Rnd.Next(0, 1) * TimePass; + } + else if (Core.Save.StrengthFood <= 25) + { + Core.Save.Health -= Function.Rnd.Next(0, 1) * TimePass; + } + break; } + + //if (Core.GameSave.Strength <= 40) //{ // Core.GameSave.Health -= Function.Rnd.Next(0, 1); @@ -86,7 +107,7 @@ namespace VPet_Simulator.Core { Core.Save.Likability += TimePass; } - Core.Save.Exp+= TimePass; + Core.Save.Exp += TimePass; Core.Save.Health += TimePass; } else if (Core.Save.Feeling <= 25) @@ -108,7 +129,7 @@ namespace VPet_Simulator.Core } private void EventTimer_Elapsed(object sender, ElapsedEventArgs e) - { + { //所有Handle TimeHandle?.Invoke(this); @@ -243,5 +264,39 @@ namespace VPet_Simulator.Core MoveTimer.AutoReset = false; } } + /// + /// 当前状态 + /// + public WorkingState State = WorkingState.Nomal; + /// + /// 当前正在的状态 + /// + public enum WorkingState + { + /// + /// 默认:啥都没干 + /// + Nomal, + /// + /// 正在干活1 + /// + WorkONE, + /// + /// 正在干活1 + /// + WorkTWO, + /// + /// 学习中 + /// + Study, + /// + /// 睡觉 + /// + Sleep, + ///// + ///// 玩耍中 + ///// + //Playing, + } } } diff --git a/VPet-Simulator.Core/Display/MessageBar.xaml.cs b/VPet-Simulator.Core/Display/MessageBar.xaml.cs index 8652741..c37d35f 100644 --- a/VPet-Simulator.Core/Display/MessageBar.xaml.cs +++ b/VPet-Simulator.Core/Display/MessageBar.xaml.cs @@ -61,7 +61,7 @@ namespace VPet_Simulator.Core { Thread.Sleep(timeleft * 50); if (sayType != GraphCore.Helper.SayType.None && m.DisplayType.ToString().StartsWith("Say")) - m.Display(GraphCore.Helper.Convert(sayType, GraphCore.Helper.AnimatType.C_End), m.DisplayNomal); + m.Display(GraphCore.Helper.Convert(sayType, GraphCore.Helper.AnimatType.C_End), m.DisplayToNomal); }); ShowTimer.Stop(); EndTimer.Start(); diff --git a/VPet-Simulator.Core/Display/ToolBar.xaml b/VPet-Simulator.Core/Display/ToolBar.xaml index 3cdd6b7..c067945 100644 --- a/VPet-Simulator.Core/Display/ToolBar.xaml +++ b/VPet-Simulator.Core/Display/ToolBar.xaml @@ -94,28 +94,30 @@ Foreground="{DynamicResource DARKPrimary}" /> - + - + - + HorizontalContentAlignment="Center" Width="99" Padding="0" /> + - - - + + + + - + x:FieldModifier="public" Width="99" Padding="0" /> + diff --git a/VPet-Simulator.Core/Display/ToolBar.xaml.cs b/VPet-Simulator.Core/Display/ToolBar.xaml.cs index 3d6c6ff..54a1907 100644 --- a/VPet-Simulator.Core/Display/ToolBar.xaml.cs +++ b/VPet-Simulator.Core/Display/ToolBar.xaml.cs @@ -25,7 +25,7 @@ namespace VPet_Simulator.Core public partial class ToolBar : UserControl, IDisposable { Main m; - public Timer CloseTimer; + public Timer CloseTimer; bool onFocus = false; Timer closePanelTimer; @@ -260,7 +260,39 @@ namespace VPet_Simulator.Core private void Sleep_Click(object sender, RoutedEventArgs e) { - m.DisplaySleep(true); + if (m.Core.Save.Mode != GameSave.ModeType.Ill) + if (m.State == Main.WorkingState.Sleep) + m.Display(GraphCore.GraphType.Sleep_C_End, m.DisplayNomal); + else + m.DisplaySleep(true); + this.Visibility = Visibility.Collapsed; + } + + private void Study_Click(object sender, RoutedEventArgs e) + { + if (m.Core.Save.Mode != GameSave.ModeType.Ill) + if (m.State == Main.WorkingState.Study) + m.Display(GraphCore.GraphType.Study_C_End, m.DisplayNomal); + else m.DisplayStudy(); + this.Visibility = Visibility.Collapsed; + } + + private void Work1_Click(object sender, RoutedEventArgs e) + { + if (m.Core.Save.Mode != GameSave.ModeType.Ill) + if (m.State == Main.WorkingState.WorkONE) + m.Display(GraphCore.GraphType.WorkONE_C_End, m.DisplayNomal); + else m.DisplayWorkONE(); + this.Visibility = Visibility.Collapsed; + } + + private void Work2_Click(object sender, RoutedEventArgs e) + { + if (m.Core.Save.Mode != GameSave.ModeType.Ill) + if (m.State == Main.WorkingState.WorkTWO) + m.Display(GraphCore.GraphType.WorkTWO_C_End, m.DisplayNomal); + else m.DisplayWorkTWO(); + this.Visibility = Visibility.Collapsed; } } } diff --git a/VPet-Simulator.Core/Graph/GraphCore.cs b/VPet-Simulator.Core/Graph/GraphCore.cs index 356f07b..f06853a 100644 --- a/VPet-Simulator.Core/Graph/GraphCore.cs +++ b/VPet-Simulator.Core/Graph/GraphCore.cs @@ -275,6 +275,42 @@ namespace VPet_Simulator.Core /// 关机 /// Shutdown, + /// + /// 学习 (开始) + /// + Study_A_Start, + /// + /// 学习 (循环) + /// + Study_B_Loop, + /// + /// 学习 (结束) + /// + Study_C_End, + /// + /// 工作 (开始) + /// + WorkONE_A_Start, + /// + /// 工作 (循环) + /// + WorkONE_B_Loop, + /// + /// 工作 (结束) + /// + WorkONE_C_End, + /// + /// 直播 (开始) + /// + WorkTWO_A_Start, + /// + /// 直播 (循环) + /// + WorkTWO_B_Loop, + /// + /// 直播 (结束) + /// + WorkTWO_C_End, } /// @@ -337,9 +373,9 @@ namespace VPet_Simulator.Core /// /// 动画类型 /// 状态类型,找不到就找相同动画类型 - /// 是否储存随机数字典 + ///// 是否储存随机数字典 /// - public IGraph FindGraph(GraphType type, GameSave.ModeType mode, bool storernd = false) + public IGraph FindGraph(GraphType type, GameSave.ModeType mode) { if (Graphs.ContainsKey(type)) { @@ -348,7 +384,7 @@ namespace VPet_Simulator.Core { if (list.Count == 1) return list[0]; - if (storernd) + if (GraphConfig.StoreRnd.Contains(type.ToString())) if (RndGraph.TryGetValue(list.Count, out int index)) { return list[index]; @@ -453,8 +489,8 @@ namespace VPet_Simulator.Core /// 定位爬行上边距离 /// public double LocateClimbTop; - - + public List StoreRnd = new List(); + public ILine Str; /// /// 初始化设置 /// @@ -484,6 +520,12 @@ namespace VPet_Simulator.Core LocateClimbLeft = s[(gdbe)"climbleft"]; LocateClimbRight = s[(gdbe)"climbright"]; LocateClimbTop = s[(gdbe)"climbtop"]; + + foreach (Sub sub in lps["storernd"]) + { + StoreRnd.Add(sub.Name); + } + Str = lps["str"]; } /// /// 加载更多设置,新的替换后来的,允许空内容 @@ -526,6 +568,16 @@ namespace VPet_Simulator.Core LocateClimbRight = s.GetDouble("climbright", LocateClimbRight); LocateClimbTop = s.GetDouble("climbtop", LocateClimbTop); } + foreach (Sub sub in lps["storernd"]) + { + if (!StoreRnd.Contains(sub.Name)) + StoreRnd.Add(sub.Name); + } + foreach(Sub sub in lps["str"]) + { + if (!Str.Contains(sub.Name)) + Str.Add(sub); + } } } diff --git a/VPet-Simulator.Core/Graph/Picture.cs b/VPet-Simulator.Core/Graph/Picture.cs index 681b00f..0699945 100644 --- a/VPet-Simulator.Core/Graph/Picture.cs +++ b/VPet-Simulator.Core/Graph/Picture.cs @@ -32,9 +32,9 @@ namespace VPet_Simulator.Core if (!GraphCore.CommConfig.ContainsKey("PIC_Setup")) { GraphCore.CommConfig["PIC_Setup"] = true; - GraphCore.CommUIElements["Image1.Picture"] = new System.Windows.Controls.Image() { Width = 500, Height = 500 }; - GraphCore.CommUIElements["Image2.Picture"] = new System.Windows.Controls.Image() { Width = 500, Height = 500 }; - GraphCore.CommUIElements["Image3.Picture"] = new System.Windows.Controls.Image() { Width = 500, Height = 500 }; + GraphCore.CommUIElements["Image1.Picture"] = new Image() { Width = 500, Height = 500 }; + GraphCore.CommUIElements["Image2.Picture"] = new Image() { Width = 500, Height = 500 }; + GraphCore.CommUIElements["Image3.Picture"] = new Image() { Width = 500, Height = 500 }; } } /// @@ -59,14 +59,14 @@ namespace VPet_Simulator.Core { if (parant.Tag != this) { - System.Windows.Controls.Image img; + Image img; if (parant.Child == GraphCore.CommUIElements["Image1.Picture"]) { - img = (System.Windows.Controls.Image)GraphCore.CommUIElements["Image1.Picture"]; + img = (Image)GraphCore.CommUIElements["Image1.Picture"]; } else { - img = (System.Windows.Controls.Image)GraphCore.CommUIElements["Image2.Picture"]; + img = (Image)GraphCore.CommUIElements["Image2.Picture"]; if (parant.Child != GraphCore.CommUIElements["Image2.Picture"]) { if (img.Parent == null) @@ -75,7 +75,7 @@ namespace VPet_Simulator.Core } else { - img = (System.Windows.Controls.Image)GraphCore.CommUIElements["Image3.Picture"]; + img = (Image)GraphCore.CommUIElements["Image3.Picture"]; parant.Child = img; } } diff --git a/VPet-Simulator.Core/Handle/GameSave.cs b/VPet-Simulator.Core/Handle/GameSave.cs index db45318..053aa57 100644 --- a/VPet-Simulator.Core/Handle/GameSave.cs +++ b/VPet-Simulator.Core/Handle/GameSave.cs @@ -239,27 +239,6 @@ namespace VPet_Simulator.Core //save.SetFloat("Likability", Likability); return LPSConvert.SerializeObject(this, "vpet"); } - /// - /// 当前正在的状态 - /// - public enum WorkingState - { - /// - /// 默认:啥都没干 - /// - Nomal, - /// - /// 正在干活, workingobj指示正在干啥活 - /// - Working, - /// - /// 学习中 - /// - Studying, - /// - /// 玩耍中 - /// - Playing, - } + } } diff --git a/VPet-Simulator.Windows/Function/MWController.cs b/VPet-Simulator.Windows/Function/MWController.cs index 88ce707..234814a 100644 --- a/VPet-Simulator.Windows/Function/MWController.cs +++ b/VPet-Simulator.Windows/Function/MWController.cs @@ -63,7 +63,7 @@ namespace VPet_Simulator.Windows public int PressLength => mw.Set.PressLength; - public bool EnableFunction => mw.Set.EnableFunction; + public bool EnableFunction => false;// mw.Set.EnableFunction; public int InteractionCycle => mw.Set.InteractionCycle; diff --git a/VPet-Simulator.Windows/MainWindow.cs b/VPet-Simulator.Windows/MainWindow.cs index 7bb4580..7e06ca0 100644 --- a/VPet-Simulator.Windows/MainWindow.cs +++ b/VPet-Simulator.Windows/MainWindow.cs @@ -68,7 +68,11 @@ namespace VPet_Simulator.Windows { Main.ToolBar.MenuDIY.Items.Clear(); foreach (Sub sub in Set["diy"]) - Main.ToolBar.AddMenuButton(ToolBar.MenuType.DIY, sub.Name, () => RunDIY(sub.Info)); + Main.ToolBar.AddMenuButton(ToolBar.MenuType.DIY, sub.Name, () => + { + Main.ToolBar.Visibility = Visibility.Collapsed; + RunDIY(sub.Info); + }); try { //加载游戏创意工坊插件 diff --git a/VPet-Simulator.Windows/MainWindow.xaml.cs b/VPet-Simulator.Windows/MainWindow.xaml.cs index fb080b1..a6e7083 100644 --- a/VPet-Simulator.Windows/MainWindow.xaml.cs +++ b/VPet-Simulator.Windows/MainWindow.xaml.cs @@ -254,11 +254,13 @@ namespace VPet_Simulator.Windows } Dispatcher.Invoke(() => LoadingText.Visibility = Visibility.Collapsed); }); - Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "退出桌宠", () => { Close(); }); - Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "开发控制台", () => { new winConsole(this).Show(); }); - Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "反馈中心", () => { new winReport(this).Show(); }); + + Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "退出桌宠", () => { Main.ToolBar.Visibility = Visibility.Collapsed; Close(); }); + Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "开发控制台", () => { Main.ToolBar.Visibility = Visibility.Collapsed; new winConsole(this).Show(); }); + Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "反馈中心", () => { Main.ToolBar.Visibility = Visibility.Collapsed; new winReport(this).Show(); }); Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "设置面板", () => { + Main.ToolBar.Visibility = Visibility.Collapsed; Topmost = false; winSetting.Show(); }); @@ -275,7 +277,7 @@ namespace VPet_Simulator.Windows m_menu.MenuItems.Add(new MenuItem("重置状态", (x, y) => { Main.CleanState(); - Main.DisplayNomal(); + Main.DisplayToNomal(); Left = (SystemParameters.PrimaryScreenWidth - Width) / 2; Top = (SystemParameters.PrimaryScreenHeight - Height) / 2; })); diff --git a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml index 8c7f7a4..e814ad9 100644 --- a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml +++ b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml @@ -13,13 +13,12 @@ --> - + @@ -28,7 +27,7 @@ + BorderBrush="{DynamicResource PrimaryDarker}"> @@ -41,31 +40,29 @@ - - + + - + - + CheckedBackground="{DynamicResource Primary}" CheckedBorderBrush="{DynamicResource Primary}" + Background="Transparent" BoxWidth="35" BoxHeight="18" ToggleSize="14" + ToggleShadowColor="{x:Null}" ToggleBrush="{DynamicResource PrimaryDark}" + CheckedToggleBrush="{DynamicResource DARKPrimaryText}" Checked="TopMostBox_Checked" + Unchecked="TopMostBox_Unchecked" ToolTip="将桌宠置于顶层" /> + - + BorderBrush="{DynamicResource PrimaryDark}" CheckedBackground="{DynamicResource Primary}" + CheckedBorderBrush="{DynamicResource Primary}" Background="Transparent" BoxWidth="35" + BoxHeight="18" ToggleSize="14" ToggleShadowColor="{x:Null}" + ToggleBrush="{DynamicResource PrimaryDark}" + CheckedToggleBrush="{DynamicResource DARKPrimaryText}" Checked="FullScreenBox_Check" + Unchecked="FullScreenBox_Check" ToolTip="解锁缩放限制" /> + @@ -73,92 +70,95 @@ + Style="{DynamicResource StandardSliderStyle}" VerticalAlignment="Center" Maximum="3" + SmallChange=".05" Minimum="0.5" LargeChange=".1" Value="1" + PreviewMouseUp="ZoomSlider_MouseUp" /> + Text="{Binding ElementName=ZoomSlider,Path=Value,StringFormat=f2}" FontSize="18" + Foreground="{DynamicResource DARKPrimaryDarker}" FontWeight="Bold" Background="{x:Null}" /> - + + SelectionChanged="ThemeBox_SelectionChanged" IsEnabled="False" + Style="{DynamicResource StandardComboBoxStyle}" Margin="0,3,0,2" FontSize="16" /> - - - + + + - - - - + + + + - - + CheckedBackground="{DynamicResource Primary}" IsChecked="True" + CheckedBorderBrush="{DynamicResource Primary}" Background="Transparent" BoxWidth="35" + BoxHeight="18" ToggleSize="14" ToggleShadowColor="{x:Null}" + ToggleBrush="{DynamicResource PrimaryDark}" Content="退出位置" + CheckedToggleBrush="{DynamicResource DARKPrimaryText}" ToolTip="该游戏随着开机启动该程序" + Unchecked="StartPlace_Checked" VerticalAlignment="Center" Checked="StartPlace_Checked" /> + +