Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

軽微な修正とNX-Jikkyoの本家コメを無効にするオプションの追加 #109

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions TVTComment/Model/ChatModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class ChatModule : IDisposable
public ObservableValue<bool> ClearChatsOnChannelChange { get; } = new ObservableValue<bool>();
public ObservableValue<bool> NgCommentNotShow { get; } = new ObservableValue<bool>();
public ObservableValue<bool> UiFlashingDeterrence { get; } = new ObservableValue<bool>();
public ObservableValue<bool> NXJikkyoImportDisable { get; } = new ObservableValue<bool>();

private readonly ObservableCollection<Chat> chats = new ObservableCollection<Chat>();
public ReadOnlyObservableCollection<Chat> Chats { get; }
Expand Down Expand Up @@ -83,6 +84,10 @@ private async void CollectServiceModule_NewChatProduced(IEnumerable<Chat> newCha
foreach (Chat chat in newChats)
{
ApplyChatModRule(chat);
if (NXJikkyoImportDisable.Value && chat.UserId.StartsWith("nicolive:"))
{
continue;
}

if (ChatPreserveCount.Value > 0)
{
Expand Down Expand Up @@ -137,6 +142,7 @@ private void LoadSettings()
ChatPreserveCount.Value = settings.ChatPreserveCount;
ClearChatsOnChannelChange.Value = settings.ClearChatsOnChannelChange;
NgCommentNotShow.Value = settings.NgCommentNotShow;
NXJikkyoImportDisable.Value = settings.NXJikkyoImportDisable;
UiFlashingDeterrence.Value = settings.UiFlashingDeterrence;
var chatCollectServiceEntries = chatServices.SelectMany(x => x.ChatCollectServiceEntries).ToArray();
var entities = settings.ChatModRules;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private ChatNiconicoCommentXmlTag GetChatTag(ChunkedMessage msg)
string userId;
if (chat.HasRawUserId)
{
userId = $"{chat.RawUserId} (${chat.Name})";
userId = $"{chat.RawUserId} ({chat.Name})";
}
else
{
Expand Down
1 change: 1 addition & 0 deletions TVTComment/Model/TVTCommentSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class TVTCommentSettings
public int ChatPreserveCount { get; set; } = 10000;
public bool ClearChatsOnChannelChange { get; set; } = false;
public bool NgCommentNotShow { get; set; } = false;
public bool NXJikkyoImportDisable { get; set; } = false;
public bool UiFlashingDeterrence { get; set; } = false;
public Serialization.ChatModRuleEntity[] ChatModRules { get; set; } = System.Array.Empty<Serialization.ChatModRuleEntity>();
public bool UseDefaultChatCollectService { get; set; } = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class BasicSettingControlViewModel : IDisposable, INotifyPropertyChanged
public ObservableValue<bool> NgCommentNotShow { get; private set; }
public ObservableValue<bool> UiFlashingDeterrence { get; private set; }
public ObservableValue<double> WindowFontSize { get; } = new ObservableValue<double>(1.2);
public ObservableValue<bool> NXJikkyoImportDisable { get; private set; }

public DelegateCommand<int?> SetChatCollectTimeAdjustment { get; private set; }
public DelegateCommand<int?> AddChatCollectTimeAdjustment { get; private set; }
Expand Down Expand Up @@ -55,6 +56,7 @@ public async Task Initialize()
ClearChatsOnChannelChange = model.ChatModule.ClearChatsOnChannelChange;
NgCommentNotShow = model.ChatModule.NgCommentNotShow;
UiFlashingDeterrence = model.ChatModule.UiFlashingDeterrence;
NXJikkyoImportDisable = model.ChatModule.NXJikkyoImportDisable;

ChatCollectTimeAdjustment = model.ChatCollectServiceModule.TimeAdjustment;

Expand Down
6 changes: 6 additions & 0 deletions TVTComment/Views/ShellContents/BasicSettingControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@
<CheckBox IsChecked="{Binding NgCommentNotShow.Value}" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="1">NGコメントのログを非表示にする</CheckBox>
</Grid>
</GroupBox>

<GroupBox Header="NX-Jikkyo設定">
<Grid local:Grid.Shape="*:auto,auto">
<CheckBox IsChecked="{Binding NXJikkyoImportDisable.Value}" VerticalAlignment="Center" HorizontalAlignment="Left">ニコニコ実況からのコメントを表示しない</CheckBox>
</Grid>
</GroupBox>
<Button Content="その他設定">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
Expand Down