Changeset 529 for trunk/LocalPlayer


Ignore:
Timestamp:
Jan 14, 2024, 12:07:05 AM (10 months ago)
Author:
chronos
Message:
  • Fixed: First letter in help page titles were not correctly read as UTF8 character.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Help.pas

    r506 r529  
    55
    66uses
    7   Protocol, ScreenTools, BaseWin, StringTables, Math, LCLIntf, LCLType, Messages,
     7  LazUTF8, Protocol, ScreenTools, BaseWin, StringTables, Math, LCLIntf, LCLType, Messages,
    88  SysUtils, Classes, ButtonB, PVSB, Types, Generics.Collections, IsoEngine,
    99  {$IFDEF DPI}Dpi.Graphics, Dpi.Controls, Dpi.Forms, Dpi.ExtCtrls, Dpi.Common,
     
    380380  TextSize: TSize;
    381381  S: string;
     382  FirstLetter: string;
    382383begin
    383384  S := MainText[ScrollBar.Position + I];
     
    395396  begin
    396397    ACanvas.Font.Assign(CaptionFont);
    397     { ACanvas.brush.color:=CaptionColor;
    398       ACanvas.FillRect(rect(X,I*24,X+24,I*24+24));
    399       ACanvas.Brush.Color:=$FFFFFF;
    400       ACanvas.FrameRect(rect(X+1,I*24+1,X+24-1,I*24+24-1));
    401       ACanvas.Brush.Style:=bsClear; }
     398    { ACanvas.Brush.Color := CaptionColor;
     399      ACanvas.FillRect(Rect(X, I * 24, X + 24, I * 24 + 24));
     400      ACanvas.Brush.Color := $FFFFFF;
     401      ACanvas.FrameRect(Rect(X + 1, I * 24 + 1, X + 24 - 1, I * 24 + 24 - 1));
     402      ACanvas.Brush.Style := bsClear; }
    402403    BitBltCanvas(ACanvas, X, Y - 4, 24, 24, HGrSystem.Data.Canvas, 1,
    403404      146);
    404     BiColorTextOut(ACanvas, $FFFFFF, $7F007F, X + 10 - ACanvas.TextWidth(S[1]) div 2,
    405       Y - 3, S[1]);
    406     BiColorTextOut(ACanvas, CaptionColor, $7F007F, X + 24, Y - 3, Copy(S, 2, 255));
     405    FirstLetter := UTF8Copy(S, 1, 1);
     406    S := UTF8Copy(S, 2, MaxInt);
     407    BiColorTextOut(ACanvas, $FFFFFF, $7F007F, X + 10 - ACanvas.TextWidth(FirstLetter) div 2,
     408      Y - 3, FirstLetter);
     409    BiColorTextOut(ACanvas, CaptionColor, $7F007F, X + 24, Y - 3, S);
    407410    ACanvas.Font.Assign(UniFont[ftNormal]);
    408411  end
     
    15681571        begin // complete nat. project list
    15691572          Caption := HelpText.Lookup('HELPTITLE_UNIQUELIST');
    1570           // AddLine(HelpText.Lookup('HELPTITLE_UNIQUELIST'),pkSection);
     1573          // AddLine(HelpText.Lookup('HELPTITLE_UNIQUELIST'), pkSection);
    15711574          for I := nWonder to nImp - 1 do
    15721575            if (Imp[I].Preq <> preNA) and
     
    15761579          { LineFeed;
    15771580            LineFeed;
    1578             AddLine(HelpText.Lookup('HELPTITLE_SHIPPARTLIST'),pkSection);
    1579             for I:= nWonder to nImp-1 do
    1580             if (Imp[I].Preq<>preNA) and (Imp[I].Kind=ikShipPart) then
    1581             AddLine(Phrases.Lookup('IMPROVEMENTS',I),pkSmallIcon,I,hkImp,I); }
     1581            AddLine(HelpText.Lookup('HELPTITLE_SHIPPARTLIST'), pkSection);
     1582            for I := nWonder to nImp - 1 do
     1583            if (Imp[I].Preq <> preNA) and (Imp[I].Kind = ikShipPart) then
     1584            AddLine(Phrases.Lookup('IMPROVEMENTS', I), pkSmallIcon, I, hkImp, I); }
    15821585        end
    15831586        else if No = 202 then
Note: See TracChangeset for help on using the changeset viewer.