Changeset 53 for trunk/LocalPlayer
- Timestamp:
- Jan 11, 2017, 11:45:22 PM (8 years ago)
- Location:
- trunk/LocalPlayer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Help.pas
r52 r53 5 5 6 6 uses 7 Protocol, ScreenTools, BaseWin, StringTables, 8 7 Protocol, ScreenTools, BaseWin, StringTables, Math, 9 8 LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms, 10 ExtCtrls, ButtonB, PVSB, ButtonBase,Types;9 ExtCtrls, ButtonB, PVSB, Types; 11 10 12 11 const … … 44 43 procedure AddLine(s: String = ''; Format: integer = 0; Picpix: integer = 0; 45 44 LinkCategory: integer = 0; LinkIndex: integer = 0); 46 procedure AddText(Const S : String); override;47 45 procedure LF; 48 46 destructor Destroy; override; … … 128 126 end; 129 127 130 procedure THyperText.AddText(const S: String);131 begin132 AddLine(S);133 end;134 135 128 procedure THyperText.LF; 136 129 begin … … 381 374 ySrc := (iix div 7 + 1) * ySizeBig; 382 375 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 385 377 PaintPtr.Init(OffScreen, 0, y0 + y); 386 378 CoalPtr.Init(Templates, 0, yCoal + y); 387 379 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 392 383 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); 398 388 if ((y + dy) shr 1 < 0) or ((y + dy) shr 1 >= ySizeBig) or 399 389 ((x + dx) shr 1 < 0) or ((x + dx) shr 1 >= xSizeBig) or … … 405 395 sum := sum + ImpPtr[dy].Pixel^.B + 5 * ImpPtr[dy].Pixel^.G + 3 * 406 396 ImpPtr[dy].Pixel^.R; 397 end; 407 398 end; 408 if sum < maxsum then 409 begin // no saturation 399 if sum < maxsum then begin // no saturation 410 400 CoalPtr.SetX(xCoal + x); 411 401 sum := 1 shl 22 - (maxsum - sum) * (256 - CoalPtr.Pixel^.B * 2); … … 447 437 HelpLineInfo: THelpLineInfo; 448 438 begin 439 MainText.SaveToFile('MainText.txt'); 449 440 inherited; 450 441 CaptionColor := Colors.Canvas.Pixels[clkMisc, cliPaperCaption]; … … 465 456 BitBlt(Handle, 8, 4 + i * 24, ExtPic.Width, yl, ExtPic.Canvas.Handle, 466 457 0, 0, SRCCOPY); 467 end 458 end; 468 459 end; 469 460 for i := -2 to InnerHeight div 24 do … … 916 907 end; 917 908 918 procedure AddText (s: string);909 procedure AddTextual(s: string); 919 910 var 920 911 i, p, l, ofs, CurrentFormat, FollowFormat, Picpix, LinkCategory, LinkIndex, … … 1077 1068 procedure AddItem(Item: string); 1078 1069 begin 1079 AddText (HelpText.Lookup(Item));1070 AddTextual(HelpText.Lookup(Item)); 1080 1071 end; 1081 1072 … … 1107 1098 s := HelpText.LookupByHandle(hSPECIALMODEL, i); 1108 1099 if (s <> '') and (s <> '*') then 1109 AddText (s);1100 AddTextual(s); 1110 1101 if SpecialModelPreq[i] >= 0 then 1111 1102 AddPreqAdv(SpecialModelPreq[i]) … … 1139 1130 AddLine('', pkTerImp, i); 1140 1131 AddLine; 1141 AddText (HelpText.LookupByHandle(hJOBHELP, i));1132 AddTextual(HelpText.LookupByHandle(hJOBHELP, i)); 1142 1133 JobCost := -1; 1143 1134 case JobHelp[i] of … … 1150 1141 end; 1151 1142 if JobCost >= 0 then 1152 AddText (Format(HelpText.Lookup('JOBCOST'),1143 AddTextual(Format(HelpText.Lookup('JOBCOST'), 1153 1144 [MovementToString(JobCost)])) 1154 1145 else 1155 AddText (HelpText.Lookup('JOBCOSTVAR'));1146 AddTextual(HelpText.Lookup('JOBCOSTVAR')); 1156 1147 if JobPreq[JobHelp[i]] <> preNone then 1157 1148 begin … … 1241 1232 case Kind of 1242 1233 hkText: 1243 AddText (HelpText.LookupByHandle(no));1234 AddTextual(HelpText.LookupByHandle(no)); 1244 1235 hkMisc: 1245 1236 begin … … 1300 1291 NextSection('CRED_CAPAI'); 1301 1292 Server(sGetAICredits, 0, 0, ps); 1302 AddText (ps);1293 AddTextual(ps); 1303 1294 NextSection('CRED_CAPLANG'); 1304 1295 AddItem('AUTHOR'); … … 1325 1316 AddLine('', pkBigIcon, i + 6); 1326 1317 LF; 1327 AddText (HelpText.LookupByHandle(hGOVHELP, i mod nGov));1318 AddTextual(HelpText.LookupByHandle(hGOVHELP, i mod nGov)); 1328 1319 if i mod nGov >= 2 then 1329 1320 begin … … 1342 1333 begin 1343 1334 Caption := HelpText.Lookup('HELPTITLE_SEARCHRESULTS'); 1344 AddText (Format(HelpText.Lookup('MATCHES'), [SearchContent]));1335 AddTextual(Format(HelpText.Lookup('MATCHES'), [SearchContent])); 1345 1336 MainText.AddStrings(SearchResult); 1346 1337 end … … 1458 1449 s := HelpText.LookupByHandle(hADVHELP, no); 1459 1450 if s <> '*' then 1460 AddText (s);1451 AddTextual(s); 1461 1452 NextSection('SEEALSO'); 1462 1453 CheckSeeAlso := true … … 1521 1512 begin 1522 1513 NextSection('EFFECT'); 1523 AddText (HelpText.LookupByHandle(hIMPHELP, no));1514 AddTextual(HelpText.LookupByHandle(hIMPHELP, no)); 1524 1515 end; 1525 1516 if no = woSun then … … 1533 1524 LF; 1534 1525 if Imp[no].Expiration >= 0 then 1535 AddText (Phrases2.Lookup('HELP_WONDERMORALE1'))1526 AddTextual(Phrases2.Lookup('HELP_WONDERMORALE1')) 1536 1527 else 1537 AddText (Phrases2.Lookup('HELP_WONDERMORALE2'));1528 AddTextual(Phrases2.Lookup('HELP_WONDERMORALE2')); 1538 1529 end; 1539 1530 if Imp[no].Preq <> preNone then … … 1582 1573 if no = woPyramids then 1583 1574 s := s + ' ' + HelpText.Lookup('EXPSLAVE'); 1584 AddText (s);1575 AddTextual(s); 1585 1576 end; 1586 1577 NextSection('SEEALSO'); … … 1648 1639 begin 1649 1640 LF; 1650 AddText (HelpText.Lookup('DEADLANDS'));1641 AddTextual(HelpText.Lookup('DEADLANDS')); 1651 1642 end; 1652 1643 if (TerrType = fDesert) and (no <> fDesert + 12) then 1653 1644 begin 1654 1645 LF; 1655 AddText (Format(HelpText.Lookup('HOSTILE'), [DesertThurst]));1646 AddTextual(Format(HelpText.Lookup('HOSTILE'), [DesertThurst])); 1656 1647 end; 1657 1648 if TerrType = fArctic then 1658 1649 begin 1659 1650 LF; 1660 AddText (Format(HelpText.Lookup('HOSTILE'), [ArcticThurst]));1651 AddTextual(Format(HelpText.Lookup('HOSTILE'), [ArcticThurst])); 1661 1652 end; 1662 1653 if (no < 3 * 12) and (TransTerrain >= 0) then … … 1724 1715 begin 1725 1716 LF; 1726 AddText (HelpText.Lookup('RARE'));1717 AddTextual(HelpText.Lookup('RARE')); 1727 1718 end; 1728 1719 if (no < 3 * 12) and (TerrType in [fDesert, fArctic]) then … … 1786 1777 AddLine(HelpText.Lookup('HELPSPEC_FEATURE')); 1787 1778 NextSection('EFFECT'); 1788 AddText (HelpText.LookupByHandle(hFEATUREHELP, no));1779 AddTextual(HelpText.LookupByHandle(hFEATUREHELP, no)); 1789 1780 if (Feature[no].Weight <> 0) or (Feature[no].Cost <> 0) then 1790 1781 begin … … 1920 1911 if Link shr 8 and $3F = hkInternet then 1921 1912 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'); 1928 1916 end 1929 1917 else -
trunk/LocalPlayer/Term.pas
r52 r53 6860 6860 end 6861 6861 else if Sender = mWebsite then 6862 OpenURL('http://c-evo.org') { *Převedeno z ShellExecute* }6862 OpenURL('http://c-evo.org') 6863 6863 else if Sender = mRandomMap then 6864 6864 begin
Note:
See TracChangeset
for help on using the changeset viewer.