Skip to content

Commit f67a8f3

Browse files
committed
Mildomのギフトを棒読みちゃんに読んでもらえるようにした
1 parent 9e38aa6 commit f67a8f3

File tree

3 files changed

+42
-9
lines changed

3 files changed

+42
-9
lines changed

BouyomiPlugin/ConfigView.xaml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@
477477
<RowDefinition />
478478
<RowDefinition />
479479
<RowDefinition />
480+
<RowDefinition />
480481
</Grid.RowDefinitions>
481482
<CheckBox Grid.Row="0" IsChecked="{Binding IsMildomConnect}" Content="接続" />
482483
<CheckBox Grid.Row="1" IsChecked="{Binding IsMildomDisconnect}" Content="切断" />
@@ -496,8 +497,24 @@
496497
<CheckBox IsEnabled="{Binding IsChecked, ElementName=CheckMildomComment}" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" IsChecked="{Binding IsMildomCommentNickname}" Content="コテハン" />
497498
<CheckBox IsEnabled="{Binding IsChecked, ElementName=CheckMildomComment}" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" IsChecked="{Binding IsMildomCommentStampId}" Content="スタンプID" />
498499
</Grid>
499-
<CheckBox Grid.Row="3" IsChecked="{Binding IsMildomJoin}" Content="入室" />
500-
<CheckBox Grid.Row="4" IsChecked="{Binding IsMildomLeave}" Content="退室" />
500+
501+
<Grid Grid.Row="3">
502+
<Grid.RowDefinitions>
503+
<RowDefinition />
504+
<RowDefinition />
505+
<RowDefinition />
506+
</Grid.RowDefinitions>
507+
<Grid.ColumnDefinitions>
508+
<ColumnDefinition />
509+
<ColumnDefinition />
510+
<ColumnDefinition />
511+
<ColumnDefinition />
512+
</Grid.ColumnDefinitions>
513+
<CheckBox x:Name="CheckMildomGift" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4" IsChecked="{Binding IsMildomComment}" Content="ギフト" />
514+
<CheckBox IsEnabled="{Binding IsChecked, ElementName=CheckMildomGift}" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" IsChecked="{Binding IsMildomGiftNickname}" Content="コテハン" />
515+
</Grid>
516+
<CheckBox Grid.Row="4" IsChecked="{Binding IsMildomJoin}" Content="入室" />
517+
<CheckBox Grid.Row="5" IsChecked="{Binding IsMildomLeave}" Content="退室" />
501518
</Grid>
502519
</Border>
503520

BouyomiPlugin/Options.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ class Options : DynamicOptionsBase
119119
public bool IsMildomCommentStampId { get { return GetValue(); } set { SetValue(value); } }
120120
public bool IsMildomJoin { get { return GetValue(); } set { SetValue(value); } }
121121
public bool IsMildomLeave { get { return GetValue(); } set { SetValue(value); } }
122+
public bool IsMildomGift { get { return GetValue(); } set { SetValue(value); } }
123+
public bool IsMildomGiftNickname { get { return GetValue(); } set { SetValue(value); } }
122124

123125
//ShowRoom
124126
public bool IsShowRoomComment { get { return GetValue(); } set { SetValue(value); } }
@@ -242,6 +244,9 @@ protected override void Init()
242244
Dict.Add(nameof(IsMildomCommentStampId), new Item { DefaultValue = false, Predicate = b => true, Serializer = b => b.ToString(), Deserializer = s => bool.Parse(s) });
243245
Dict.Add(nameof(IsMildomJoin), new Item { DefaultValue = false, Predicate = b => true, Serializer = b => b.ToString(), Deserializer = s => bool.Parse(s) });
244246
Dict.Add(nameof(IsMildomLeave), new Item { DefaultValue = false, Predicate = b => true, Serializer = b => b.ToString(), Deserializer = s => bool.Parse(s) });
247+
Dict.Add(nameof(IsMildomGift), new Item { DefaultValue = true, Predicate = b => true, Serializer = b => b.ToString(), Deserializer = s => bool.Parse(s) });
248+
Dict.Add(nameof(IsMildomGiftNickname), new Item { DefaultValue = true, Predicate = b => true, Serializer = b => b.ToString(), Deserializer = s => bool.Parse(s) });
249+
245250

246251
//ShowRoom
247252
Dict.Add(nameof(IsShowRoomComment), new Item { DefaultValue = true, Predicate = b => true, Serializer = b => b.ToString(), Deserializer = s => bool.Parse(s) });

BouyomiPlugin/main.cs

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -590,13 +590,24 @@ private static (string name, string comment) GetData(ISiteMessage message, Optio
590590
comment = (MildomMessage as IMildomJoinRoom).CommentItems.ToText();
591591
}
592592
break;
593-
//case MildomMessageType.Leave:
594-
// if (_options.IsMildomLeave)
595-
// {
596-
// name = null;
597-
// comment = (MildomMessage as IMildomLeave).CommentItems.ToText();
598-
// }
599-
// break;
593+
//case MildomMessageType.Leave:
594+
// if (_options.IsMildomLeave)
595+
// {
596+
// name = null;
597+
// comment = (MildomMessage as IMildomLeave).CommentItems.ToText();
598+
// }
599+
// break;
600+
case MildomMessageType.Gift:
601+
if (options.IsMildomGift)
602+
{
603+
if (options.IsMildomGiftNickname)
604+
{
605+
name = (MildomMessage as IMildomGift).UserName;
606+
}
607+
var giftName = ((IMildomGift)MildomMessage).GiftName;
608+
comment = $"{giftName}を贈りました";
609+
}
610+
break;
600611
}
601612
}
602613
else if (message is IShowRoomMessage showroomMessage)

0 commit comments

Comments
 (0)