procedure TfrmLog.UpdateScriptConversationColor(const Script: String);
var i: integer;
scr: String;
- UnyuTalking, Talked: boolean;
+ UnyuTalking, Talked, InSynchronized: boolean;
begin
scr := Script;
frmSender.DoTrans(scr, [toConvertURL]);
edtScript.Text := '';
edtScript.Color := Pref.BgColor;
for i := 0 to SsParser.Count-1 do begin
+ if (SsParser[i] = '\_s') and not InSynchronized then begin
+ InSynchronized := true;
+ if Talked then begin
+ edtScript.SelText := #13#10;
+ Talked := false;
+ end;
+ end else if (SsParser[i] = '\_s') and InSynchronized then begin
+ InSynchronized := false;
+ if Talked then begin
+ edtScript.SelText := #13#10;
+ Talked := false;
+ end;
+ end;
if (SsParser[i] = '\u') and not UnyuTalking then begin
UnyuTalking := true;
if Talked then begin
end;
end;
if SsParser.MarkUpType[i] = mtStr then begin
- if UnyuTalking then
+ if InSynchronized then
+ edtScript.SelAttributes.Color := Pref.TalkColorS
+ else if UnyuTalking then
edtScript.SelAttributes.Color := Pref.TalkColorU
else
edtScript.SelAttributes.Color := Pref.TalkColorH;
procedure TfrmLog.UpdateScriptScript(const Script: String);
var
- UnyuTalking: boolean;
+ UnyuTalking, InSynchronized: boolean;
i: integer;
begin
if Pref.ColorScript then begin
edtScript.Text := '';
edtScript.SelAttributes.Color := clWindowText;
UnyuTalking := false;
+ InSynchronized := false;
for i := 0 to SsParser.Count-1 do begin
if Pref.ColorScript then begin
case SsParser.MarkUpType[i] of
mtStr: begin
- if UnyuTalking then
+ if InSynchronized then
+ edtScript.SelAttributes.Color := Pref.TalkColorS
+ else if UnyuTalking then
edtScript.SelAttributes.Color := Pref.TalkColorU
else
edtScript.SelAttributes.Color := Pref.TalkColorH;
if SsParser[i] = '\h' then
UnyuTalking := false
else if SsParser[i] = '\u' then
- UnyuTalking := true;
+ UnyuTalking := true
+ else if SsParser[i] = '\_s' then
+ InSynchronized := not InSynchronized;
end;
mtMeta: edtScript.SelAttributes.Color := Pref.MetaWordColor;
mtTagErr: edtScript.SelAttributes.Color := Pref.MarkErrorColor;
//\83X\83N\83\8a\83v\83g\90F\95ª\82¯\97p\82Ì\95Ï\90\94
FRequireColoring: boolean;
FUnyuTalking: boolean;
+ FInSynchronized: boolean;
FLastSurfaceH: integer;
FLastSurfaceU: integer;
FColoringPos: integer; //\90F\95ª\82¯\8dÏ\82Ý\82Ì\83X\83N\83\8a\83v\83g\82Ì\83o\83C\83g\90\94
function TfrmSender.T2C: TColor;
begin
- if FUnyuTalking then Result := Pref.TalkColorU else Result := Pref.TalkColorH;
+ if FInSynchronized then Result := Pref.TalkColorS
+ else if FUnyuTalking then Result := Pref.TalkColorU else Result := Pref.TalkColorH;
end;
if FColoredElements >= SsParser.Count then Break;
if SsParser[FColoredElements] = '\u' then FUnyuTalking := true;
if SsParser[FColoredElements] = '\h' then FUnyuTalking := false;
+ if SsParser[FColoredElements] = '\_s' then FInSynchronized := not FInSynchronized;
case SsParser.MarkUpType[FColoredElements] of
mtTag: Col := Pref.MarkUpColor;
mtTagErr: Col := Pref.MarkErrorColor;
FColoringPos := 0;
FColoredElements := 0;
FUnyuTalking := false;
+ FInSynchronized := false;
FLastSurfaceH := 0;
FLastSurfaceU := 10;
FRequireColoring := true;