Skip to content

Commit

Permalink
[fix]
Browse files Browse the repository at this point in the history
下記のサクラスクリプトに対応。
\n[harf]
\n[50]

置換を追加。
~をーに変更。

修正
読み上げを設定していないキャラが存在した場合、トークが途中で打ち切られるバグを修正。
  • Loading branch information
ambergon committed Jun 12, 2023
1 parent dbc2f60 commit 96b8a05
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions code/Class1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,19 @@ public static void CeVIO_Talk( string SakuraScript , string GhostName ) {
Match m;
m = Regex.Match( line , "^\\\\0" );
if( m.Success ){
if ( Voice1 == "" ){ break; }
if ( Voice1 == "" ){ continue; }
TalkSetting( Voice1 );
}

m = Regex.Match( line , "^\\\\1" );
if( m.Success ){
if ( Voice2 == "" ){ break; }
if ( Voice2 == "" ){ continue; }
TalkSetting( Voice2 );
}

m = Regex.Match( line , "^\\\\p" );
if( m.Success ){
if ( Voice3 == "" ){ break; }
if ( Voice3 == "" ){ continue; }
TalkSetting( Voice3 );
}
//文字列マッチなしだと前回使用したものが使用される。
Expand All @@ -232,6 +232,11 @@ public static void CeVIO_Talk( string SakuraScript , string GhostName ) {
//Console.WriteLine( "Ghost " + GhostName );
//Console.WriteLine( "section " + OldSection );

//\0\1等がなにも指定されていない状態で発生するテキストをカットする。
if( talker.Cast == null ){
continue;
}

SpeakingState2 state = talker.Speak( talkText );
//SpeakingState2 state = talker.Speak( "大好き" );
//終了しないからいらない。
Expand Down Expand Up @@ -296,14 +301,18 @@ public static string ReplaceTalkText( string SakuraScript ){
text = text.Replace( "】" , "" );
text = text.Replace( "?" , "?" );
text = text.Replace( "!" , "!" );
text = text.Replace( "~" , "ー" );
text = text.Replace( " " , " " );
text = text.Replace( "\\h" , "\\0" );
text = text.Replace( "\\u" , "\\1" );
text = text.Replace( "\\0" , ",\\0" );
text = text.Replace( "\\1" , ",\\1" );
//三人目確保
text = Regex.Replace( text , "\\\\p\\[.*?\\]" , ",\\p" );

//改行置換。
text = Regex.Replace( text , "\\\\n\\[half\\]" , "。" );
text = Regex.Replace( text , "\\\\n\\[[0-9].*?\\]" , "。" );
text = Regex.Replace( text , "\\\\n" , "。" );

text = Regex.Replace( text , "\\\\__[a-zA-Z]\\[.*?\\]" , "" );
Expand Down
Binary file modified main.dll
Binary file not shown.

0 comments on commit 96b8a05

Please sign in to comment.