diff --git a/VPet-Simulator.Windows.Interface/ScheduleTask.cs b/VPet-Simulator.Windows.Interface/ScheduleTask.cs index a5f08a8..8a78e1a 100644 --- a/VPet-Simulator.Windows.Interface/ScheduleTask.cs +++ b/VPet-Simulator.Windows.Interface/ScheduleTask.cs @@ -195,6 +195,7 @@ public class ScheduleTask public void Start() { IsOn = true; + NowIndex = 0; StartWork(); } /// @@ -212,7 +213,16 @@ public class ScheduleTask AutoReset = false }; - private void WorkTimer_E_FinishWork(Core.WorkTimer.FinishWorkInfo obj) => StartWork(); + private void WorkTimer_E_FinishWork(Core.WorkTimer.FinishWorkInfo obj) + { + if (obj.spendtime < obj.work.Time / 2) + Stop(); + else + { + RestTime = 1; + RestTimer.Start(); + } + } public Package PackageWork { get; set; } public Package PackageStudy { get; set; } diff --git a/VPet-Simulator.Windows/WinDesign/winWorkMenu.xaml.cs b/VPet-Simulator.Windows/WinDesign/winWorkMenu.xaml.cs index 17850e9..ae60854 100644 --- a/VPet-Simulator.Windows/WinDesign/winWorkMenu.xaml.cs +++ b/VPet-Simulator.Windows/WinDesign/winWorkMenu.xaml.cs @@ -92,7 +92,7 @@ public partial class winWorkMenu : WindowX else sliderTaskLevel.TickFrequency = 5; tbtnCurrentPlan.IsChecked = mw.ScheduleTask.PackageWork?.IsActive() == true; - btnStartSchedule.IsChecked = false; + btnStartSchedule.IsChecked = mw.ScheduleTask.IsOn; AllowChange = true; combTaskType.SelectedIndex = 0; @@ -472,7 +472,7 @@ public partial class winWorkMenu : WindowX if (nowselefull.WorkType == Work.WorkType.Work) { if (mw.ScheduleTask.PackageWork?.IsActive() == true - && MessageBoxX.Show("工作套餐已激活,是否替换?".Translate(), "套餐已激活".Translate(), MessageBoxButton.YesNo) == MessageBoxResult.No) + && MessageBoxX.Show("工作套餐已激活,是否替换?".Translate(), "套餐已激活".Translate(), MessageBoxButton.YesNo) != MessageBoxResult.Yes) return; mw.ScheduleTask.PackageWork = package; rpnDisplay(mw.ScheduleTask.PackageWork, nowselefull.WorkType); @@ -480,7 +480,7 @@ public partial class winWorkMenu : WindowX else { if (mw.ScheduleTask.PackageStudy?.IsActive() == true - && MessageBoxX.Show("学习套餐已激活,是否替换?".Translate(), "套餐已激活".Translate(), MessageBoxButton.YesNo) == MessageBoxResult.No) + && MessageBoxX.Show("学习套餐已激活,是否替换?".Translate(), "套餐已激活".Translate(), MessageBoxButton.YesNo) != MessageBoxResult.Yes) return; mw.ScheduleTask.PackageStudy = package; rpnDisplay(mw.ScheduleTask.PackageStudy, nowselefull.WorkType);