Changeset 53


Ignore:
Timestamp:
Jan 11, 2017, 11:45:22 PM (7 years ago)
Author:
chronos
Message:
  • Fixed: Correctly show normal help page with text content.
  • Fixed: Correctly show watermark image in help.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Direct.pas

    r52 r53  
    128128          ShowModal;
    129129          if ModalResult = mrOK then
    130             OpenURL('http://c-evo.org/_sg/contact/cevobug.html');{ *Převedeno z ShellExecute* }
     130            OpenURL('http://c-evo.org/_sg/contact/cevobug.html');
    131131        end
    132132    *)
  • trunk/LocalPlayer/Help.pas

    r52 r53  
    55
    66uses
    7   Protocol, ScreenTools, BaseWin, StringTables,
    8 
     7  Protocol, ScreenTools, BaseWin, StringTables, Math,
    98  LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms,
    10   ExtCtrls, ButtonB, PVSB, ButtonBase, Types;
     9  ExtCtrls, ButtonB, PVSB, Types;
    1110
    1211const
     
    4443    procedure AddLine(s: String = ''; Format: integer = 0; Picpix: integer = 0;
    4544      LinkCategory: integer = 0; LinkIndex: integer = 0);
    46     procedure AddText(Const S : String); override;
    4745    procedure LF;
    4846    destructor Destroy; override;
     
    128126end;
    129127
    130 procedure THyperText.AddText(const S: String);
    131 begin
    132   AddLine(S);
    133 end;
    134 
    135128procedure THyperText.LF;
    136129begin
     
    381374  ySrc := (iix div 7 + 1) * ySizeBig;
    382375  for y := 0 to ySizeBig * 2 - 1 do
    383     if (y0 + y >= 0) and (y0 + y < InnerHeight) then
    384     begin
     376    if ((y0 + y) >= 0) and ((y0 + y) < InnerHeight) then begin
    385377      PaintPtr.Init(OffScreen, 0, y0 + y);
    386378      CoalPtr.Init(Templates, 0, yCoal + y);
    387379      for dy := -1 to 1 do
    388         if ((y + dy) shr 1 >= 0) and ((y + dy) shr 1 < ySizeBig) then
    389           ImpPtr[dy].Init(BigImp, 0, ySrc + (y + dy) shr 1);
    390       for x := 0 to xSizeBig * 2 - 1 do
    391       begin
     380        if ((Max(y + dy, 0) shr 1) >= 0) and ((Max(y + dy, 0) shr 1) < ySizeBig) then
     381          ImpPtr[dy].Init(BigImp, 0, ySrc + (Max(y + dy, 0) shr 1));
     382      for x := 0 to xSizeBig * 2 - 1 do begin
    392383        sum := 0;
    393         for dx := -1 to 1 do
    394         begin
    395           xx := xSrc + (x + dx) shr 1;
    396           ImpPtr[dy].SetX(xx);
    397           for dy := -1 to 1 do
     384        for dx := -1 to 1 do begin
     385          xx := xSrc + Max((x + dx), 0) shr 1;
     386          for dy := -1 to 1 do begin
     387            ImpPtr[dy].SetX(xx);
    398388            if ((y + dy) shr 1 < 0) or ((y + dy) shr 1 >= ySizeBig) or
    399389              ((x + dx) shr 1 < 0) or ((x + dx) shr 1 >= xSizeBig) or
     
    405395              sum := sum + ImpPtr[dy].Pixel^.B + 5 * ImpPtr[dy].Pixel^.G + 3 *
    406396                ImpPtr[dy].Pixel^.R;
     397          end;
    407398        end;
    408         if sum < maxsum then
    409         begin // no saturation
     399        if sum < maxsum then begin // no saturation
    410400          CoalPtr.SetX(xCoal + x);
    411401          sum := 1 shl 22 - (maxsum - sum) * (256 - CoalPtr.Pixel^.B * 2);
     
    447437  HelpLineInfo: THelpLineInfo;
    448438begin
     439  MainText.SaveToFile('MainText.txt');
    449440  inherited;
    450441  CaptionColor := Colors.Canvas.Pixels[clkMisc, cliPaperCaption];
     
    465456          BitBlt(Handle, 8, 4 + i * 24, ExtPic.Width, yl, ExtPic.Canvas.Handle,
    466457            0, 0, SRCCOPY);
    467         end
     458        end;
    468459      end;
    469460    for i := -2 to InnerHeight div 24 do
     
    916907  end;
    917908
    918   procedure AddText(s: string);
     909  procedure AddTextual(s: string);
    919910  var
    920911    i, p, l, ofs, CurrentFormat, FollowFormat, Picpix, LinkCategory, LinkIndex,
     
    10771068  procedure AddItem(Item: string);
    10781069  begin
    1079     AddText(HelpText.Lookup(Item));
     1070    AddTextual(HelpText.Lookup(Item));
    10801071  end;
    10811072
     
    11071098      s := HelpText.LookupByHandle(hSPECIALMODEL, i);
    11081099      if (s <> '') and (s <> '*') then
    1109         AddText(s);
     1100        AddTextual(s);
    11101101      if SpecialModelPreq[i] >= 0 then
    11111102        AddPreqAdv(SpecialModelPreq[i])
     
    11391130        AddLine('', pkTerImp, i);
    11401131        AddLine;
    1141         AddText(HelpText.LookupByHandle(hJOBHELP, i));
     1132        AddTextual(HelpText.LookupByHandle(hJOBHELP, i));
    11421133        JobCost := -1;
    11431134        case JobHelp[i] of
     
    11501141        end;
    11511142        if JobCost >= 0 then
    1152           AddText(Format(HelpText.Lookup('JOBCOST'),
     1143          AddTextual(Format(HelpText.Lookup('JOBCOST'),
    11531144            [MovementToString(JobCost)]))
    11541145        else
    1155           AddText(HelpText.Lookup('JOBCOSTVAR'));
     1146          AddTextual(HelpText.Lookup('JOBCOSTVAR'));
    11561147        if JobPreq[JobHelp[i]] <> preNone then
    11571148        begin
     
    12411232    case Kind of
    12421233      hkText:
    1243         AddText(HelpText.LookupByHandle(no));
     1234        AddTextual(HelpText.LookupByHandle(no));
    12441235      hkMisc:
    12451236        begin
     
    13001291                NextSection('CRED_CAPAI');
    13011292                Server(sGetAICredits, 0, 0, ps);
    1302                 AddText(ps);
     1293                AddTextual(ps);
    13031294                NextSection('CRED_CAPLANG');
    13041295                AddItem('AUTHOR');
     
    13251316                    AddLine('', pkBigIcon, i + 6);
    13261317                  LF;
    1327                   AddText(HelpText.LookupByHandle(hGOVHELP, i mod nGov));
     1318                  AddTextual(HelpText.LookupByHandle(hGOVHELP, i mod nGov));
    13281319                  if i mod nGov >= 2 then
    13291320                  begin
     
    13421333              begin
    13431334                Caption := HelpText.Lookup('HELPTITLE_SEARCHRESULTS');
    1344                 AddText(Format(HelpText.Lookup('MATCHES'), [SearchContent]));
     1335                AddTextual(Format(HelpText.Lookup('MATCHES'), [SearchContent]));
    13451336                MainText.AddStrings(SearchResult);
    13461337              end
     
    14581449          s := HelpText.LookupByHandle(hADVHELP, no);
    14591450          if s <> '*' then
    1460             AddText(s);
     1451            AddTextual(s);
    14611452          NextSection('SEEALSO');
    14621453          CheckSeeAlso := true
     
    15211512          begin
    15221513            NextSection('EFFECT');
    1523             AddText(HelpText.LookupByHandle(hIMPHELP, no));
     1514            AddTextual(HelpText.LookupByHandle(hIMPHELP, no));
    15241515          end;
    15251516          if no = woSun then
     
    15331524            LF;
    15341525            if Imp[no].Expiration >= 0 then
    1535               AddText(Phrases2.Lookup('HELP_WONDERMORALE1'))
     1526              AddTextual(Phrases2.Lookup('HELP_WONDERMORALE1'))
    15361527            else
    1537               AddText(Phrases2.Lookup('HELP_WONDERMORALE2'));
     1528              AddTextual(Phrases2.Lookup('HELP_WONDERMORALE2'));
    15381529          end;
    15391530          if Imp[no].Preq <> preNone then
     
    15821573            if no = woPyramids then
    15831574              s := s + ' ' + HelpText.Lookup('EXPSLAVE');
    1584             AddText(s);
     1575            AddTextual(s);
    15851576          end;
    15861577          NextSection('SEEALSO');
     
    16481639            begin
    16491640              LF;
    1650               AddText(HelpText.Lookup('DEADLANDS'));
     1641              AddTextual(HelpText.Lookup('DEADLANDS'));
    16511642            end;
    16521643            if (TerrType = fDesert) and (no <> fDesert + 12) then
    16531644            begin
    16541645              LF;
    1655               AddText(Format(HelpText.Lookup('HOSTILE'), [DesertThurst]));
     1646              AddTextual(Format(HelpText.Lookup('HOSTILE'), [DesertThurst]));
    16561647            end;
    16571648            if TerrType = fArctic then
    16581649            begin
    16591650              LF;
    1660               AddText(Format(HelpText.Lookup('HOSTILE'), [ArcticThurst]));
     1651              AddTextual(Format(HelpText.Lookup('HOSTILE'), [ArcticThurst]));
    16611652            end;
    16621653            if (no < 3 * 12) and (TransTerrain >= 0) then
     
    17241715            begin
    17251716              LF;
    1726               AddText(HelpText.Lookup('RARE'));
     1717              AddTextual(HelpText.Lookup('RARE'));
    17271718            end;
    17281719            if (no < 3 * 12) and (TerrType in [fDesert, fArctic]) then
     
    17861777            AddLine(HelpText.Lookup('HELPSPEC_FEATURE'));
    17871778          NextSection('EFFECT');
    1788           AddText(HelpText.LookupByHandle(hFEATUREHELP, no));
     1779          AddTextual(HelpText.LookupByHandle(hFEATUREHELP, no));
    17891780          if (Feature[no].Weight <> 0) or (Feature[no].Cost <> 0) then
    17901781          begin
     
    19201911      if Link shr 8 and $3F = hkInternet then
    19211912        case Link and $FF of
    1922           1:
    1923              OpenDocument(pchar(HomeDir + 'AI Template' + DirectorySeparator + 'AI development manual.html'));{ *Převedeno z ShellExecute* }
    1924           2:
    1925             OpenURL('http://c-evo.org');{ *Převedeno z ShellExecute* }
    1926           3:
    1927             OpenURL('http://c-evo.org/_sg/contact');{ *Převedeno z ShellExecute* }
     1913          1: OpenDocument(pchar(HomeDir + 'AI Template' + DirectorySeparator + 'AI development manual.html'));
     1914          2: OpenURL('http://c-evo.org');
     1915          3: OpenURL('http://c-evo.org/_sg/contact');
    19281916        end
    19291917      else
  • trunk/LocalPlayer/Term.pas

    r52 r53  
    68606860  end
    68616861  else if Sender = mWebsite then
    6862     OpenURL('http://c-evo.org') { *Převedeno z ShellExecute* }
     6862    OpenURL('http://c-evo.org')
    68636863  else if Sender = mRandomMap then
    68646864  begin
  • trunk/Start.pas

    r52 r53  
    15651565      maConfig:
    15661566        begin
    1567            OpenDocument(pchar(HomeDir + 'Configurator.exe'));{ *Převedeno z ShellExecute* }
     1567           OpenDocument(pchar(HomeDir + 'Configurator.exe'));
    15681568          Close
    15691569        end;
     
    15731573        DirectHelp(cStartCredits);
    15741574      maAIDev:
    1575          OpenDocument(pchar(HomeDir + 'AI Template' + DirectorySeparator + 'AI development manual.html'));{ *Převedeno z ShellExecute* }
     1575         OpenDocument(pchar(HomeDir + 'AI Template' + DirectorySeparator + 'AI development manual.html'));
    15761576      maWeb:
    1577         OpenURL('http://c-evo.org'){ *Převedeno z ShellExecute* }
     1577        OpenURL('http://c-evo.org')
    15781578    end;
    15791579  end
Note: See TracChangeset for help on using the changeset viewer.