Skip to content

Commit

Permalink
修复使用纯文本课表时仍弹出 Timetable 通知的问题、当 Timetable 通知关闭且语音启用时语音不播报的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
STBBRD committed Sep 21, 2024
1 parent 276d287 commit 62d964a
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions ZongziTEK_Blackboard_Sticker/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -912,16 +912,22 @@ public void LoadTimetableOrCurriculum()
if (Settings.TimetableSettings.IsTimetableEnabled)
{
LoadTimetable();

textBlockCurriculum.Visibility = Visibility.Collapsed;
StackPanelShowTimetable.Visibility = Visibility.Visible;
MenuItemTimetableAutoScroll.IsChecked = true;

timetableTimer.Start();
}
else
{
LoadCurriculum();

textBlockCurriculum.Visibility = Visibility.Visible;
StackPanelShowTimetable.Visibility = Visibility.Collapsed;
MenuItemTimetableAutoScroll.IsChecked = false;

timetableTimer.Stop();
}
CheckTimetableMenuItems();
}
Expand Down Expand Up @@ -1269,21 +1275,18 @@ private void CheckTimetable(object sender, EventArgs e)
}
}

// 弹出上下课提醒
if (Settings.TimetableSettings.IsTimetableNotificationEnabled)
// 上下课通知和语音
if (lessonIndex != -1 && currentTime == timetableToShow[lessonIndex].EndTime) // 下课时
{
if (lessonIndex != -1 && currentTime == timetableToShow[lessonIndex].EndTime) // 下课时
{
if (lessonIndex + 1 < timetableToShow.Count) // 不是最后一节课
{
ShowClassOverNotification(timetableToShow, lessonIndex);
}
else ShowLastClassOverNotification(timetableToShow[lessonIndex].IsStrongClassOverNotificationEnabled);
}
if (lessonIndex + 1 < timetableToShow.Count && !isInClass && currentTime == timetableToShow[lessonIndex + 1].StartTime - TimeSpan.FromSeconds(Settings.TimetableSettings.BeginNotificationTime)) // 有下一节课,在下一节课开始的数秒前
if (lessonIndex + 1 < timetableToShow.Count) // 不是最后一节课
{
ShowClassBeginPreNotification(timetableToShow, lessonIndex);
ShowClassOverNotification(timetableToShow, lessonIndex);
}
else ShowLastClassOverNotification(timetableToShow[lessonIndex].IsStrongClassOverNotificationEnabled);
}
if (lessonIndex + 1 < timetableToShow.Count && !isInClass && currentTime == timetableToShow[lessonIndex + 1].StartTime - TimeSpan.FromSeconds(Settings.TimetableSettings.BeginNotificationTime)) // 有下一节课,在下一节课开始的数秒前
{
ShowClassBeginPreNotification(timetableToShow, lessonIndex);
}

// 在界面中高亮当前课程或下一节课
Expand Down

0 comments on commit 62d964a

Please sign in to comment.