Add an option to disable chat in replays
This commit is contained in:
@@ -265,7 +265,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
if (!IsNotificationEligible(notification))
|
||||
return;
|
||||
|
||||
chatOverlayDisplay?.AddNotification(notification);
|
||||
if (!IsNotificationMuted(notification))
|
||||
chatOverlayDisplay?.AddNotification(notification);
|
||||
|
||||
// HACK: Force disable the chat notification sound for the in-menu chat dialog
|
||||
// This works around our inability to disable the sounds for the in-game dialog when it is hidden
|
||||
@@ -282,7 +283,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
if (scrolledToBottom)
|
||||
chatScrollPanel.ScrollToBottom(smooth: true);
|
||||
|
||||
if (!suppressSound)
|
||||
if (!suppressSound && !IsNotificationMuted(notification))
|
||||
Game.Sound.PlayNotification(modRules, null, "Sounds", chatLineSound, null);
|
||||
}
|
||||
|
||||
@@ -325,5 +326,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
bool IsNotificationMuted(TextNotification notification)
|
||||
{
|
||||
return Game.Settings.Game.HideReplayChat && world.IsReplay && notification.ClientId != TextNotificationsManager.SystemClientId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
repetitions++;
|
||||
lineToDisplay = new TextNotification(
|
||||
notification.Pool,
|
||||
notification.ClientId,
|
||||
notification.Prefix,
|
||||
$"{notification.Text} ({repetitions + 1})",
|
||||
notification.PrefixColor,
|
||||
|
||||
@@ -74,6 +74,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
if (panel.GetOrNull<CheckboxWidget>("PAUSE_SHELLMAP_CHECKBOX") != null)
|
||||
SettingsUtils.BindCheckboxPref(panel, "PAUSE_SHELLMAP_CHECKBOX", gs, "PauseShellmap");
|
||||
|
||||
SettingsUtils.BindCheckboxPref(panel, "HIDE_REPLAY_CHAT_CHECKBOX", gs, "HideReplayChat");
|
||||
|
||||
var windowModeDropdown = panel.Get<DropDownButtonWidget>("MODE_DROPDOWN");
|
||||
windowModeDropdown.OnMouseDown = _ => ShowWindowModeDropdown(windowModeDropdown, ds, scrollPanel);
|
||||
windowModeDropdown.GetText = () => ds.Mode == WindowMode.Windowed ?
|
||||
|
||||
Reference in New Issue
Block a user