Skip to content

Commit 9e38aa6

Browse files
committed
棒読みちゃんにMildomのスタンプのIDを読んでもらえるようにした
1 parent 031ec45 commit 9e38aa6

File tree

5 files changed

+21
-2
lines changed

5 files changed

+21
-2
lines changed

BouyomiPlugin/ConfigView.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@
484484
<Grid.RowDefinitions>
485485
<RowDefinition />
486486
<RowDefinition />
487+
<RowDefinition />
487488
</Grid.RowDefinitions>
488489
<Grid.ColumnDefinitions>
489490
<ColumnDefinition />
@@ -493,6 +494,7 @@
493494
</Grid.ColumnDefinitions>
494495
<CheckBox x:Name="CheckMildomComment" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4" IsChecked="{Binding IsMildomComment}" Content="コメント" />
495496
<CheckBox IsEnabled="{Binding IsChecked, ElementName=CheckMildomComment}" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" IsChecked="{Binding IsMildomCommentNickname}" Content="コテハン" />
497+
<CheckBox IsEnabled="{Binding IsChecked, ElementName=CheckMildomComment}" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" IsChecked="{Binding IsMildomCommentStampId}" Content="スタンプID" />
496498
</Grid>
497499
<CheckBox Grid.Row="3" IsChecked="{Binding IsMildomJoin}" Content="入室" />
498500
<CheckBox Grid.Row="4" IsChecked="{Binding IsMildomLeave}" Content="退室" />

BouyomiPlugin/ConfigViewModel.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,14 @@ public bool IsMildomCommentNickname
730730
set => _options.IsMildomCommentNickname = value;
731731
}
732732
/// <summary>
733+
/// MildomのコメントのスタンプIDを読み上げるか
734+
/// </summary>
735+
public bool IsMildomCommentStampId
736+
{
737+
get => _options.IsMildomCommentStampId;
738+
set => _options.IsMildomCommentStampId = value;
739+
}
740+
/// <summary>
733741
/// Mildomの入室メッセージを読み上げるか
734742
/// </summary>
735743
public bool IsMildomJoin

BouyomiPlugin/Options.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ class Options : DynamicOptionsBase
116116
public bool IsMildomDisconnect { get { return GetValue(); } set { SetValue(value); } }
117117
public bool IsMildomComment { get { return GetValue(); } set { SetValue(value); } }
118118
public bool IsMildomCommentNickname { get { return GetValue(); } set { SetValue(value); } }
119+
public bool IsMildomCommentStampId { get { return GetValue(); } set { SetValue(value); } }
119120
public bool IsMildomJoin { get { return GetValue(); } set { SetValue(value); } }
120121
public bool IsMildomLeave { get { return GetValue(); } set { SetValue(value); } }
121122

@@ -238,6 +239,7 @@ protected override void Init()
238239
Dict.Add(nameof(IsMildomDisconnect), new Item { DefaultValue = false, Predicate = b => true, Serializer = b => b.ToString(), Deserializer = s => bool.Parse(s) });
239240
Dict.Add(nameof(IsMildomComment), new Item { DefaultValue = true, Predicate = b => true, Serializer = b => b.ToString(), Deserializer = s => bool.Parse(s) });
240241
Dict.Add(nameof(IsMildomCommentNickname), new Item { DefaultValue = true, Predicate = b => true, Serializer = b => b.ToString(), Deserializer = s => bool.Parse(s) });
242+
Dict.Add(nameof(IsMildomCommentStampId), new Item { DefaultValue = false, Predicate = b => true, Serializer = b => b.ToString(), Deserializer = s => bool.Parse(s) });
241243
Dict.Add(nameof(IsMildomJoin), new Item { DefaultValue = false, Predicate = b => true, Serializer = b => b.ToString(), Deserializer = s => bool.Parse(s) });
242244
Dict.Add(nameof(IsMildomLeave), new Item { DefaultValue = false, Predicate = b => true, Serializer = b => b.ToString(), Deserializer = s => bool.Parse(s) });
243245

BouyomiPlugin/main.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,14 @@ private static (string name, string comment) GetData(ISiteMessage message, Optio
573573
{
574574
name = (MildomMessage as IMildomComment).UserName;
575575
}
576-
comment = (MildomMessage as IMildomComment).CommentItems.ToText();
576+
if (options.IsMildomCommentStampId)
577+
{
578+
comment = (MildomMessage as IMildomComment).CommentItems.ToTextWithImageAlt();
579+
}
580+
else
581+
{
582+
comment = (MildomMessage as IMildomComment).CommentItems.ToText();
583+
}
577584
}
578585
break;
579586
case MildomMessageType.JoinRoom:

MildomSitePlugin/MessageProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public static IInternalMessage Parse(string raw, Dictionary<int, string> imageDi
139139
{
140140
messageItems.Add(new Common.MessageImage
141141
{
142-
Alt = "",
142+
Alt = $"[/{item}]",
143143
Height = 40,
144144
Width = 40,
145145
Url = emotUrl,

0 commit comments

Comments
 (0)