hedgewars/uStore.pas
changeset 14000 6938cab93016
parent 13982 4355b8c4099e
child 14001 3183c4dc6e53
equal deleted inserted replaced
13999:3ae88a9f9dca 14000:6938cab93016
   934 var tmpsurf: PSDL_SURFACE;
   934 var tmpsurf: PSDL_SURFACE;
   935     w, h, i, j: LongInt;
   935     w, h, i, j: LongInt;
   936     font: THWFont;
   936     font: THWFont;
   937     r, r2: TSDL_Rect;
   937     r, r2: TSDL_Rect;
   938     wa, ha: LongInt;
   938     wa, ha: LongInt;
   939     tmpline, tmpline2, tmpdesc: ansistring;
   939     tmpline, tmpline2, tmpline3, tmpdesc: ansistring;
   940 begin
   940 begin
   941 // make sure there is a caption as well as a sub caption - description is optional
   941 // make sure there is a caption as well as a sub caption - description is optional
   942 if length(caption) = 0 then
   942 if length(caption) = 0 then
   943     caption:= ansistring('???');
   943     caption:= ansistring('???');
   944 if length(subcaption) = 0 then
   944 if length(subcaption) = 0 then
  1021     tmpline:= tmpdesc;
  1021     tmpline:= tmpdesc;
  1022     SplitByCharA(tmpline, tmpdesc, '|');
  1022     SplitByCharA(tmpline, tmpdesc, '|');
  1023     r2:= r;
  1023     r2:= r;
  1024     if length(tmpline) > 0 then
  1024     if length(tmpline) > 0 then
  1025         begin
  1025         begin
  1026         r:= WriteInRect(tmpsurf, cFontBorder + 2, r.y + r.h, $ff707070, font, PChar(tmpline));
  1026 
  1027 
  1027         // Render highlighted caption if there is a ':',
  1028         // render highlighted caption (if there is a ':')
  1028         // from the beginning of the line to (and including) the ':'.
       
  1029         // With '::', the colons will be suppressed in the final text.
  1029         tmpline2:= _S'';
  1030         tmpline2:= _S'';
  1030         SplitByCharA(tmpline, tmpline2, ':');
  1031         SplitByCharA(tmpline, tmpline2, ':');
  1031         if length(tmpline2) > 0 then
  1032         if length(tmpline2) > 0 then
  1032             begin
  1033             begin
  1033             tmpline:= tmpline + ':';
  1034             if (tmpline2[1] <> ':') then
       
  1035                 begin
       
  1036                 tmpline:= tmpline + ':';
       
  1037                 tmpline3:= tmpline + tmpline2;
       
  1038                 end
       
  1039             else
       
  1040                 tmpline3:= tmpline + Copy(tmpline2, 2, Length(tmpline2)-1);
       
  1041             r:= WriteInRect(tmpsurf, cFontBorder + 2, r.y + r.h, $ff707070, font, PChar(tmpline3));
  1034             WriteInRect(tmpsurf, cFontBorder + 2, r2.y + r2.h, $ffc7c7c7, font, PChar(tmpline));
  1042             WriteInRect(tmpsurf, cFontBorder + 2, r2.y + r2.h, $ffc7c7c7, font, PChar(tmpline));
  1035             end;
  1043             end
  1036         end
  1044         else
       
  1045             r:= WriteInRect(tmpsurf, cFontBorder + 2, r.y + r.h, $ff707070, font, PChar(tmpline));
       
  1046         end;
  1037     end;
  1047     end;
  1038 
  1048 
  1039 if length(extra) > 0 then
  1049 if length(extra) > 0 then
  1040     r:= WriteInRect(tmpsurf, cFontBorder + 2, r.y + r.h, extracolor, font, PChar(extra));
  1050     r:= WriteInRect(tmpsurf, cFontBorder + 2, r.y + r.h, extracolor, font, PChar(extra));
  1041 
  1051