Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qubqub committed Nov 4, 2023
1 parent e97d7d9 commit b4c854c
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 67 deletions.
10 changes: 4 additions & 6 deletions Entities/LogFileWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public class LogFileWatcher {
public event Action<List<RoundInfo>> OnParsedLogLines;
public event Action<List<RoundInfo>> OnParsedLogLinesCurrent;
public event Action<DateTime> OnNewLogFileDate;
public event Action<string, string, string> OnServerConnectionNotification;
public event Action OnServerConnectionNotification;
public event Action<RoundInfo> OnPersonalBestNotification;
public event Action<string> OnError;

Expand Down Expand Up @@ -581,7 +581,7 @@ private bool ParseLine(LogLine line, List<RoundInfo> round, LogRound logRound) {
if (serverConnectionLog != null) {
if (!serverConnectionLog.IsNotify) {
if (Stats.IsGameRunning && this.StatsForm.CurrentSettings.NotifyServerConnected && !string.IsNullOrEmpty(Stats.LastCountryAlpha2Code)) {
this.OnServerConnectionNotification?.Invoke(Stats.LastCountryAlpha2Code, Stats.LastCountryRegion, Stats.LastCountryCity);
this.OnServerConnectionNotification?.Invoke();
}
}

Expand All @@ -594,7 +594,7 @@ private bool ParseLine(LogLine line, List<RoundInfo> round, LogRound logRound) {
this.serverPingWatcher.Start();
this.SetCountryCodeByIP(Stats.LastServerIp);
if (Stats.IsGameRunning && this.StatsForm.CurrentSettings.NotifyServerConnected && !string.IsNullOrEmpty(Stats.LastCountryAlpha2Code)) {
this.OnServerConnectionNotification?.Invoke(Stats.LastCountryAlpha2Code, Stats.LastCountryRegion, Stats.LastCountryCity);
this.OnServerConnectionNotification?.Invoke();
}
}
}
Expand Down Expand Up @@ -650,9 +650,7 @@ private bool ParseLine(LogLine line, List<RoundInfo> round, LogRound logRound) {
logRound.Info.CreativeQualificationPercent = this.creativeQualificationPercent;
logRound.Info.CreativeTimeLimitSeconds = this.creativeTimeLimitSeconds;
} else {
logRound.Info.Name = !logRound.Info.ShowNameId.Equals("wle_mrs_shuffle_show")
? line.Line.Substring(index + 62, index2 - index - 62)
: this.ReplaceLevelIdInDigisShuffleShow(logRound.Info.ShowNameId, line.Line.Substring(index + 62, index2 - index - 62));
logRound.Info.Name = this.ReplaceLevelIdInDigisShuffleShow(logRound.Info.ShowNameId, line.Line.Substring(index + 62, index2 - index - 62));
}

if (this.IsRealFinalRound(logRound.Info.Name, this.selectedShowId) || logRound.Info.UseShareCode) {
Expand Down
8 changes: 7 additions & 1 deletion Entities/Multilingual.cs
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ public static class Multilingual {
{"settings_auto_generate_profiles", "Auto-generate profiles"},
{"settings_select_language_button", "Confirm"},
{"settings_system_tray_icon", "Use the system tray icon"},
{"settings_notify_personal_best", "🔔 Windows notification when you break your personal best during a race round"},
{"settings_notify_server_connected", "🔔 Windows notification with the country name of the server when the server is connected"},
{"settings_mute_notification_sounds", "🔇 Mute notification sounds"},
{"settings_notification_sounds_01", "Notification Sounds 01"},
Expand Down Expand Up @@ -834,6 +835,7 @@ public static class Multilingual {
{"settings_auto_generate_profiles", "Créer un profil pour chaque émission"},
{"settings_select_language_button", "Confirmer"},
{"settings_system_tray_icon", "Utiliser l'icône de la barre des tâches"},
{"settings_notify_personal_best", "🔔 Notification Windows lorsque vous battez votre record personnel lors d'une course"},
{"settings_notify_server_connected", "🔔 Notification Windows avec le nom du pays du serveur lorsque le serveur est connecté"},
{"settings_mute_notification_sounds", "🔇 Couper les sons des notifications"},
{"settings_notification_sounds_01", "Sons de notification 01"},
Expand Down Expand Up @@ -1298,7 +1300,8 @@ public static class Multilingual {
{"settings_auto_generate_profiles", "프로필 자동 생성"},
{"settings_select_language_button", "확인"},
{"settings_system_tray_icon", "작업 표시줄 아이콘 사용"},
{"settings_notify_server_connected", "🔔 서버가 연결되면 서버가 위치한 나라의 이름을 윈도우 알림으로 띄우기"},
{"settings_notify_personal_best", "🔔 레이스 라운드에서 개인 최고 기록을 경신하면 팝업 알림"},
{"settings_notify_server_connected", "🔔 서버가 연결되면 서버가 위치한 나라의 이름을 팝업 알림"},
{"settings_mute_notification_sounds", "🔇 알림 소리 음소거"},
{"settings_notification_sounds_01", "알림 소리 01"},
{"settings_notification_sounds_02", "알림 소리 02"},
Expand Down Expand Up @@ -1762,6 +1765,7 @@ public static class Multilingual {
{"settings_auto_generate_profiles", "プロファイルの自動生成"},
{"settings_select_language_button", "保存"},
{"settings_system_tray_icon", "システムトレイアイコンを使用する"},
{"settings_notify_personal_best", "🔔 レースラウンドで個人トップ記録更新時にWindows通知を送信する"},
{"settings_notify_server_connected", "🔔 サーバー接続時にサーバーの国名を含む Windows 通知を送信する"},
{"settings_mute_notification_sounds", "🔇 通知音をミュート"},
{"settings_notification_sounds_01", "通知音 01"},
Expand Down Expand Up @@ -2226,6 +2230,7 @@ public static class Multilingual {
{"settings_auto_generate_profiles", "自动生成配置文件"},
{"settings_select_language_button", "选择"},
{"settings_system_tray_icon", "使用系统托盘图标"},
{"settings_notify_personal_best", "🔔 当您在比赛中打破个人最好成绩时,会收到 Windows 通知"},
{"settings_notify_server_connected", "🔔 连接服务器时,带有服务器国家/地区名称的 Windows 通知"},
{"settings_mute_notification_sounds", "🔇 将通知声音静音"},
{"settings_notification_sounds_01", "通知声音 01"},
Expand Down Expand Up @@ -2690,6 +2695,7 @@ public static class Multilingual {
{"settings_auto_generate_profiles", "自動生成配置文件"},
{"settings_select_language_button", "選擇"},
{"settings_system_tray_icon", "使用系統托盤圖標"},
{"settings_notify_personal_best", "🔔 當您在比賽中打破個人最佳成績時,您會收到 Windows 通知"},
{"settings_notify_server_connected", "🔔 連接服務器時,帶有服務器國家/地區名稱的 Windows 通知"},
{"settings_mute_notification_sounds", "🔇 將通知聲音靜音"},
{"settings_notification_sounds_01", "通知聲音 01"},
Expand Down
1 change: 1 addition & 0 deletions Entities/UserSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public class UserSettings {
public bool SystemTrayIcon { get; set; }
public bool PreventOverlayMouseClicks { get; set; }
public bool NotifyServerConnected { get; set; }
public bool NotifyPersonalBest { get; set; }
public bool MuteNotificationSounds { get; set; }
public int NotificationSounds { get; set; }
public int NotificationWindowPosition { get; set; }
Expand Down
38 changes: 27 additions & 11 deletions Views/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b4c854c

Please sign in to comment.