OSDN Git Service

Fix: Internal scope flag not changed in synchronized session
authornaru <bottle@mikage.to>
Sun, 20 Apr 2003 11:05:48 +0000 (11:05 +0000)
committernaru <bottle@mikage.to>
Sun, 20 Apr 2003 11:05:48 +0000 (11:05 +0000)
Fix: \n tag does not break the line
Keeps window position

bottleclient/TalkShowFrame.pas

index a4fba76..fb5327f 100644 (file)
@@ -26,6 +26,7 @@ type
       Sur0, Sur1: integer; Talk: String): integer;
     function DrawSingleImage(X, Y, Surface: integer;
       var Height: integer): integer;
+    function DrawSeparateLine(VertPos: integer): integer;
   public
     { Public \90é\8c¾ }
     property SsParser: TSsParser read FSsParser write SetSsParser;
@@ -102,13 +103,15 @@ begin
   //
   for i := 0 to FSsParser.Count-1 do
   begin
-    if (FSsParser[i] = '\h') and UnyuTalking and not InSync then
+    if (FSsParser[i] = '\h') and UnyuTalking then
     begin
-      TalkEnd;
+      if not InSync then
+        TalkEnd;
       UnyuTalking := false;
-    end else if (FSsParser[i] = '\u') and not UnyuTalking and not InSync then
+    end else if (FSsParser[i] = '\u') and not UnyuTalking then
     begin
-      TalkEnd;
+      if not InSync then
+        TalkEnd;
       UnyuTalking := true;
     end else if FSsParser[i] = '\_s' then
     begin
@@ -138,9 +141,13 @@ begin
         sur1 := sur
       else
         sur0 := sur;
-    end else if FSsParser.Match(FSsParser[i], '\n') > 2 then
+    end else if FSsParser.Match(FSsParser[i], '\n') >= 2 then
     begin
       Talk := Talk + #13#10;
+    end else if FSsParser[i] = '\c' then
+    begin
+      TalkEnd;
+      y := y + DrawSeparateLine(y);
     end else if FSsParser.MarkUpType[i] in [mtStr, mtMeta] then
     begin
       Talk := Talk + FSsParser[i];
@@ -235,4 +242,16 @@ begin
   PaintBoxPaint(self);
 end;
 
+function TfrmTalkShow.DrawSeparateLine(VertPos: integer): integer;
+begin
+  with PaintBox.Canvas do
+  begin
+    Pen.Color := Pref.TalkColorH;
+    Pen.Mode := pmCopy;
+    MoveTo(5, VertPos);
+    LineTo(PaintBox.Width-5, VertPos);
+    Result := 4;
+  end;
+end;
+
 end.