Changeset 447 for trunk/LocalPlayer/Help.pas
- Timestamp:
- May 19, 2022, 10:39:34 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Help.pas
r431 r447 41 41 THyperText = class(TStringList) 42 42 public 43 procedure AddLine( s: String = ''; Format: integer = 0; Picpix: Integer = 0;44 LinkCategory: integer = 0; LinkIndex: integer = 0);43 procedure AddLine(S: String = ''; Format: Integer = 0; Picpix: Integer = 0; 44 LinkCategory: Integer = 0; LinkIndex: Integer = 0); 45 45 procedure LineFeed; 46 46 procedure AppendList(Source: THyperText); … … 78 78 procedure CloseBtnClick(Sender: TObject); 79 79 procedure PaintBox1MouseMove(Sender: TObject; Shift: TShiftState; 80 x, y: integer);80 X, Y: Integer); 81 81 procedure PaintBox1MouseDown(Sender: TObject; Button: TMouseButton; 82 Shift: TShiftState; x, y: integer);82 Shift: TShiftState; X, Y: Integer); 83 83 procedure BackBtnClick(Sender: TObject); 84 84 procedure TopBtnClick(Sender: TObject); … … 104 104 NoMap: TIsoMap; 105 105 x0: array [-2..180] of Integer; 106 procedure PaintTerrIcon( x, y, xSrc, ySrc: Integer);106 procedure PaintTerrIcon(X, Y, xSrc, ySrc: Integer); 107 107 procedure ScrollBarUpdate(Sender: TObject); 108 procedure Line(ca: TCanvas; i: Integer; lit: Boolean);108 procedure Line(ca: TCanvas; I: Integer; lit: Boolean); 109 109 procedure Prepare(sbPos: Integer = 0); 110 110 procedure ShowNewContentProcExecute(NewMode: TWindowMode; HelpContext: string); … … 176 176 end; 177 177 178 procedure THyperText.AddLine( s: String; Format: integer; Picpix: integer;179 LinkCategory: integer; LinkIndex: integer);178 procedure THyperText.AddLine(S: String; Format: Integer; Picpix: Integer; 179 LinkCategory: Integer; LinkIndex: Integer); 180 180 var 181 181 HelpLineInfo: THelpLineInfo; … … 187 187 HelpLineInfo.Picpix := Picpix; 188 188 HelpLineInfo.Link := LinkCategory shl 8 + LinkIndex; 189 AddObject( s, TObject(HelpLineInfo));189 AddObject(S, TObject(HelpLineInfo)); 190 190 end; 191 191 … … 263 263 264 264 nTerrainHelp = 14; 265 TerrainHelp: array [0 .. nTerrainHelp - 1] of integer = (fGrass, fGrass + 12,265 TerrainHelp: array [0 .. nTerrainHelp - 1] of Integer = (fGrass, fGrass + 12, 266 266 fPrairie, fForest, fJungle, fHills, fMountains, fSwamp, fTundra, fArctic, 267 267 fDesert, 3 * 12 { DeadLands } , fShore, fOcean); 268 268 269 269 nJobHelp = 8; 270 JobHelp: array [0 .. nJobHelp - 1] of integer = (jRoad, jRR, jCanal, jIrr,270 JobHelp: array [0 .. nJobHelp - 1] of Integer = (jRoad, jRR, jCanal, jIrr, 271 271 jFarm, jMine, jFort, jBase); 272 272 … … 280 280 CaptionLeft := BackBtn.Left + BackBtn.Width; 281 281 CaptionRight := SearchBtn.Left; 282 inc(ModalFrameIndent, 29);282 Inc(ModalFrameIndent, 29); 283 283 MainText := THyperText.Create; 284 284 MainText.OwnsObjects := True; … … 356 356 if ScrollBar.Process(Msg) then begin 357 357 Sel := -1; 358 SmartUpdateContent( true)358 SmartUpdateContent(True) 359 359 end; 360 360 } … … 364 364 begin 365 365 if Sel <> -1 then begin 366 Line(Canvas, Sel, false);366 Line(Canvas, Sel, False); 367 367 Sel := -1 368 368 end; … … 380 380 end; 381 381 382 procedure THelpDlg.Line(ca: TCanvas; i: Integer; lit: Boolean);382 procedure THelpDlg.Line(ca: TCanvas; I: Integer; lit: Boolean); 383 383 var 384 TextColor, x, y: Integer;384 TextColor, X, Y: Integer; 385 385 TextSize: TSize; 386 s: string;387 begin 388 s := MainText[ScrollBar.Position + i];389 if s= '' then386 S: string; 387 begin 388 S := MainText[ScrollBar.Position + I]; 389 if S = '' then 390 390 Exit; 391 x := x0[i];392 y := 2 + i* 24;391 X := x0[I]; 392 Y := 2 + I * 24; 393 393 if ca = Canvas then 394 394 begin 395 x := x+ SideFrame;396 y := y+ WideFrame397 end; 398 if THelpLineInfo(MainText.Objects[ScrollBar.Position + i]).Format395 X := X + SideFrame; 396 Y := Y + WideFrame 397 end; 398 if THelpLineInfo(MainText.Objects[ScrollBar.Position + I]).Format 399 399 in [pkCaption, pkBigTer, pkRightIcon, pkBigFeature] then 400 400 begin 401 401 ca.Font.Assign(CaptionFont); 402 402 { ca.brush.color:=CaptionColor; 403 ca.FillRect(rect( x,i*24,x+24,i*24+24));404 ca. brush.color:=$FFFFFF;405 ca.FrameRect(rect( x+1,i*24+1,x+24-1,i*24+24-1));403 ca.FillRect(rect(X,I*24,X+24,I*24+24)); 404 ca.Brush.Color:=$FFFFFF; 405 ca.FrameRect(rect(X+1,I*24+1,X+24-1,I*24+24-1)); 406 406 ca.Brush.Style:=bsClear; } 407 BitBltCanvas(ca, x, y- 4, 24, 24, HGrSystem.Data.Canvas, 1,407 BitBltCanvas(ca, X, Y - 4, 24, 24, HGrSystem.Data.Canvas, 1, 408 408 146); 409 BiColorTextOut(ca, $FFFFFF, $7F007F, x + 10 - ca.Textwidth(s[1]) div 2,410 y - 3, s[1]);411 BiColorTextOut(ca, CaptionColor, $7F007F, x + 24, y - 3, copy(s, 2, 255));409 BiColorTextOut(ca, $FFFFFF, $7F007F, X + 10 - ca.Textwidth(S[1]) div 2, 410 Y - 3, S[1]); 411 BiColorTextOut(ca, CaptionColor, $7F007F, X + 24, Y - 3, Copy(S, 2, 255)); 412 412 ca.Font.Assign(UniFont[ftNormal]); 413 413 end 414 else if THelpLineInfo(MainText.Objects[ScrollBar.Position + i]).Format = pkSection414 else if THelpLineInfo(MainText.Objects[ScrollBar.Position + I]).Format = pkSection 415 415 then 416 416 begin 417 417 ca.Font.Assign(CaptionFont); 418 BiColorTextOut(ca, CaptionColor, $7F007F, x, y - 3, s);418 BiColorTextOut(ca, CaptionColor, $7F007F, X, Y - 3, S); 419 419 ca.Font.Assign(UniFont[ftNormal]); 420 420 end … … 426 426 if ca = Canvas then 427 427 begin 428 TextSize.cx := BiColorTextWidth(ca, s);429 TextSize.cy := ca.TextHeight( s);430 if y+ TextSize.cy >= WideFrame + InnerHeight then431 TextSize.cy := WideFrame + InnerHeight - y;432 FillSeamless(ca, x, y, TextSize.cx, TextSize.cy, -SideFrame,428 TextSize.cx := BiColorTextWidth(ca, S); 429 TextSize.cy := ca.TextHeight(S); 430 if Y + TextSize.cy >= WideFrame + InnerHeight then 431 TextSize.cy := WideFrame + InnerHeight - Y; 432 FillSeamless(ca, X, Y, TextSize.cx, TextSize.cy, -SideFrame, 433 433 ScrollBar.Position * 24 - WideFrame, Paper); 434 434 end; 435 BiColorTextOut(ca, TextColor, $7F007F, x, y, s);435 BiColorTextOut(ca, TextColor, $7F007F, X, Y, S); 436 436 if lit then 437 437 with ca do … … 439 439 Assert(ca = Canvas); 440 440 Pen.Color := TextColor; 441 MoveTo( x + 1, y+ TextSize.cy - 2);442 LineTo( x + TextSize.cx, y+ TextSize.cy - 2);441 MoveTo(X + 1, Y + TextSize.cy - 2); 442 LineTo(X + TextSize.cx, Y + TextSize.cy - 2); 443 443 end; 444 444 if (Kind = hkMisc) and (no = miscMain) then … … 447 447 end; 448 448 449 procedure THelpDlg.WaterSign(x0, y0, iix: integer);449 procedure THelpDlg.WaterSign(x0, y0, iix: Integer); 450 450 const 451 451 nHeaven = 28; 452 452 MaxSum = 9 * 9 * 255 * 75 div 100; 453 453 var 454 x, y, dx, dy, xSrc, ySrc, Sum, xx: integer;455 Heaven: array [0..nHeaven] of integer;454 X, Y, dx, dy, xSrc, ySrc, Sum, xx: Integer; 455 Heaven: array [0..nHeaven] of Integer; 456 456 PaintPtr: TPixelPointer; 457 457 CoalPtr: TPixelPointer; … … 471 471 for dy := -1 to 1 do 472 472 ImpPtr[dy] := PixelPointer(BigImp, ScaleToNative(xSrc), ScaleToNative(ySrc)); 473 for y:= 0 to ScaleToNative(ySizeBig) * 2 - 1 do begin474 if ((ScaleToNative(y0) + y) >= 0) and ((ScaleToNative(y0) + y) < ScaleToNative(InnerHeight)) then begin473 for Y := 0 to ScaleToNative(ySizeBig) * 2 - 1 do begin 474 if ((ScaleToNative(y0) + Y) >= 0) and ((ScaleToNative(y0) + Y) < ScaleToNative(InnerHeight)) then begin 475 475 for dy := -1 to 1 do 476 if ((Max( y + ScaleToNative(dy), 0) shr 1) >= 0) and ((Max(y+ ScaleToNative(dy), 0) shr 1) < ScaleToNative(ySizeBig)) then477 ImpPtr[dy].SetXY(0, Max( y+ ScaleToNative(dy), 0) shr 1);478 for x:= 0 to ScaleToNative(xSizeBig * 2) - 1 do begin476 if ((Max(Y + ScaleToNative(dy), 0) shr 1) >= 0) and ((Max(Y + ScaleToNative(dy), 0) shr 1) < ScaleToNative(ySizeBig)) then 477 ImpPtr[dy].SetXY(0, Max(Y + ScaleToNative(dy), 0) shr 1); 478 for X := 0 to ScaleToNative(xSizeBig * 2) - 1 do begin 479 479 Sum := 0; 480 480 for dx := -1 to 1 do begin 481 xx := Max(( x+ ScaleToNative(dx)), 0) shr 1;481 xx := Max((X + ScaleToNative(dx)), 0) shr 1; 482 482 for dy := -1 to 1 do begin 483 483 ImpPtr[dy].SetX(xx); 484 if (( y + ScaleToNative(dy)) shr 1 < 0) or ((y+ ScaleToNative(dy)) shr 1 >= ScaleToNative(ySizeBig)) or485 (( x + ScaleToNative(dx)) shr 1 < 0) or ((x+ ScaleToNative(dx)) shr 1 >= ScaleToNative(xSizeBig)) or486 (( y+ ScaleToNative(dy)) shr 1 < ScaleToNative(nHeaven)) and484 if ((Y + ScaleToNative(dy)) shr 1 < 0) or ((Y + ScaleToNative(dy)) shr 1 >= ScaleToNative(ySizeBig)) or 485 ((X + ScaleToNative(dx)) shr 1 < 0) or ((X + ScaleToNative(dx)) shr 1 >= ScaleToNative(xSizeBig)) or 486 ((Y + ScaleToNative(dy)) shr 1 < ScaleToNative(nHeaven)) and 487 487 (ImpPtr[dy].Pixel^.B shl 16 + ImpPtr[dy].Pixel^.G shl 8 + 488 ImpPtr[dy].Pixel^.R = Heaven[(ScaleFromNative( y+ ScaleToNative(dy))) shr 1]) then488 ImpPtr[dy].Pixel^.R = Heaven[(ScaleFromNative(Y + ScaleToNative(dy))) shr 1]) then 489 489 Sum := Sum + 9 * 255 490 490 else … … 510 510 end; 511 511 512 procedure THelpDlg.PaintTerrIcon( x, y, xSrc, ySrc: integer);512 procedure THelpDlg.PaintTerrIcon(X, Y, xSrc, ySrc: Integer); 513 513 begin 514 514 with NoMap do begin 515 Frame(OffScreen.Canvas, x - 1, y - 1, x + xSizeBig, y+ ySizeBig,515 Frame(OffScreen.Canvas, X - 1, Y - 1, X + xSizeBig, Y + ySizeBig, 516 516 $000000, $000000); 517 517 if 2 * yyt < 40 then begin 518 Sprite(OffScreen, HGrTerrain, x, y, 56, 2 * yyt, xSrc, ySrc);519 Sprite(OffScreen, HGrTerrain, x, y+ 2 * yyt, 56, 40 - 2 * yyt,518 Sprite(OffScreen, HGrTerrain, X, Y, 56, 2 * yyt, xSrc, ySrc); 519 Sprite(OffScreen, HGrTerrain, X, Y + 2 * yyt, 56, 40 - 2 * yyt, 520 520 xSrc, ySrc); 521 521 end else 522 Sprite(OffScreen, HGrTerrain, x, y, 56, 40, xSrc, ySrc);523 Sprite(OffScreen, HGrTerrain, x, y, xxt, yyt, xSrc + xxt, ySrc + yyt);524 Sprite(OffScreen, HGrTerrain, x, y+ yyt, xxt, 40 - yyt, xSrc + xxt, ySrc);525 Sprite(OffScreen, HGrTerrain, x + xxt, y, 56 - xxt, yyt, xSrc, ySrc + yyt);526 Sprite(OffScreen, HGrTerrain, x + xxt, y+ yyt, 56 - xxt, 40 - yyt,522 Sprite(OffScreen, HGrTerrain, X, Y, 56, 40, xSrc, ySrc); 523 Sprite(OffScreen, HGrTerrain, X, Y, xxt, yyt, xSrc + xxt, ySrc + yyt); 524 Sprite(OffScreen, HGrTerrain, X, Y + yyt, xxt, 40 - yyt, xSrc + xxt, ySrc); 525 Sprite(OffScreen, HGrTerrain, X + xxt, Y, 56 - xxt, yyt, xSrc, ySrc + yyt); 526 Sprite(OffScreen, HGrTerrain, X + xxt, Y + yyt, 56 - xxt, 40 - yyt, 527 527 xSrc, ySrc); 528 528 end; … … 531 531 procedure THelpDlg.OffscreenPaint; 532 532 var 533 i, j, yl, srcno, ofs, cnt, y: Integer;534 s: string;533 I, J, yl, srcno, ofs, cnt, Y: Integer; 534 S: string; 535 535 HelpLineInfo: THelpLineInfo; 536 536 begin … … 542 542 begin 543 543 Font.Assign(UniFont[ftNormal]); 544 for i:= -ScrollBar.Position to InnerHeight div 24 do545 if ScrollBar.Position + i< MainText.Count then544 for I := -ScrollBar.Position to InnerHeight div 24 do 545 if ScrollBar.Position + I < MainText.Count then 546 546 begin 547 HelpLineInfo := THelpLineInfo(MainText.Objects[ScrollBar.Position + i]);547 HelpLineInfo := THelpLineInfo(MainText.Objects[ScrollBar.Position + I]); 548 548 if HelpLineInfo.Format = pkExternal then 549 549 begin 550 550 yl := ExtPic.Height; 551 if 4 + i* 24 + yl > InnerHeight then552 yl := InnerHeight - (4 + i* 24);553 BitBltCanvas(OffScreen.Canvas, 8, 4 + i* 24, ExtPic.Width, yl, ExtPic.Canvas,551 if 4 + I * 24 + yl > InnerHeight then 552 yl := InnerHeight - (4 + I * 24); 553 BitBltCanvas(OffScreen.Canvas, 8, 4 + I * 24, ExtPic.Width, yl, ExtPic.Canvas, 554 554 0, 0); 555 555 end; 556 556 end; 557 for i:= -2 to InnerHeight div 24 do558 if (ScrollBar.Position + i >= 0) and (ScrollBar.Position + i< MainText.Count) then557 for I := -2 to InnerHeight div 24 do 558 if (ScrollBar.Position + I >= 0) and (ScrollBar.Position + I < MainText.Count) then 559 559 begin 560 HelpLineInfo := THelpLineInfo(MainText.Objects[ScrollBar.Position + i]);560 HelpLineInfo := THelpLineInfo(MainText.Objects[ScrollBar.Position + I]); 561 561 if HelpLineInfo.Link <> 0 then 562 562 begin 563 563 if (Kind = hkMisc) and (no = miscSearchResult) then 564 Sprite(OffScreen, HGrSystem, 18, 9 + i* 24, 8, 8, 90, 16)564 Sprite(OffScreen, HGrSystem, 18, 9 + I * 24, 8, 8, 90, 16) 565 565 else if HelpLineInfo.Format in [pkSmallIcon_AsPreq, pkAdvIcon_AsPreq] 566 566 then 567 Sprite(OffScreen, HGrSystem, 12, i* 24 + 5, 14, 14, 65, 20)567 Sprite(OffScreen, HGrSystem, 12, I * 24 + 5, 14, 14, 65, 20) 568 568 else if HelpLineInfo.Link and (hkCrossLink shl 8) <> 0 then 569 Sprite(OffScreen, HGrSystem, 12, i* 24 + 5, 14, 14, 80, 1)569 Sprite(OffScreen, HGrSystem, 12, I * 24 + 5, 14, 14, 80, 1) 570 570 else if not((Kind = hkMisc) and (no = miscMain)) then 571 Sprite(OffScreen, HGrSystem, 10, i* 24 + 6, 14, 14, 65, 1);572 x0[ i] := 24;571 Sprite(OffScreen, HGrSystem, 10, I * 24 + 6, 14, 14, 65, 1); 572 x0[I] := 24; 573 573 end 574 574 else 575 x0[ i] := 0;575 x0[I] := 0; 576 576 case HelpLineInfo.Format of 577 577 pkLogo: 578 578 begin 579 Server(sGetVersion, 0, 0, j);580 s := Format('%d.%d.%d', [j shr 16 and $FF, jshr 8 and $FF,581 jand $FF]);582 PaintLogo(OffScreen.Canvas, (InnerWidth - 122) div 2, i* 24 + 1,579 Server(sGetVersion, 0, 0, J); 580 S := Format('%d.%d.%d', [J shr 16 and $FF, J shr 8 and $FF, 581 J and $FF]); 582 PaintLogo(OffScreen.Canvas, (InnerWidth - 122) div 2, I * 24 + 1, 583 583 HGrSystem.Data.Canvas.Pixels[95, 1], $000000); 584 584 Font.Assign(UniFont[ftSmall]); 585 585 BiColorTextOut(OffScreen.Canvas, $000000, $7F007F, 586 (InnerWidth - Textwidth( s)) div 2, i * 24 + 26, s);586 (InnerWidth - Textwidth(S)) div 2, I * 24 + 26, S); 587 587 Font.Assign(UniFont[ftNormal]); 588 588 end; 589 589 pkSmallIcon, pkSmallIcon_AsPreq: 590 590 begin 591 ScreenTools.Frame(OffScreen.Canvas, 8 - 1 + x0[ i], 2 - 1 + i* 24,592 8 + xSizeSmall + x0[ i], 2 + 20 + i* 24, $000000, $000000);591 ScreenTools.Frame(OffScreen.Canvas, 8 - 1 + x0[I], 2 - 1 + I * 24, 592 8 + xSizeSmall + x0[I], 2 + 20 + I * 24, $000000, $000000); 593 593 if HelpLineInfo.Picpix = imPalace then 594 BitBltCanvas(OffScreen.Canvas, 8 + x0[ i], 2 + i* 24,594 BitBltCanvas(OffScreen.Canvas, 8 + x0[I], 2 + I * 24, 595 595 xSizeSmall, ySizeSmall, SmallImp.Canvas, 596 596 0 * xSizeSmall, 1 * ySizeSmall) 597 597 else 598 BitBltCanvas(OffScreen.Canvas, 8 + x0[ i], 2 + i* 24,598 BitBltCanvas(OffScreen.Canvas, 8 + x0[I], 2 + I * 24, 599 599 xSizeSmall, ySizeSmall, SmallImp.Canvas, 600 600 HelpLineInfo.Picpix mod 7 * xSizeSmall, 601 601 (HelpLineInfo.Picpix + SystemIconLines * 7) div 7 * 602 602 ySizeSmall); 603 x0[ i] := x0[i] + (8 + 8 + 36);603 x0[I] := x0[I] + (8 + 8 + 36); 604 604 end; 605 605 pkBigIcon: 606 606 begin 607 FrameImage(OffScreen.Canvas, BigImp, x0[ i] + 12, i* 24 - 7, 56,607 FrameImage(OffScreen.Canvas, BigImp, x0[I] + 12, I * 24 - 7, 56, 608 608 40, HelpLineInfo.Picpix mod 7 * xSizeBig, 609 609 HelpLineInfo.Picpix div 7 * ySizeBig); 610 x0[ i] := 64 + 8 + 8 + x0[i];610 x0[I] := 64 + 8 + 8 + x0[I]; 611 611 end; 612 612 pkSpecialIcon: … … 615 615 0: 616 616 FrameImage(OffScreen.Canvas, HGrSystem2.Data, 617 12 + x0[ i], -7 + i* 24, 56, 40, 137, 127);617 12 + x0[I], -7 + I * 24, 56, 40, 137, 127); 618 618 1: 619 619 with NoMap do begin 620 PaintTerrIcon(12 + x0[ i], -7 + i* 24,620 PaintTerrIcon(12 + x0[I], -7 + I * 24, 621 621 1 + 3 * (xxt * 2 + 1), 1 + yyt); 622 622 if 2 * yyt < 40 then 623 Sprite(OffScreen, HGrTerrain, 12 + x0[ i], -7 + 4 + i* 24,623 Sprite(OffScreen, HGrTerrain, 12 + x0[I], -7 + 4 + I * 24, 624 624 56, 2 * yyt, 1 + 3 * (xxt * 2 + 1) + xxt - 28, 625 625 1 + yyt + 1 * (yyt * 3 + 1)) 626 626 else 627 Sprite(OffScreen, HGrTerrain, 12 + x0[ i],628 -7 + 4 + i* 24 - 4, 56, 40, 1 + 3 * (xxt * 2 + 1) + xxt627 Sprite(OffScreen, HGrTerrain, 12 + x0[I], 628 -7 + 4 + I * 24 - 4, 56, 40, 1 + 3 * (xxt * 2 + 1) + xxt 629 629 - 28, 1 + yyt + 1 * (yyt * 3 + 1) + yyt - 20); 630 630 end; 631 631 2: 632 632 with NoMap do begin 633 PaintTerrIcon(12 + x0[ i], -7 + i* 24,633 PaintTerrIcon(12 + x0[I], -7 + I * 24, 634 634 1 + 7 * (xxt * 2 + 1), 1 + yyt + 4 * (yyt * 3 + 1)); 635 635 if 2 * yyt < 40 then 636 Sprite(OffScreen, HGrTerrain, 12 + x0[ i], -7 + 4 + i* 24,636 Sprite(OffScreen, HGrTerrain, 12 + x0[I], -7 + 4 + I * 24, 637 637 56, 32, 1 + 4 * (xxt * 2 + 1) + xxt - 28, 638 638 1 + yyt + 12 * (yyt * 3 + 1) + yyt - 16) 639 639 else 640 Sprite(OffScreen, HGrTerrain, 12 + x0[ i], -7 + 4 + i* 24,640 Sprite(OffScreen, HGrTerrain, 12 + x0[I], -7 + 4 + I * 24, 641 641 56, 32, 1 + 4 * (xxt * 2 + 1) + xxt - 28, 642 642 1 + yyt + 12 * (yyt * 3 + 1) + yyt - 16) 643 643 end; 644 644 end; 645 x0[ i] := 64 + 8 + 8 + x0[i];645 x0[I] := 64 + 8 + 8 + x0[I]; 646 646 end; 647 647 pkDomain: 648 648 begin 649 ScreenTools.Frame(OffScreen.Canvas, 8 - 1 + x0[ i], 2 - 1 + i* 24,650 8 + 36 + x0[ i], 2 + 20 + i* 24, $000000, $000000);651 Dump(OffScreen, HGrSystem, 8 + x0[ i], 2 + i* 24, 36, 20,649 ScreenTools.Frame(OffScreen.Canvas, 8 - 1 + x0[I], 2 - 1 + I * 24, 650 8 + 36 + x0[I], 2 + 20 + I * 24, $000000, $000000); 651 Dump(OffScreen, HGrSystem, 8 + x0[I], 2 + I * 24, 36, 20, 652 652 75 + HelpLineInfo.Picpix * 37, 295); 653 x0[ i] := x0[i] + (8 + 8 + 36);653 x0[I] := x0[I] + (8 + 8 + 36); 654 654 end; 655 655 pkAdvIcon, pkAdvIcon_AsPreq: 656 656 begin 657 ScreenTools.Frame(OffScreen.Canvas, 8 - 1 + x0[ i], 2 - 1 + i* 24,658 8 + xSizeSmall + x0[ i], 2 + ySizeSmall + i* 24,657 ScreenTools.Frame(OffScreen.Canvas, 8 - 1 + x0[I], 2 - 1 + I * 24, 658 8 + xSizeSmall + x0[I], 2 + ySizeSmall + I * 24, 659 659 $000000, $000000); 660 660 if AdvIcon[HelpLineInfo.Picpix] < 84 then 661 BitBltCanvas(OffScreen.Canvas, 8 + x0[ i], 2 + i* 24,661 BitBltCanvas(OffScreen.Canvas, 8 + x0[I], 2 + I * 24, 662 662 xSizeSmall, ySizeSmall, SmallImp.Canvas, 663 663 (AdvIcon[HelpLineInfo.Picpix] + SystemIconLines * 7) mod 7 * … … 665 665 7) div 7 * ySizeSmall) 666 666 else 667 Dump(OffScreen, HGrSystem, 8 + x0[ i], 2 + i* 24, 36, 20,667 Dump(OffScreen, HGrSystem, 8 + x0[I], 2 + I * 24, 36, 20, 668 668 1 + (AdvIcon[HelpLineInfo.Picpix] - 84) mod 8 * 37, 669 669 295 + (AdvIcon[HelpLineInfo.Picpix] - 84) div 8 * 21); 670 j:= AdvValue[HelpLineInfo.Picpix] div 1000;671 BitBltCanvas(OffScreen.Canvas, x0[ i] + 4, 4 + i* 24, 14, 14,672 HGrSystem.Mask.Canvas, 127 + j* 15, 85, SRCAND);673 Sprite(OffScreen, HGrSystem, x0[ i] + 3, 3 + i* 24, 14, 14,674 127 + j* 15, 85);675 x0[ i] := x0[i] + (8 + 8 + 36);670 J := AdvValue[HelpLineInfo.Picpix] div 1000; 671 BitBltCanvas(OffScreen.Canvas, x0[I] + 4, 4 + I * 24, 14, 14, 672 HGrSystem.Mask.Canvas, 127 + J * 15, 85, SRCAND); 673 Sprite(OffScreen, HGrSystem, x0[I] + 3, 3 + I * 24, 14, 14, 674 127 + J * 15, 85); 675 x0[I] := x0[I] + (8 + 8 + 36); 676 676 end; 677 677 pkRightIcon: 678 678 begin 679 679 if Imp[HelpLineInfo.Picpix].Kind <> ikWonder then 680 ImpImage(OffScreen.Canvas, InnerWidth - (40 + xSizeBig), i* 24,680 ImpImage(OffScreen.Canvas, InnerWidth - (40 + xSizeBig), I * 24, 681 681 HelpLineInfo.Picpix, gDespotism) 682 682 else 683 WaterSign(InnerWidth - (40 + 2 * xSizeBig), i* 24 - 8,683 WaterSign(InnerWidth - (40 + 2 * xSizeBig), I * 24 - 8, 684 684 HelpLineInfo.Picpix + 7); 685 x0[ i] := x0[i] + 8;685 x0[I] := x0[I] + 8; 686 686 end; 687 687 pkIllu: 688 WaterSign(8, i* 24 - 8, HelpLineInfo.Picpix);688 WaterSign(8, I * 24 - 8, HelpLineInfo.Picpix); 689 689 pkBigFeature: 690 690 begin 691 691 cnt := 0; 692 for j:= nDomains - 1 downto 0 do693 if 1 shl jand Feature[HelpLineInfo.Picpix].Domains <> 0 then692 for J := nDomains - 1 downto 0 do 693 if 1 shl J and Feature[HelpLineInfo.Picpix].Domains <> 0 then 694 694 begin 695 inc(cnt);695 Inc(cnt); 696 696 Dump(OffScreen, HGrSystem, InnerWidth - 38 - 38 * cnt, 697 i * 24 + 1, 36, 20, 75 + j* 37, 295);698 ScreenTools.Frame(OffScreen.Canvas, InnerWidth - 39 - 38 * cnt, i* 24,699 InnerWidth - 2 - 38 * cnt, i* 24 + 21, $000000, $000000);697 I * 24 + 1, 36, 20, 75 + J * 37, 295); 698 ScreenTools.Frame(OffScreen.Canvas, InnerWidth - 39 - 38 * cnt, I * 24, 699 InnerWidth - 2 - 38 * cnt, I * 24 + 21, $000000, $000000); 700 700 end; 701 701 DarkGradient(OffScreen.Canvas, InnerWidth - 38 - 38 * cnt, 702 i* 24 + 23, cnt * 38 - 2, 1);702 I * 24 + 23, cnt * 38 - 2, 1); 703 703 ofs := InnerWidth - (39 + 7) - 19 * cnt; 704 704 with OffScreen.Canvas do 705 705 begin 706 Brush. color := $C0C0C0;707 FrameRect(Rect(ofs, 1 + 23 + i* 24, ofs + 14,708 15 + 23 + i* 24));706 Brush.Color := $C0C0C0; 707 FrameRect(Rect(ofs, 1 + 23 + I * 24, ofs + 14, 708 15 + 23 + I * 24)); 709 709 Brush.Style := bsClear; 710 Sprite(OffScreen, HGrSystem, ofs + 2, 3 + 23 + i* 24, 10, 10,710 Sprite(OffScreen, HGrSystem, ofs + 2, 3 + 23 + I * 24, 10, 10, 711 711 66 + HelpLineInfo.Picpix mod 11 * 11, 712 712 137 + HelpLineInfo.Picpix div 11 * 11); 713 713 end; 714 x0[ i] := x0[i] + 8;714 x0[I] := x0[I] + 8; 715 715 end; 716 716 pkTer, pkBigTer: 717 717 with NoMap do begin 718 718 if HelpLineInfo.Format = pkBigTer then 719 y := i* 24 - 3 + yyt719 Y := I * 24 - 3 + yyt 720 720 else 721 y := i* 24 + 13;721 Y := I * 24 + 13; 722 722 if HelpLineInfo.Picpix >= 3 * 12 then 723 723 srcno := 2 * 9 + 6 … … 730 730 if HelpLineInfo.Format = pkTer then 731 731 begin 732 ofs := x0[ i] + 8;733 x0[ i] := 2 * xxt + 8 + ofs;732 ofs := x0[I] + 8; 733 x0[I] := 2 * xxt + 8 + ofs; 734 734 end 735 735 else 736 736 begin 737 737 ofs := InnerWidth - (2 * xxt + 38); 738 x0[ i] := x0[i] + 8;738 x0[I] := x0[I] + 8; 739 739 end; 740 740 if srcno >= fJungle then 741 741 begin 742 Sprite(OffScreen, HGrTerrain, ofs + 4, y- yyt + 2, xxt * 2 - 8,742 Sprite(OffScreen, HGrTerrain, ofs + 4, Y - yyt + 2, xxt * 2 - 8, 743 743 yyt * 2 - 4, 5 + 2 * (xxt * 2 + 1), 744 744 3 + yyt + 2 * (yyt * 3 + 1)); 745 Sprite(OffScreen, HGrTerrain, ofs, y- 2 * yyt, xxt * 2,745 Sprite(OffScreen, HGrTerrain, ofs, Y - 2 * yyt, xxt * 2, 746 746 yyt * 3 - 2, 1 + srcno mod 9 * (xxt * 2 + 1), 747 747 1 + srcno div 9 * (yyt * 3 + 1)); 748 748 end 749 749 else 750 Sprite(OffScreen, HGrTerrain, ofs + 4, y- yyt + 2, xxt * 2 - 8,750 Sprite(OffScreen, HGrTerrain, ofs + 4, Y - yyt + 2, xxt * 2 - 8, 751 751 yyt * 2 - 4, 5 + srcno mod 9 * (xxt * 2 + 1), 752 752 3 + yyt + srcno div 9 * (yyt * 3 + 1)); 753 753 if HelpLineInfo.Picpix >= 3 * 12 then { rare resource } 754 Sprite(OffScreen, HGrTerrain, ofs, y- 2 * yyt, xxt * 2,754 Sprite(OffScreen, HGrTerrain, ofs, Y - 2 * yyt, xxt * 2, 755 755 yyt * 3, 1 + 8 * (xxt * 2 + 1), 756 756 1 + (HelpLineInfo.Picpix - 2 * 12) * (yyt * 3 + 1)) … … 764 764 srcno := 18 + 8 + (HelpLineInfo.Picpix mod 12 - 9) * 18; 765 765 srcno := srcno + HelpLineInfo.Picpix div 12 * 9; 766 Sprite(OffScreen, HGrTerrain, ofs, y- 2 * yyt, xxt * 2,766 Sprite(OffScreen, HGrTerrain, ofs, Y - 2 * yyt, xxt * 2, 767 767 yyt * 3, 1 + srcno mod 9 * (xxt * 2 + 1), 768 768 1 + srcno div 9 * (yyt * 3 + 1)); … … 774 774 if HelpLineInfo.Picpix = 5 then 775 775 begin // display mine on hills 776 Sprite(OffScreen, HGrTerrain, ofs + 4, i* 24 + 13 - yyt,776 Sprite(OffScreen, HGrTerrain, ofs + 4, I * 24 + 13 - yyt, 777 777 xxt * 2 - 8, yyt * 2 - 4, 5 + 2 * (xxt * 2 + 1), 778 778 3 + yyt + 2 * (yyt * 3 + 1)); … … 781 781 else 782 782 srcno := fPrairie; // display on prairie 783 Sprite(OffScreen, HGrTerrain, ofs + 4, i* 24 + 13 - yyt,783 Sprite(OffScreen, HGrTerrain, ofs + 4, I * 24 + 13 - yyt, 784 784 xxt * 2 - 8, yyt * 2 - 4, 5 + srcno mod 9 * (xxt * 2 + 1), 785 785 3 + yyt + srcno div 9 * (yyt * 3 + 1)); 786 786 if HelpLineInfo.Picpix = 12 then { river } 787 Sprite(OffScreen, HGrTerrain, ofs, i* 24 + 11 - yyt, xxt * 2,787 Sprite(OffScreen, HGrTerrain, ofs, I * 24 + 11 - yyt, xxt * 2, 788 788 yyt * 2, 1 + 5 * (xxt * 2 + 1), 1 + yyt + 13 * (yyt * 3 + 1)) 789 789 else if HelpLineInfo.Picpix >= 3 then { improvement 2 } 790 790 begin 791 791 if HelpLineInfo.Picpix = 6 then 792 Sprite(OffScreen, HGrTerrain, ofs, i* 24 + 11 - 2 * yyt,792 Sprite(OffScreen, HGrTerrain, ofs, I * 24 + 11 - 2 * yyt, 793 793 xxt * 2, yyt * 3, 1 + 7 * (xxt * 2 + 1), 794 794 1 + 12 * (yyt * 3 + 1)); 795 Sprite(OffScreen, HGrTerrain, ofs, i* 24 + 11 - 2 * yyt,795 Sprite(OffScreen, HGrTerrain, ofs, I * 24 + 11 - 2 * yyt, 796 796 xxt * 2, yyt * 3, 1 + (HelpLineInfo.Picpix - 3) * 797 797 (xxt * 2 + 1), 1 + 12 * (yyt * 3 + 1)) … … 799 799 else { improvement 1 } 800 800 begin 801 Sprite(OffScreen, HGrTerrain, ofs, i* 24 + 11 - 2 * yyt,801 Sprite(OffScreen, HGrTerrain, ofs, I * 24 + 11 - 2 * yyt, 802 802 xxt * 2, yyt * 3, 1 + 2 * (xxt * 2 + 1), 803 803 1 + (9 + HelpLineInfo.Picpix) * (yyt * 3 + 1)); 804 Sprite(OffScreen, HGrTerrain, ofs, i* 24 + 11 - 2 * yyt,804 Sprite(OffScreen, HGrTerrain, ofs, I * 24 + 11 - 2 * yyt, 805 805 xxt * 2, yyt * 3, 1 + 5 * (xxt * 2 + 1), 806 806 1 + (9 + HelpLineInfo.Picpix) * (yyt * 3 + 1)) 807 807 end; 808 x0[ i] := x0[i] + 8;808 x0[I] := x0[I] + 8; 809 809 end; 810 810 pkModel: 811 811 begin 812 FrameImage(OffScreen.Canvas, BigImp, x0[ i] + 12, i* 24 - 7,812 FrameImage(OffScreen.Canvas, BigImp, x0[I] + 12, I * 24 - 7, 813 813 56, 40, 0, 0); 814 Sprite(OffScreen, HGrStdUnits, x0[ i] + 8, i* 24 - 11, 64, 44,814 Sprite(OffScreen, HGrStdUnits, x0[I] + 8, I * 24 - 11, 64, 44, 815 815 1 + HelpLineInfo.Picpix mod 10 * 65, 816 816 1 + HelpLineInfo.Picpix div 10 * 49); 817 x0[ i] := 64 + 8 + 8 + x0[i];817 x0[I] := 64 + 8 + 8 + x0[I]; 818 818 end; 819 819 pkFeature: 820 820 begin 821 DarkGradient(OffScreen.Canvas, x0[ i] + 8 - 1,822 7 + i* 24 - 3, 16, 1);823 ScreenTools.Frame(OffScreen.Canvas, x0[ i] + 8, 7 + i * 24 - 2, x0[i] + 8 + 13,824 7 + i* 24 - 2 + 13, $C0C0C0, $C0C0C0);825 Sprite(OffScreen, HGrSystem, x0[ i] + 8 + 2, 7 + i* 24, 10, 10,821 DarkGradient(OffScreen.Canvas, x0[I] + 8 - 1, 822 7 + I * 24 - 3, 16, 1); 823 ScreenTools.Frame(OffScreen.Canvas, x0[I] + 8, 7 + I * 24 - 2, x0[I] + 8 + 13, 824 7 + I * 24 - 2 + 13, $C0C0C0, $C0C0C0); 825 Sprite(OffScreen, HGrSystem, x0[I] + 8 + 2, 7 + I * 24, 10, 10, 826 826 66 + HelpLineInfo.Picpix mod 11 * 11, 827 827 137 + HelpLineInfo.Picpix div 11 * 11); 828 x0[ i] := x0[i] + 8 + 8 + 2 + 13;828 x0[I] := x0[I] + 8 + 8 + 2 + 13; 829 829 end; 830 830 pkExp: 831 831 begin 832 ScreenTools.Frame(OffScreen.Canvas, 20 - 1, 8 - 4 + i* 24, 20 + 12,833 8 + 11 + i* 24, $000000, $000000);834 Dump(OffScreen, HGrSystem, 20, 8 - 3 + i* 24, 12, 14,832 ScreenTools.Frame(OffScreen.Canvas, 20 - 1, 8 - 4 + I * 24, 20 + 12, 833 8 + 11 + I * 24, $000000, $000000); 834 Dump(OffScreen, HGrSystem, 20, 8 - 3 + I * 24, 12, 14, 835 835 121 + HelpLineInfo.Picpix * 13, 28); 836 x0[ i] := 20 + 8 + 11;836 x0[I] := 20 + 8 + 11; 837 837 end; 838 838 pkAITStat: 839 839 begin 840 Sprite(OffScreen, HGrSystem, 20, 6 + i* 24, 14, 14,840 Sprite(OffScreen, HGrSystem, 20, 6 + I * 24, 14, 14, 841 841 1 + HelpLineInfo.Picpix * 15, 316); 842 x0[ i] := 20 + 8 + 11;842 x0[I] := 20 + 8 + 11; 843 843 end; 844 844 pkGov: 845 845 begin 846 ScreenTools.Frame(OffScreen.Canvas, 8 - 1 + x0[ i], 2 - 1 + i* 24,847 8 + xSizeSmall + x0[ i], 2 + 20 + i* 24, $000000, $000000);848 BitBltCanvas(OffScreen.Canvas, 8 + x0[ i], 2 + i* 24, xSizeSmall,846 ScreenTools.Frame(OffScreen.Canvas, 8 - 1 + x0[I], 2 - 1 + I * 24, 847 8 + xSizeSmall + x0[I], 2 + 20 + I * 24, $000000, $000000); 848 BitBltCanvas(OffScreen.Canvas, 8 + x0[I], 2 + I * 24, xSizeSmall, 849 849 ySizeSmall, SmallImp.Canvas, (HelpLineInfo.Picpix - 1) * 850 850 xSizeSmall, ySizeSmall); 851 x0[ i] := x0[i] + (8 + 8 + 36);851 x0[I] := x0[I] + (8 + 8 + 36); 852 852 end; 853 853 pkDot: 854 854 begin 855 Sprite(OffScreen, HGrSystem, x0[ i] + 18, 9 + i* 24, 8,855 Sprite(OffScreen, HGrSystem, x0[I] + 18, 9 + I * 24, 8, 856 856 8, 81, 16); 857 x0[ i] := 20 + 8 + 4;857 x0[I] := 20 + 8 + 4; 858 858 end; 859 859 pkNormal_Dot: 860 x0[ i] := 20 + 8 + 4;860 x0[I] := 20 + 8 + 4; 861 861 pkNormal_64: 862 x0[ i] := 64 + 8 + 8;862 x0[I] := 64 + 8 + 8; 863 863 else 864 x0[ i] := x0[i] + 8;864 x0[I] := x0[I] + 8; 865 865 end; 866 Self.Line(OffScreen.Canvas, i, False)866 Self.Line(OffScreen.Canvas, I, False) 867 867 end; 868 868 end; … … 873 873 begin 874 874 Sel := -1; 875 SmartUpdateContent( true)876 end; 877 878 procedure THelpDlg.Prepare(sbPos: integer = 0);875 SmartUpdateContent(True) 876 end; 877 878 procedure THelpDlg.Prepare(sbPos: Integer = 0); 879 879 var 880 i, j, Special, Domain, Headline, TerrType, TerrSubType: integer;881 s: string;882 ps: pchar;880 I, J, Special, Domain, Headline, TerrType, TerrSubType: Integer; 881 S: string; 882 ps: PChar; 883 883 List: THyperText; 884 884 CheckSeeAlso: Boolean; 885 885 886 procedure AddAdvance( i: integer);887 begin 888 MainText.AddLine(Phrases.Lookup('ADVANCES', i), pkAdvIcon, i,889 hkAdv + hkCrossLink, i);890 end; 891 892 procedure AddPreqAdv( i: integer);893 begin 894 MainText.AddLine(Phrases.Lookup('ADVANCES', i), pkAdvIcon_AsPreq, i,895 hkAdv + hkCrossLink, i);896 end; 897 898 procedure AddImprovement( i: integer);899 begin 900 MainText.AddLine(Phrases.Lookup('IMPROVEMENTS', i), pkSmallIcon, i,901 hkImp + hkCrossLink, i);902 end; 903 904 procedure AddPreqImp( i: integer);905 begin 906 MainText.AddLine(Phrases.Lookup('IMPROVEMENTS', i), pkSmallIcon_AsPreq, i,907 hkImp + hkCrossLink, i);908 end; 909 910 procedure AddTerrain( i: integer);886 procedure AddAdvance(I: Integer); 887 begin 888 MainText.AddLine(Phrases.Lookup('ADVANCES', I), pkAdvIcon, I, 889 hkAdv + hkCrossLink, I); 890 end; 891 892 procedure AddPreqAdv(I: Integer); 893 begin 894 MainText.AddLine(Phrases.Lookup('ADVANCES', I), pkAdvIcon_AsPreq, I, 895 hkAdv + hkCrossLink, I); 896 end; 897 898 procedure AddImprovement(I: Integer); 899 begin 900 MainText.AddLine(Phrases.Lookup('IMPROVEMENTS', I), pkSmallIcon, I, 901 hkImp + hkCrossLink, I); 902 end; 903 904 procedure AddPreqImp(I: Integer); 905 begin 906 MainText.AddLine(Phrases.Lookup('IMPROVEMENTS', I), pkSmallIcon_AsPreq, I, 907 hkImp + hkCrossLink, I); 908 end; 909 910 procedure AddTerrain(I: Integer); 911 911 begin 912 912 if MainText.Count > 1 then … … 914 914 MainText.LineFeed; 915 915 end; 916 MainText.AddLine(Phrases.Lookup('TERRAIN', i), pkTer, i, hkTer, i);917 end; 918 919 procedure AddFeature( i: integer);920 begin 921 MainText.AddLine(Phrases.Lookup('FEATURES', i), pkFeature, i,922 hkFeature + hkCrossLink, i);923 end; 924 925 procedure AddModel( i: integer);916 MainText.AddLine(Phrases.Lookup('TERRAIN', I), pkTer, I, hkTer, I); 917 end; 918 919 procedure AddFeature(I: Integer); 920 begin 921 MainText.AddLine(Phrases.Lookup('FEATURES', I), pkFeature, I, 922 hkFeature + hkCrossLink, I); 923 end; 924 925 procedure AddModel(I: Integer); 926 926 var 927 pix: integer;927 pix: Integer; 928 928 Name: string; 929 929 begin 930 930 if MainText.Count > 1 then 931 931 MainText.LineFeed; 932 FindStdModelPicture(SpecialModelPictureCode[ i], pix, Name);933 MainText.AddLine(Name, pkModel, pix, hkModel + hkCrossLink, i)932 FindStdModelPicture(SpecialModelPictureCode[I], pix, Name); 933 MainText.AddLine(Name, pkModel, pix, hkModel + hkCrossLink, I) 934 934 end; 935 935 936 936 procedure AddStandardBlock(Item: string); 937 937 var 938 i: integer;938 I: Integer; 939 939 begin 940 940 with MainText do … … 947 947 else if Item = 'TECHFORMULA' then 948 948 begin 949 i:= Difficulty;950 if i= 0 then951 i:= 2;952 AddLine(Format(HelpText.Lookup('TECHFORMULA'), [TechFormula_M[ i],953 TechFormula_D[ i]]))949 I := Difficulty; 950 if I = 0 then 951 I := 2; 952 AddLine(Format(HelpText.Lookup('TECHFORMULA'), [TechFormula_M[I], 953 TechFormula_D[I]])) 954 954 end 955 955 else if Item = 'EXPERIENCE' then 956 for i:= 0 to nExp - 1 do957 AddLine(Phrases.Lookup('EXPERIENCE', i), pkExp, i)956 for I := 0 to nExp - 1 do 957 AddLine(Phrases.Lookup('EXPERIENCE', I), pkExp, I) 958 958 else if Item = 'MODERN' then 959 for i:= 1 to 3 do959 for I := 1 to 3 do 960 960 begin 961 961 LineFeed; 962 AddLine(Phrases.Lookup('TERRAIN', 3 * 12 + i), pkTer, 3 * 12 + i);962 AddLine(Phrases.Lookup('TERRAIN', 3 * 12 + I), pkTer, 3 * 12 + I); 963 963 end 964 964 else if Item = 'SAVED' then 965 965 AddLine(DataDir + 'Saved', pkNormal) 966 966 else if Item = 'AITSTAT' then 967 for i:= 0 to 3 do968 AddLine(Phrases2.Lookup('AITSTAT', i), pkAITStat, i)967 for I := 0 to 3 do 968 AddLine(Phrases2.Lookup('AITSTAT', I), pkAITStat, I) 969 969 end 970 970 end; 971 971 972 procedure DecodeItem( s: string; var Category, Index: Integer);972 procedure DecodeItem(S: string; var Category, Index: Integer); 973 973 var 974 i: Integer;975 begin 976 if (Length( s) > 0) and (s[1] = ':') then begin974 I: Integer; 975 begin 976 if (Length(S) > 0) and (S[1] = ':') then begin 977 977 Category := hkMisc; 978 978 Index := 0; 979 for i := 3 to length(s) do980 Index := Index * 10 + Ord( s[i]) - 48;981 case s[2] of979 for I := 3 to Length(S) do 980 Index := Index * 10 + Ord(S[I]) - 48; 981 case S[2] of 982 982 'A': Category := hkAdv; 983 983 'B': Category := hkImp; … … 994 994 end else begin 995 995 Category := hkText; 996 Index := HelpText.Gethandle(Copy( s, 1, 255));996 Index := HelpText.Gethandle(Copy(S, 1, 255)); 997 997 end; 998 998 end; 999 999 1000 procedure AddTextual( s: string);1000 procedure AddTextual(S: string); 1001 1001 var 1002 i: Integer;1003 p: Integer;1004 l: Integer;1002 I: Integer; 1003 P: Integer; 1004 L: Integer; 1005 1005 ofs: Integer; 1006 1006 CurrentFormat: Integer; … … 1015 1015 RightMargin := InnerWidth - 16 - GetSystemMetrics(SM_CXVSCROLL); 1016 1016 FollowFormat := pkNormal; 1017 while s<> '' do1017 while S <> '' do 1018 1018 begin 1019 1019 Picpix := 0; 1020 1020 LinkCategory := 0; 1021 1021 LinkIndex := 0; 1022 if s[1] = '$' then1022 if S[1] = '$' then 1023 1023 begin // window caption 1024 p:= 1;1024 P := 1; 1025 1025 repeat 1026 inc(p)1027 until ( p > Length(s)) or (s[p] = '\');1028 Caption := Copy( s, 2, p- 2);1029 Delete( s, 1, p);1026 Inc(P); 1027 until (P > Length(S)) or (S[P] = '\'); 1028 Caption := Copy(S, 2, P - 2); 1029 Delete(S, 1, P); 1030 1030 end 1031 else if s[1] = '&' then1031 else if S[1] = '&' then 1032 1032 begin // standard block 1033 p:= 1;1033 P := 1; 1034 1034 repeat 1035 inc(p)1036 until ( p > Length(s)) or (s[p] = '\');1037 AddStandardBlock(Copy( s, 2, p- 2));1038 Delete( s, 1, p);1035 Inc(P); 1036 until (P > Length(S)) or (S[P] = '\'); 1037 AddStandardBlock(Copy(S, 2, P - 2)); 1038 Delete(S, 1, P); 1039 1039 end 1040 else if s[1] = '@' then1040 else if S[1] = '@' then 1041 1041 begin // image 1042 if (Length( s) >= 2) and (s[2] = '@') then1042 if (Length(S) >= 2) and (S[2] = '@') then 1043 1043 begin // generate from icon 1044 1044 Picpix := 0; 1045 p:= 3;1046 while ( p <= Length(s)) and (s[p] <> '\') do1045 P := 3; 1046 while (P <= Length(S)) and (S[P] <> '\') do 1047 1047 begin 1048 Picpix := Picpix * 10 + Ord( s[p]) - 48;1049 inc(p)1048 Picpix := Picpix * 10 + Ord(S[P]) - 48; 1049 Inc(P); 1050 1050 end; 1051 1051 if (Picpix < 0) or (Picpix >= nImp) then … … 1057 1057 else 1058 1058 begin // external image 1059 p:= 1;1059 P := 1; 1060 1060 repeat 1061 Inc( p)1062 until ( p > Length(s)) or (s[p] = '\');1061 Inc(P); 1062 until (P > Length(S)) or (S[P] = '\'); 1063 1063 if LoadGraphicFile(ExtPic, LocalizedFilePath('Help' + 1064 DirectorySeparator + Copy( s, 2, p- 2)) + '.png') then1064 DirectorySeparator + Copy(S, 2, P - 2)) + '.png') then 1065 1065 begin 1066 1066 MainText.AddLine('', pkExternal); 1067 for i:= 0 to (ExtPic.Height - 12) div 24 do1067 for I := 0 to (ExtPic.Height - 12) div 24 do 1068 1068 MainText.LineFeed; 1069 1069 end; 1070 1070 end; 1071 Delete( s, 1, p);1071 Delete(S, 1, P); 1072 1072 end 1073 1073 else 1074 1074 begin 1075 case s[1] of1075 case S[1] of 1076 1076 ':', ';': 1077 1077 begin // link 1078 p:= 1;1078 P := 1; 1079 1079 repeat 1080 inc(p)1081 until ( p > Length(s)) or (s[p] = '\') or (s[p] = ' ');1082 DecodeItem(Copy( s, 2, p- 2), LinkCategory, LinkIndex);1080 Inc(P) 1081 until (P > Length(S)) or (S[P] = '\') or (S[P] = ' '); 1082 DecodeItem(Copy(S, 2, P - 2), LinkCategory, LinkIndex); 1083 1083 CurrentFormat := 0; 1084 1084 if (LinkCategory <> hkText) and (LinkIndex < 200) then … … 1112 1112 end; 1113 1113 end; 1114 if s[1] = ':' then1114 if S[1] = ':' then 1115 1115 LinkCategory := LinkCategory + hkCrossLink; 1116 if ( p > Length(s)) or (s[p] = ' ') then1117 Delete( s, 1, p)1116 if (P > Length(S)) or (S[P] = ' ') then 1117 Delete(S, 1, P) 1118 1118 else 1119 Delete( s, 1, p- 1)1119 Delete(S, 1, P - 1) 1120 1120 end; 1121 1121 '!': // highlited 1122 if (Length( s) >= 2) and (s[2] = '!') then1122 if (Length(S) >= 2) and (S[2] = '!') then 1123 1123 begin 1124 1124 if MainText.Count > 1 then … … 1126 1126 FollowFormat := pkCaption; 1127 1127 CurrentFormat := pkCaption; 1128 Delete( s, 1, 2);1128 Delete(S, 1, 2); 1129 1129 end 1130 1130 else … … 1132 1132 FollowFormat := pkSection; 1133 1133 CurrentFormat := pkSection; 1134 Delete( s, 1, 1);1134 Delete(S, 1, 1); 1135 1135 end; 1136 1136 '-': … … 1138 1138 FollowFormat := pkNormal_Dot; 1139 1139 CurrentFormat := pkDot; 1140 Delete( s, 1, 1);1140 Delete(S, 1, 1); 1141 1141 end; 1142 1142 else … … 1147 1147 else 1148 1148 ofs := 8; 1149 p:= 0;1149 P := 0; 1150 1150 repeat 1151 1151 repeat 1152 Inc( p)1153 until ( p > Length(s)) or (s[p] = ' ') or (s[p] = '\');1154 if (BiColorTextWidth(OffScreen.Canvas, Copy( s, 1, p- 1)) <=1152 Inc(P) 1153 until (P > Length(S)) or (S[P] = ' ') or (S[P] = '\'); 1154 if (BiColorTextWidth(OffScreen.Canvas, Copy(S, 1, P - 1)) <= 1155 1155 RightMargin - ofs) then 1156 l := p- 11156 L := P - 1 1157 1157 else 1158 1158 Break; 1159 until ( p >= Length(s)) or (s[l+ 1] = '\');1160 Text := Copy( s, 1, l);1161 if LinkCategory and $3 f= hkInternet then begin1159 until (P >= Length(S)) or (S[L + 1] = '\'); 1160 Text := Copy(S, 1, L); 1161 if LinkCategory and $3F = hkInternet then begin 1162 1162 if LinkIndex = 1 then Text := AITemplateManual 1163 1163 else if LinkIndex = 2 then Text := CevoHomepageShort … … 1166 1166 MainText.AddLine(Text, CurrentFormat, Picpix, LinkCategory, 1167 1167 LinkIndex); 1168 if ( l < Length(s)) and (s[l+ 1] = '\') then1168 if (L < Length(S)) and (S[L + 1] = '\') then 1169 1169 FollowFormat := pkNormal; 1170 Delete( s, 1, l+ 1);1170 Delete(S, 1, L + 1); 1171 1171 end 1172 1172 end … … 1178 1178 end; 1179 1179 1180 procedure AddModelText( i: Integer);1180 procedure AddModelText(I: Integer); 1181 1181 var 1182 1182 pix: Integer; 1183 s: string;1183 S: string; 1184 1184 begin 1185 1185 with MainText do begin … … 1188 1188 LineFeed; 1189 1189 end; 1190 FindStdModelPicture(SpecialModelPictureCode[ i], pix, s);1191 AddLine( s, pkSection);1192 AddLine(Format(HelpText.Lookup('STRENGTH'), [SpecialModel[ i].Attack,1193 SpecialModel[ i].Defense]), pkNormal_64);1190 FindStdModelPicture(SpecialModelPictureCode[I], pix, S); 1191 AddLine(S, pkSection); 1192 AddLine(Format(HelpText.Lookup('STRENGTH'), [SpecialModel[I].Attack, 1193 SpecialModel[I].Defense]), pkNormal_64); 1194 1194 AddLine(Format(HelpText.Lookup('SPEED'), 1195 [MovementToString(SpecialModel[ i].Speed)]), pkModel, pix);1195 [MovementToString(SpecialModel[I].Speed)]), pkModel, pix); 1196 1196 if Difficulty = 0 then 1197 AddLine(Format(HelpText.Lookup('BUILDCOST'), [SpecialModel[ i].Cost]),1197 AddLine(Format(HelpText.Lookup('BUILDCOST'), [SpecialModel[I].Cost]), 1198 1198 pkNormal_64) 1199 1199 else 1200 1200 AddLine(Format(HelpText.Lookup('BUILDCOST'), 1201 [SpecialModel[ i].Cost * BuildCostMod[Difficulty] div 12]),1201 [SpecialModel[I].Cost * BuildCostMod[Difficulty] div 12]), 1202 1202 pkNormal_64); 1203 s := HelpText.LookupByHandle(hSPECIALMODEL, i);1204 if ( s <> '') and (s<> '*') then1205 AddTextual( s);1206 if SpecialModelPreq[ i] >= 0 then1207 AddPreqAdv(SpecialModelPreq[ i])1208 else if SpecialModelPreq[ i] = preLighthouse then1203 S := HelpText.LookupByHandle(hSPECIALMODEL, I); 1204 if (S <> '') and (S <> '*') then 1205 AddTextual(S); 1206 if SpecialModelPreq[I] >= 0 then 1207 AddPreqAdv(SpecialModelPreq[I]) 1208 else if SpecialModelPreq[I] = preLighthouse then 1209 1209 AddPreqImp(woLighthouse) 1210 else if SpecialModelPreq[ i] = preBuilder then1210 else if SpecialModelPreq[I] = preBuilder then 1211 1211 AddPreqImp(woPyramids) 1212 else if SpecialModelPreq[ i] = preLeo then1212 else if SpecialModelPreq[I] = preLeo then 1213 1213 AddPreqImp(woLeo); 1214 if SpecialModelPreq[ i] <> preNone then1214 if SpecialModelPreq[I] <> preNone then 1215 1215 MainText[Count - 1] := Format(HelpText.Lookup('REQUIRED'), 1216 1216 [MainText[Count - 1]]); … … 1220 1220 procedure AddJobList; 1221 1221 var 1222 i, JobCost: Integer;1222 I, JobCost: Integer; 1223 1223 begin 1224 1224 with MainText do begin 1225 for i:= 0 to nJobHelp - 1 do begin1226 if i> 0 then begin1225 for I := 0 to nJobHelp - 1 do begin 1226 if I > 0 then begin 1227 1227 LineFeed; 1228 1228 LineFeed; 1229 1229 end; 1230 AddLine(Phrases.Lookup('JOBRESULT', JobHelp[ i]), pkSection);1230 AddLine(Phrases.Lookup('JOBRESULT', JobHelp[I]), pkSection); 1231 1231 AddLine; 1232 AddLine('', pkTerImp, i);1232 AddLine('', pkTerImp, I); 1233 1233 AddLine; 1234 AddTextual(HelpText.LookupByHandle(hJOBHELP, i));1234 AddTextual(HelpText.LookupByHandle(hJOBHELP, I)); 1235 1235 JobCost := -1; 1236 case JobHelp[ i] of1236 case JobHelp[I] of 1237 1237 jCanal: JobCost := CanalWork; 1238 1238 jFort: JobCost := FortWork; … … 1244 1244 else 1245 1245 AddTextual(HelpText.Lookup('JOBCOSTVAR')); 1246 if JobPreq[JobHelp[ i]] <> preNone then begin1247 AddPreqAdv(JobPreq[JobHelp[ i]]);1246 if JobPreq[JobHelp[I]] <> preNone then begin 1247 AddPreqAdv(JobPreq[JobHelp[I]]); 1248 1248 MainText[Count - 1] := Format(HelpText.Lookup('REQUIRED'), 1249 1249 [MainText[Count - 1]]); … … 1255 1255 procedure AddGraphicCredits; 1256 1256 var 1257 i: Integer;1258 s: string;1257 I: Integer; 1258 S: string; 1259 1259 sr: TSearchRec; 1260 1260 List, Plus: TStringList; … … 1271 1271 1272 1272 List.Sort; 1273 i:= 1;1274 while i< List.Count do1275 if List[ i] = List[i- 1] then1276 List.Delete( i)1273 I := 1; 1274 while I < List.Count do 1275 if List[I] = List[I - 1] then 1276 List.Delete(I) 1277 1277 else 1278 Inc( i);1279 1280 for i:= 0 to List.Count - 1 do begin1281 s := List[i];1282 while BiColorTextWidth(OffScreen.Canvas, s) > InnerWidth - 16 -1278 Inc(I); 1279 1280 for I := 0 to List.Count - 1 do begin 1281 S := List[I]; 1282 while BiColorTextWidth(OffScreen.Canvas, S) > InnerWidth - 16 - 1283 1283 GetSystemMetrics(SM_CXVSCROLL) do 1284 Delete( s, length(s), 1);1285 MainText.AddLine( s);1284 Delete(S, Length(S), 1); 1285 MainText.AddLine(S); 1286 1286 end; 1287 1287 FreeAndNil(List); … … 1290 1290 procedure AddSoundCredits; 1291 1291 var 1292 i: Integer;1293 s: string;1292 I: Integer; 1293 S: string; 1294 1294 List: TStringList; 1295 1295 begin 1296 1296 List := TStringList.Create; 1297 1297 List.LoadFromFile(GetSoundsDir + DirectorySeparator + 'sound.credits.txt'); 1298 for i:= 0 to List.Count - 1 do begin1299 s := List[i];1300 while BiColorTextWidth(OffScreen.Canvas, s) > InnerWidth - 16 -1298 for I := 0 to List.Count - 1 do begin 1299 S := List[I]; 1300 while BiColorTextWidth(OffScreen.Canvas, S) > InnerWidth - 16 - 1301 1301 GetSystemMetrics(SM_CXVSCROLL) do 1302 Delete( s, length(s), 1);1303 MainText.AddLine( s);1302 Delete(S, Length(S), 1); 1303 MainText.AddLine(S); 1304 1304 end; 1305 1305 FreeAndNil(List); … … 1349 1349 hkAdv, 200); 1350 1350 LineFeed; 1351 FindStdModelPicture(SpecialModelPictureCode[6], i, s);1352 AddLine(HelpText.Lookup('HELPTITLE_MODELLIST'), pkModel, i,1351 FindStdModelPicture(SpecialModelPictureCode[6], I, S); 1352 AddLine(HelpText.Lookup('HELPTITLE_MODELLIST'), pkModel, I, 1353 1353 hkModel, 0); 1354 1354 LineFeed; … … 1402 1402 begin 1403 1403 Caption := HelpText.Lookup('HELPTITLE_GOVLIST'); 1404 for i:= 1 to nGov do1404 for I := 1 to nGov do 1405 1405 begin 1406 AddLine(Phrases.Lookup('GOVERNMENT', imod nGov), pkSection);1406 AddLine(Phrases.Lookup('GOVERNMENT', I mod nGov), pkSection); 1407 1407 LineFeed; 1408 if i= nGov then1408 if I = nGov then 1409 1409 AddLine('', pkBigIcon, 7 * SystemIconLines + imPalace) 1410 1410 else 1411 AddLine('', pkBigIcon, i+ 6);1411 AddLine('', pkBigIcon, I + 6); 1412 1412 LineFeed; 1413 AddTextual(HelpText.LookupByHandle(hGOVHELP, imod nGov));1414 if imod nGov >= 2 then1413 AddTextual(HelpText.LookupByHandle(hGOVHELP, I mod nGov)); 1414 if I mod nGov >= 2 then 1415 1415 begin 1416 AddPreqAdv(GovPreq[ imod nGov]);1416 AddPreqAdv(GovPreq[I mod nGov]); 1417 1417 MainText[Count - 1] := Format(HelpText.Lookup('REQUIRED'), 1418 1418 [MainText[Count - 1]]); 1419 1419 end; 1420 if i< nGov then1420 if I < nGov then 1421 1421 begin 1422 1422 LineFeed; … … 1440 1440 List := THyperText.Create; 1441 1441 List.OwnsObjects := True; 1442 for j:= 0 to 3 do1442 for J := 0 to 3 do 1443 1443 begin 1444 if j> 0 then1444 if J > 0 then 1445 1445 begin 1446 1446 LineFeed; 1447 1447 LineFeed; 1448 1448 end; 1449 AddLine(HelpText.Lookup('TECHAGE', j), pkSection);1450 if j= 1 then1449 AddLine(HelpText.Lookup('TECHAGE', J), pkSection); 1450 if J = 1 then 1451 1451 AddLine(Phrases.Lookup('ADVANCES', adScience) + ' ' + 1452 1452 HelpText.Lookup('BASETECH'), pkAdvIcon, adScience, hkAdv, 1453 1453 adScience); 1454 if j= 2 then1454 if J = 2 then 1455 1455 AddLine(Phrases.Lookup('ADVANCES', adMassProduction) + ' ' + 1456 1456 HelpText.Lookup('BASETECH'), pkAdvIcon, adMassProduction, hkAdv, 1457 1457 adMassProduction); 1458 1458 List.Clear; 1459 for i:= 0 to nAdv - 1 do1460 if ( i <> adScience) and (i<> adMassProduction) and1461 (AdvValue[ i] div 1000 = j) then1462 List.AddLine(Phrases.Lookup('ADVANCES', i), pkAdvIcon, i,1463 hkAdv, i);1459 for I := 0 to nAdv - 1 do 1460 if (I <> adScience) and (I <> adMassProduction) and 1461 (AdvValue[I] div 1000 = J) then 1462 List.AddLine(Phrases.Lookup('ADVANCES', I), pkAdvIcon, I, 1463 hkAdv, I); 1464 1464 List.Sort; 1465 1465 AppendList(List); … … 1487 1487 else 1488 1488 NextSection('PREREQ'); 1489 for i:= 0 to 2 do1490 if AdvPreq[no, i] <> preNone then1491 AddPreqAdv(AdvPreq[no, i]);1489 for I := 0 to 2 do 1490 if AdvPreq[no, I] <> preNone then 1491 AddPreqAdv(AdvPreq[no, I]); 1492 1492 NextSection('GOVALLOW'); 1493 for i:= 2 to nGov - 1 do1494 if GovPreq[ i] = no then1495 AddLine(Phrases.Lookup('GOVERNMENT', i), pkGov, i,1493 for I := 2 to nGov - 1 do 1494 if GovPreq[I] = no then 1495 AddLine(Phrases.Lookup('GOVERNMENT', I), pkGov, I, 1496 1496 hkMisc + hkCrossLink, miscGovList); 1497 1497 NextSection('BUILDALLOW'); 1498 for i:= 0 to nWonder - 1 do1499 if Imp[ i].Preq = no then1500 AddImprovement( i);1501 for i:= nWonder to nImp - 1 do1502 if (Imp[ i].Preq = no) and (Imp[i].Kind <> ikCommon) then1503 AddImprovement( i);1504 for i:= nWonder to nImp - 1 do1505 if (Imp[ i].Preq = no) and (Imp[i].Kind = ikCommon) then1506 AddImprovement( i);1498 for I := 0 to nWonder - 1 do 1499 if Imp[I].Preq = no then 1500 AddImprovement(I); 1501 for I := nWonder to nImp - 1 do 1502 if (Imp[I].Preq = no) and (Imp[I].Kind <> ikCommon) then 1503 AddImprovement(I); 1504 for I := nWonder to nImp - 1 do 1505 if (Imp[I].Preq = no) and (Imp[I].Kind = ikCommon) then 1506 AddImprovement(I); 1507 1507 NextSection('MODELALLOW'); 1508 for i:= 0 to nSpecialModel - 1 do1509 if SpecialModelPreq[ i] = no then1510 AddModel( i);1508 for I := 0 to nSpecialModel - 1 do 1509 if SpecialModelPreq[I] = no then 1510 AddModel(I); 1511 1511 NextSection('FEATALLOW'); 1512 for i:= 0 to nFeature - 1 do1513 if Feature[ i].Preq = no then1514 AddFeature( i);1512 for I := 0 to nFeature - 1 do 1513 if Feature[I].Preq = no then 1514 AddFeature(I); 1515 1515 NextSection('FOLLOWADV'); 1516 for i:= 0 to nAdv - 1 do1517 if (AdvPreq[ i, 0] = no) or (AdvPreq[i, 1] = no) or1518 (AdvPreq[ i, 2] = no) then1519 AddAdvance( i);1516 for I := 0 to nAdv - 1 do 1517 if (AdvPreq[I, 0] = no) or (AdvPreq[I, 1] = no) or 1518 (AdvPreq[I, 2] = no) then 1519 AddAdvance(I); 1520 1520 NextSection('UPGRADEALLOW'); 1521 1521 for Domain := 0 to nDomains - 1 do 1522 for i:= 1 to nUpgrade - 1 do1523 if upgrade[Domain, i].Preq = no then1522 for I := 1 to nUpgrade - 1 do 1523 if upgrade[Domain, I].Preq = no then 1524 1524 begin 1525 if upgrade[Domain, i].Strength > 0 then1525 if upgrade[Domain, I].Strength > 0 then 1526 1526 AddLine(Format(HelpText.Lookup('STRENGTHUP'), 1527 1527 [Phrases.Lookup('DOMAIN', Domain), upgrade[Domain, 1528 i].Strength]), pkDomain, Domain);1529 if upgrade[Domain, i].Trans > 0 then1528 I].Strength]), pkDomain, Domain); 1529 if upgrade[Domain, I].Trans > 0 then 1530 1530 AddLine(Format(HelpText.Lookup('TRANSUP'), 1531 [Phrases.Lookup('DOMAIN', Domain), upgrade[Domain, i].Trans]1531 [Phrases.Lookup('DOMAIN', Domain), upgrade[Domain, I].Trans] 1532 1532 ), pkDomain, Domain); 1533 1533 if no in FutureTech then 1534 1534 AddLine(Format(HelpText.Lookup('COSTUP'), 1535 [upgrade[Domain, i].Cost]), pkNormal_Dot)1535 [upgrade[Domain, I].Cost]), pkNormal_Dot) 1536 1536 else 1537 1537 AddLine(Format(HelpText.Lookup('COSTMIN'), 1538 [upgrade[Domain, i].Cost]), pkNormal_Dot)1538 [upgrade[Domain, I].Cost]), pkNormal_Dot) 1539 1539 end; 1540 1540 NextSection('EXPIRATION'); 1541 for i:= 0 to nWonder - 1 do1542 if (Imp[ i].Preq <> preNA) and (Imp[i].Expiration = no) then1543 AddImprovement( i);1541 for I := 0 to nWonder - 1 do 1542 if (Imp[I].Preq <> preNA) and (Imp[I].Expiration = no) then 1543 AddImprovement(I); 1544 1544 NextSection('ADVEFFECT'); 1545 s:= HelpText.LookupByHandle(hADVHELP, no);1546 if s<> '*' then1547 AddTextual( s);1545 S := HelpText.LookupByHandle(hADVHELP, no); 1546 if S <> '*' then 1547 AddTextual(S); 1548 1548 NextSection('SEEALSO'); 1549 CheckSeeAlso := true1549 CheckSeeAlso := True 1550 1550 end; 1551 1551 … … 1557 1557 List := THyperText.Create; 1558 1558 List.OwnsObjects := True; 1559 for i:= nWonder to nImp - 1 do1560 if ( i <> imTrGoods) and (Imp[i].Preq <> preNA) and1561 (Imp[ i].Kind = ikCommon) then1562 List.AddLine(Phrases.Lookup('IMPROVEMENTS', i), pkSmallIcon,1563 i, hkImp, i);1559 for I := nWonder to nImp - 1 do 1560 if (I <> imTrGoods) and (Imp[I].Preq <> preNA) and 1561 (Imp[I].Kind = ikCommon) then 1562 List.AddLine(Phrases.Lookup('IMPROVEMENTS', I), pkSmallIcon, 1563 I, hkImp, I); 1564 1564 List.Sort; 1565 1565 AppendList(List); … … 1570 1570 Caption := HelpText.Lookup('HELPTITLE_UNIQUELIST'); 1571 1571 // AddLine(HelpText.Lookup('HELPTITLE_UNIQUELIST'),pkSection); 1572 for i:= nWonder to nImp - 1 do1573 if (Imp[ i].Preq <> preNA) and1574 ((Imp[ i].Kind = ikNatLocal) or (Imp[i].Kind = ikNatGlobal)) then1575 AddLine(Phrases.Lookup('IMPROVEMENTS', i), pkSmallIcon, i,1576 hkImp, i);1572 for I := nWonder to nImp - 1 do 1573 if (Imp[I].Preq <> preNA) and 1574 ((Imp[I].Kind = ikNatLocal) or (Imp[I].Kind = ikNatGlobal)) then 1575 AddLine(Phrases.Lookup('IMPROVEMENTS', I), pkSmallIcon, I, 1576 hkImp, I); 1577 1577 { LineFeed; 1578 1578 LineFeed; 1579 1579 AddLine(HelpText.Lookup('HELPTITLE_SHIPPARTLIST'),pkSection); 1580 for i:= nWonder to nImp-1 do1581 if (Imp[ i].Preq<>preNA) and (Imp[i].Kind=ikShipPart) then1582 AddLine(Phrases.Lookup('IMPROVEMENTS', i),pkSmallIcon,i,hkImp,i); }1580 for I:= nWonder to nImp-1 do 1581 if (Imp[I].Preq<>preNA) and (Imp[I].Kind=ikShipPart) then 1582 AddLine(Phrases.Lookup('IMPROVEMENTS',I),pkSmallIcon,I,hkImp,I); } 1583 1583 end 1584 1584 else if no = 202 then … … 1586 1586 Caption := HelpText.Lookup('HELPTITLE_WONDERLIST'); 1587 1587 // AddLine(HelpText.Lookup('HELPTITLE_WONDERLIST'),pkSection); 1588 for i:= 0 to nWonder - 1 do1589 if Imp[ i].Preq <> preNA then1590 AddLine(Phrases.Lookup('IMPROVEMENTS', i), pkSmallIcon, i,1591 hkImp, i);1588 for I := 0 to nWonder - 1 do 1589 if Imp[I].Preq <> preNA then 1590 AddLine(Phrases.Lookup('IMPROVEMENTS', I), pkSmallIcon, I, 1591 hkImp, I); 1592 1592 end 1593 1593 else … … 1627 1627 NextSection('COSTS'); 1628 1628 if Difficulty = 0 then 1629 s:= Format(HelpText.Lookup('BUILDCOST'), [Imp[no].Cost])1629 S := Format(HelpText.Lookup('BUILDCOST'), [Imp[no].Cost]) 1630 1630 else 1631 s:= Format(HelpText.Lookup('BUILDCOST'),1631 S := Format(HelpText.Lookup('BUILDCOST'), 1632 1632 [Imp[no].Cost * BuildCostMod[Difficulty] div 12]); 1633 AddLine( s);1633 AddLine(S); 1634 1634 if Imp[no].Maint > 0 then 1635 1635 AddLine(Format(HelpText.Lookup('MAINTCOST'), [Imp[no].Maint])); 1636 j:= 0;1637 for i:= 0 to nImpReplacement - 1 do1638 if ImpReplacement[ i].NewImp = no then1639 begin 1640 if j= 0 then1636 J := 0; 1637 for I := 0 to nImpReplacement - 1 do 1638 if ImpReplacement[I].NewImp = no then 1639 begin 1640 if J = 0 then 1641 1641 begin 1642 1642 NextSection('REPLACE'); 1643 1643 AddItem('REPLACETEXT'); 1644 j:= 1;1644 J := 1; 1645 1645 end; 1646 AddImprovement(ImpReplacement[ i].OldImp);1646 AddImprovement(ImpReplacement[I].OldImp); 1647 1647 end; 1648 1648 if Imp[no].Kind = ikShipPart then … … 1650 1650 LineFeed; 1651 1651 if no = imShipComp then 1652 i:= 11652 I := 1 1653 1653 else if no = imShipPow then 1654 i:= 21654 I := 2 1655 1655 else { if no=imShipHab then } 1656 i:= 3;1656 I := 3; 1657 1657 AddLine(Format(HelpText.Lookup('RAREREQUIRED'), 1658 [Phrases.Lookup('TERRAIN', 3 * 12 + i)]), pkTer, 3 * 12 + i);1658 [Phrases.Lookup('TERRAIN', 3 * 12 + I)]), pkTer, 3 * 12 + I); 1659 1659 end; 1660 1660 if (no < nWonder) and (Imp[no].Expiration >= 0) then 1661 1661 begin 1662 1662 NextSection('EXPIRATION'); 1663 s:= Format(HelpText.Lookup('EXPWITH'),1663 S := Format(HelpText.Lookup('EXPWITH'), 1664 1664 [Phrases.Lookup('ADVANCES', Imp[no].Expiration)]); 1665 1665 if no = woPyramids then 1666 s := s+ ' ' + HelpText.Lookup('EXPSLAVE');1667 AddTextual( s);1666 S := S + ' ' + HelpText.Lookup('EXPSLAVE'); 1667 AddTextual(S); 1668 1668 end; 1669 1669 NextSection('SEEALSO'); 1670 1670 if (no < nWonder) and (Imp[no].Expiration >= 0) then 1671 1671 AddImprovement(woEiffel); 1672 for i:= 0 to nImpReplacement - 1 do1673 if ImpReplacement[ i].OldImp = no then1674 AddImprovement(ImpReplacement[ i].NewImp);1672 for I := 0 to nImpReplacement - 1 do 1673 if ImpReplacement[I].OldImp = no then 1674 AddImprovement(ImpReplacement[I].NewImp); 1675 1675 if no = imSupermarket then 1676 1676 AddLine(HelpText.Lookup('HELPTITLE_JOBLIST'), pkNormal, 0, 1677 1677 hkMisc + hkCrossLink, miscJobList); 1678 CheckSeeAlso := true;1678 CheckSeeAlso := True; 1679 1679 end; 1680 1680 … … 1684 1684 Caption := HelpText.Lookup('HELPTITLE_TERLIST'); 1685 1685 // AddLine(HelpText.Lookup('HELPTITLE_TERLIST'),pkSection); 1686 for i:= 0 to nTerrainHelp - 1 do1687 AddTerrain(TerrainHelp[ i]);1686 for I := 0 to nTerrainHelp - 1 do 1687 AddTerrain(TerrainHelp[I]); 1688 1688 end 1689 1689 else … … 1746 1746 begin 1747 1747 LineFeed; 1748 i:= TransTerrain;1749 if (TerrType <> fGrass) and ( i<> fGrass) then1750 i := i+ TerrSubType * 12;1748 I := TransTerrain; 1749 if (TerrType <> fGrass) and (I <> fGrass) then 1750 I := I + TerrSubType * 12; 1751 1751 // trafo to same Special resource group 1752 1752 AddLine(Format(HelpText.Lookup('TRAFO'), 1753 [Phrases.Lookup('TERRAIN', i)]), pkTer, i,1754 hkTer + hkCrossLink, i);1753 [Phrases.Lookup('TERRAIN', I)]), pkTer, I, 1754 hkTer + hkCrossLink, I); 1755 1755 if no = fSwamp + 12 then 1756 1756 begin … … 1760 1760 TransTerrain + 24, hkTer + hkCrossLink, TransTerrain + 24); 1761 1761 end 1762 else if i= fGrass then1762 else if I = fGrass then 1763 1763 begin 1764 1764 LineFeed; … … 1790 1790 AddLine(Phrases.Lookup('TERRAIN', no + Special * 12), pkTer, 1791 1791 no + Special * 12); 1792 i:= FoodRes[Special] - FoodRes[0];1793 if i<> 0 then1792 I := FoodRes[Special] - FoodRes[0]; 1793 if I <> 0 then 1794 1794 MainText[Count - 1] := MainText[Count - 1] + 1795 Format(HelpText.Lookup('SPECIALFOOD'), [ i]);1796 i:= ProdRes[Special] - ProdRes[0];1797 if i<> 0 then1795 Format(HelpText.Lookup('SPECIALFOOD'), [I]); 1796 I := ProdRes[Special] - ProdRes[0]; 1797 if I <> 0 then 1798 1798 MainText[Count - 1] := MainText[Count - 1] + 1799 Format(HelpText.Lookup('SPECIALPROD'), [ i]);1800 i:= TradeRes[Special] - TradeRes[0];1801 if i<> 0 then1799 Format(HelpText.Lookup('SPECIALPROD'), [I]); 1800 I := TradeRes[Special] - TradeRes[0]; 1801 if I <> 0 then 1802 1802 MainText[Count - 1] := MainText[Count - 1] + 1803 Format(HelpText.Lookup('SPECIALTRADE'), [ i]);1803 Format(HelpText.Lookup('SPECIALTRADE'), [I]); 1804 1804 end; 1805 1805 end; … … 1813 1813 NextSection('SEEALSO'); 1814 1814 AddImprovement(woGardens); 1815 CheckSeeAlso := true1815 CheckSeeAlso := True 1816 1816 end; 1817 1817 end; … … 1837 1837 end; 1838 1838 List.Clear; 1839 for i:= 0 to nFeature - 1 do1840 if Feature[ i].Preq <> preNA then1839 for I := 0 to nFeature - 1 do 1840 if Feature[I].Preq <> preNA then 1841 1841 begin 1842 if i< mcFirstNonCap then1843 j:= 01844 else if iin AutoFeature then1845 j:= 21842 if I < mcFirstNonCap then 1843 J := 0 1844 else if I in AutoFeature then 1845 J := 2 1846 1846 else 1847 j:= 1;1848 if j= Special then1849 List.AddLine(Phrases.Lookup('FEATURES', i), pkFeature, i,1850 hkFeature, i);1847 J := 1; 1848 if J = Special then 1849 List.AddLine(Phrases.Lookup('FEATURES', I), pkFeature, I, 1850 hkFeature, I); 1851 1851 end; 1852 1852 List.Sort; … … 1871 1871 begin 1872 1872 NextSection('COSTS'); 1873 s:= IntToStr(Feature[no].Cost);1873 S := IntToStr(Feature[no].Cost); 1874 1874 if Feature[no].Cost >= 0 then 1875 s := '+' + s;1876 AddLine(Format(HelpText.Lookup('COSTBASE'), [ s]));1875 S := '+' + S; 1876 AddLine(Format(HelpText.Lookup('COSTBASE'), [S])); 1877 1877 if Feature[no].Weight > 0 then 1878 1878 begin … … 1901 1901 begin 1902 1902 Caption := HelpText.Lookup('HELPTITLE_MODELLIST'); 1903 for i:= 0 to nSpecialModel - 1 do1904 if i<> 2 then1905 AddModelText( i);1903 for I := 0 to nSpecialModel - 1 do 1904 if I <> 2 then 1905 AddModelText(I); 1906 1906 LineFeed; 1907 1907 AddItem('MODELNOTE'); … … 1910 1910 end; 1911 1911 if CheckSeeAlso then 1912 for i:= 0 to nSeeAlso - 1 do1913 if (SeeAlso[ i].Kind = Kind) and (SeeAlso[i].no = no) then1914 case SeeAlso[ i].SeeKind of1915 hkImp: AddImprovement(SeeAlso[ i].SeeNo);1916 hkAdv: AddAdvance(SeeAlso[ i].SeeNo);1917 hkFeature: AddFeature(SeeAlso[ i].SeeNo);1912 for I := 0 to nSeeAlso - 1 do 1913 if (SeeAlso[I].Kind = Kind) and (SeeAlso[I].no = no) then 1914 case SeeAlso[I].SeeKind of 1915 hkImp: AddImprovement(SeeAlso[I].SeeNo); 1916 hkAdv: AddAdvance(SeeAlso[I].SeeNo); 1917 hkFeature: AddFeature(SeeAlso[I].SeeNo); 1918 1918 end; 1919 1919 if (Headline >= 0) and (Count = Headline + 1) then … … 1949 1949 1950 1950 procedure THelpDlg.PaintBox1MouseMove(Sender: TObject; Shift: TShiftState; 1951 x, y: integer);1951 X, Y: Integer); 1952 1952 var 1953 1953 i0, Sel0: Integer; 1954 1954 begin 1955 y := y- WideFrame;1955 Y := Y - WideFrame; 1956 1956 i0 := ScrollBar.Position; 1957 1957 Sel0 := Sel; 1958 if ( x >= SideFrame) and (x < SideFrame + InnerWidth) and (y>= 0) and1959 ( y < InnerHeight) and (ymod 24 >= 8) then1960 Sel := ydiv 241958 if (X >= SideFrame) and (X < SideFrame + InnerWidth) and (Y >= 0) and 1959 (Y < InnerHeight) and (Y mod 24 >= 8) then 1960 Sel := Y div 24 1961 1961 else 1962 1962 Sel := -1; … … 1974 1974 1975 1975 procedure THelpDlg.PaintBox1MouseDown(Sender: TObject; Button: TMouseButton; 1976 Shift: TShiftState; x, y: integer);1976 Shift: TShiftState; X, Y: Integer); 1977 1977 begin 1978 1978 if Sel >= 0 then … … 1987 1987 begin 1988 1988 if (Link >= $8000) and (Link and $3FFF = liInvalid) then 1989 exit; // invalid link;1989 Exit; // invalid link; 1990 1990 if Link >= $8000 then 1991 1991 ShowNewContent(FWindowMode, hkText, Link and $3FFF) … … 2079 2079 procedure THelpDlg.Search(SearchString: string); 2080 2080 var 2081 h, i, PrevHandle, PrevIndex, p, RightMargin: Integer;2082 s: string;2081 H, I, PrevHandle, PrevIndex, P, RightMargin: Integer; 2082 S: string; 2083 2083 mADVHELP, mIMPHELP, mFEATUREHELP: set of 0 .. 255; 2084 2084 bGOVHELP, bSPECIALMODEL, bJOBHELP: Boolean; … … 2094 2094 // search in generic reference 2095 2095 SearchString := UpperCase(SearchString); 2096 for i:= 0 to 35 + 4 do begin2097 s := Phrases.Lookup('TERRAIN', i);2098 if pos(SearchString, UpperCase(s)) > 0 then2099 if i< 36 then2100 SearchResult.AddLine( s+ ' ' + HelpText.Lookup('HELPSPEC_TER'),2101 pkNormal, 0, hkTer + hkCrossLink, i)2096 for I := 0 to 35 + 4 do begin 2097 S := Phrases.Lookup('TERRAIN', I); 2098 if Pos(SearchString, UpperCase(S)) > 0 then 2099 if I < 36 then 2100 SearchResult.AddLine(S + ' ' + HelpText.Lookup('HELPSPEC_TER'), 2101 pkNormal, 0, hkTer + hkCrossLink, I) 2102 2102 else 2103 2103 begin … … 2105 2105 HelpText.Lookup('HELPSPEC_TER'), pkNormal, 0, 2106 2106 hkTer + hkCrossLink, 36); 2107 if i> 36 then2107 if I > 36 then 2108 2108 SearchResult.AddLine(Phrases.Lookup('IMPROVEMENTS', 2109 imShipComp + i- 37) + ' ' + HelpText.Lookup('HELPSPEC_SHIPPART'),2110 pkNormal, 0, hkImp + hkCrossLink, imShipComp + i- 37);2109 imShipComp + I - 37) + ' ' + HelpText.Lookup('HELPSPEC_SHIPPART'), 2110 pkNormal, 0, hkImp + hkCrossLink, imShipComp + I - 37); 2111 2111 Break; 2112 2112 end; 2113 2113 end; 2114 for i:= 0 to nJobHelp - 1 do2115 if pos(SearchString, UpperCase(Phrases.Lookup('JOBRESULT', JobHelp[i]))) > 02114 for I := 0 to nJobHelp - 1 do 2115 if Pos(SearchString, UpperCase(Phrases.Lookup('JOBRESULT', JobHelp[I]))) > 0 2116 2116 then 2117 2117 begin … … 2121 2121 Break; 2122 2122 end; 2123 for i:= 0 to nAdv - 1 do2124 begin 2125 s := Phrases.Lookup('ADVANCES', i);2126 if pos(SearchString, UpperCase(s)) > 0 then2123 for I := 0 to nAdv - 1 do 2124 begin 2125 S := Phrases.Lookup('ADVANCES', I); 2126 if Pos(SearchString, UpperCase(S)) > 0 then 2127 2127 begin 2128 if iin FutureTech then2129 s := s+ ' ' + HelpText.Lookup('HELPSPEC_FUTURE')2128 if I in FutureTech then 2129 S := S + ' ' + HelpText.Lookup('HELPSPEC_FUTURE') 2130 2130 else 2131 s := s+ ' ' + HelpText.Lookup('HELPSPEC_ADV');2132 SearchResult.AddLine( s, pkNormal, 0, hkAdv + hkCrossLink, i);2133 include(mADVHELP, i);2131 S := S + ' ' + HelpText.Lookup('HELPSPEC_ADV'); 2132 SearchResult.AddLine(S, pkNormal, 0, hkAdv + hkCrossLink, I); 2133 Include(mADVHELP, I); 2134 2134 end; 2135 2135 end; 2136 for i:= 0 to nSpecialModel - 1 do2137 begin 2138 FindStdModelPicture(SpecialModelPictureCode[ i], h, s);2139 if pos(SearchString, UpperCase(s)) > 0 then2136 for I := 0 to nSpecialModel - 1 do 2137 begin 2138 FindStdModelPicture(SpecialModelPictureCode[I], H, S); 2139 if Pos(SearchString, UpperCase(S)) > 0 then 2140 2140 begin 2141 2141 SearchResult.AddLine(HelpText.Lookup('HELPTITLE_MODELLIST'), pkNormal, 0, … … 2145 2145 end; 2146 2146 end; 2147 for i:= 0 to nFeature - 1 do2148 begin 2149 s := Phrases.Lookup('FEATURES', i);2150 if Pos(SearchString, UpperCase( s)) > 0 then2147 for I := 0 to nFeature - 1 do 2148 begin 2149 S := Phrases.Lookup('FEATURES', I); 2150 if Pos(SearchString, UpperCase(S)) > 0 then 2151 2151 begin 2152 if i< mcFirstNonCap then2153 s := s+ ' ' + HelpText.Lookup('HELPSPEC_CAP')2154 else if iin AutoFeature then2155 s := s+ ' ' + HelpText.Lookup('HELPSPEC_STANDARD')2152 if I < mcFirstNonCap then 2153 S := S + ' ' + HelpText.Lookup('HELPSPEC_CAP') 2154 else if I in AutoFeature then 2155 S := S + ' ' + HelpText.Lookup('HELPSPEC_STANDARD') 2156 2156 else 2157 s := s+ ' ' + HelpText.Lookup('HELPSPEC_FEATURE');2158 SearchResult.AddLine( s, pkNormal, 0, hkFeature + hkCrossLink, i);2159 Include(mFEATUREHELP, i);2157 S := S + ' ' + HelpText.Lookup('HELPSPEC_FEATURE'); 2158 SearchResult.AddLine(S, pkNormal, 0, hkFeature + hkCrossLink, I); 2159 Include(mFEATUREHELP, I); 2160 2160 end; 2161 2161 end; 2162 for i:= 0 to nImp - 1 do2163 begin 2164 s := Phrases.Lookup('IMPROVEMENTS', i);2165 if Pos(SearchString, UpperCase( s)) > 0 then2162 for I := 0 to nImp - 1 do 2163 begin 2164 S := Phrases.Lookup('IMPROVEMENTS', I); 2165 if Pos(SearchString, UpperCase(S)) > 0 then 2166 2166 begin 2167 case Imp[ i].Kind of2167 case Imp[I].Kind of 2168 2168 ikWonder: 2169 s := s+ ' ' + HelpText.Lookup('HELPSPEC_WONDER');2169 S := S + ' ' + HelpText.Lookup('HELPSPEC_WONDER'); 2170 2170 ikCommon: 2171 s := s+ ' ' + HelpText.Lookup('HELPSPEC_IMP');2171 S := S + ' ' + HelpText.Lookup('HELPSPEC_IMP'); 2172 2172 ikShipPart: 2173 s := s+ ' ' + HelpText.Lookup('HELPSPEC_SHIPPART');2173 S := S + ' ' + HelpText.Lookup('HELPSPEC_SHIPPART'); 2174 2174 else 2175 s := s+ ' ' + HelpText.Lookup('HELPSPEC_NAT')2175 S := S + ' ' + HelpText.Lookup('HELPSPEC_NAT') 2176 2176 end; 2177 SearchResult.AddLine( s, pkNormal, 0, hkImp + hkCrossLink, i);2178 Include(mIMPHELP, i);2177 SearchResult.AddLine(S, pkNormal, 0, hkImp + hkCrossLink, I); 2178 Include(mIMPHELP, I); 2179 2179 end 2180 2180 end; 2181 for i:= 0 to nGov - 1 do2182 if Pos(SearchString, UpperCase(Phrases.Lookup('GOVERNMENT', i))) > 0 then2181 for I := 0 to nGov - 1 do 2182 if Pos(SearchString, UpperCase(Phrases.Lookup('GOVERNMENT', I))) > 0 then 2183 2183 begin 2184 2184 SearchResult.AddLine(HelpText.Lookup('HELPTITLE_GOVLIST'), pkNormal, 0, … … 2189 2189 2190 2190 // full text search 2191 h:= -1;2191 H := -1; 2192 2192 repeat 2193 PrevHandle := h;2194 PrevIndex := i;2195 if not HelpText.Search(SearchString, h, i) then2193 PrevHandle := H; 2194 PrevIndex := I; 2195 if not HelpText.Search(SearchString, H, I) then 2196 2196 Break; 2197 if h= hADVHELP then2197 if H = hADVHELP then 2198 2198 begin 2199 if ( i >= 0) and ((i <> PrevIndex) or (h<> PrevHandle)) and2200 not( iin mADVHELP) then2199 if (I >= 0) and ((I <> PrevIndex) or (H <> PrevHandle)) and 2200 not(I in mADVHELP) then 2201 2201 begin 2202 s := Phrases.Lookup('ADVANCES', i);2203 if iin FutureTech then2204 s := s+ ' ' + HelpText.Lookup('HELPSPEC_FUTURE')2202 S := Phrases.Lookup('ADVANCES', I); 2203 if I in FutureTech then 2204 S := S + ' ' + HelpText.Lookup('HELPSPEC_FUTURE') 2205 2205 else 2206 s := s+ ' ' + HelpText.Lookup('HELPSPEC_ADV');2207 SearchResult.AddLine( s, pkNormal, 0, hkAdv + hkCrossLink, i)2206 S := S + ' ' + HelpText.Lookup('HELPSPEC_ADV'); 2207 SearchResult.AddLine(S, pkNormal, 0, hkAdv + hkCrossLink, I) 2208 2208 end; 2209 2209 end 2210 else if h= hIMPHELP then2210 else if H = hIMPHELP then 2211 2211 begin 2212 if ( i >= 0) and ((i <> PrevIndex) or (h<> PrevHandle)) and2213 not( iin mIMPHELP) then2212 if (I >= 0) and ((I <> PrevIndex) or (H <> PrevHandle)) and 2213 not(I in mIMPHELP) then 2214 2214 begin 2215 s := Phrases.Lookup('IMPROVEMENTS', i);2216 case Imp[ i].Kind of2215 S := Phrases.Lookup('IMPROVEMENTS', I); 2216 case Imp[I].Kind of 2217 2217 ikWonder: 2218 s := s+ ' ' + HelpText.Lookup('HELPSPEC_WONDER');2218 S := S + ' ' + HelpText.Lookup('HELPSPEC_WONDER'); 2219 2219 ikCommon: 2220 s := s+ ' ' + HelpText.Lookup('HELPSPEC_IMP');2220 S := S + ' ' + HelpText.Lookup('HELPSPEC_IMP'); 2221 2221 ikShipPart: 2222 s := s+ ' ' + HelpText.Lookup('HELPSPEC_SHIPPART');2222 S := S + ' ' + HelpText.Lookup('HELPSPEC_SHIPPART'); 2223 2223 else 2224 s := s+ ' ' + HelpText.Lookup('HELPSPEC_NAT')2224 S := S + ' ' + HelpText.Lookup('HELPSPEC_NAT') 2225 2225 end; 2226 SearchResult.AddLine( s, pkNormal, 0, hkImp + hkCrossLink, i)2226 SearchResult.AddLine(S, pkNormal, 0, hkImp + hkCrossLink, I) 2227 2227 end; 2228 2228 end 2229 else if h= hFEATUREHELP then2229 else if H = hFEATUREHELP then 2230 2230 begin 2231 if ( i >= 0) and ((i <> PrevIndex) or (h<> PrevHandle)) and2232 not( iin mFEATUREHELP) then2231 if (I >= 0) and ((I <> PrevIndex) or (H <> PrevHandle)) and 2232 not(I in mFEATUREHELP) then 2233 2233 begin 2234 s := Phrases.Lookup('FEATURES', i);2235 if i< mcFirstNonCap then2236 s := s+ ' ' + HelpText.Lookup('HELPSPEC_CAP')2237 else if iin AutoFeature then2238 s := s+ ' ' + HelpText.Lookup('HELPSPEC_STANDARD')2234 S := Phrases.Lookup('FEATURES', I); 2235 if I < mcFirstNonCap then 2236 S := S + ' ' + HelpText.Lookup('HELPSPEC_CAP') 2237 else if I in AutoFeature then 2238 S := S + ' ' + HelpText.Lookup('HELPSPEC_STANDARD') 2239 2239 else 2240 s := s+ ' ' + HelpText.Lookup('HELPSPEC_FEATURE');2241 SearchResult.AddLine( s, pkNormal, 0, hkFeature + hkCrossLink, i);2240 S := S + ' ' + HelpText.Lookup('HELPSPEC_FEATURE'); 2241 SearchResult.AddLine(S, pkNormal, 0, hkFeature + hkCrossLink, I); 2242 2242 end; 2243 2243 end 2244 else if h= hGOVHELP then2244 else if H = hGOVHELP then 2245 2245 begin 2246 if ( i >= 0) and (h<> PrevHandle) and not bGOVHELP then2246 if (I >= 0) and (H <> PrevHandle) and not bGOVHELP then 2247 2247 SearchResult.AddLine(HelpText.Lookup('HELPTITLE_GOVLIST'), pkNormal, 0, 2248 2248 hkMisc + hkCrossLink, miscGovList) 2249 2249 end 2250 else if h= hSPECIALMODEL then2250 else if H = hSPECIALMODEL then 2251 2251 begin 2252 if ( i >= 0) and (h<> PrevHandle) and not bSPECIALMODEL then2252 if (I >= 0) and (H <> PrevHandle) and not bSPECIALMODEL then 2253 2253 SearchResult.AddLine(HelpText.Lookup('HELPTITLE_MODELLIST'), pkNormal, 2254 2254 0, hkModel + hkCrossLink, 0) 2255 2255 end 2256 else if h= hJOBHELP then2256 else if H = hJOBHELP then 2257 2257 begin 2258 if ( i >= 0) and (h<> PrevHandle) and not bJOBHELP then2258 if (I >= 0) and (H <> PrevHandle) and not bJOBHELP then 2259 2259 SearchResult.AddLine(HelpText.Lookup('HELPTITLE_JOBLIST'), pkNormal, 0, 2260 2260 hkMisc + hkCrossLink, miscJobList) 2261 2261 end 2262 else if { (h<>hMAIN) and } ( h<> PrevHandle) then2262 else if { (h<>hMAIN) and } (H <> PrevHandle) then 2263 2263 begin 2264 s := HelpText.LookupByHandle(h);2265 p := Pos('$', s);2266 if p> 0 then2264 S := HelpText.LookupByHandle(H); 2265 P := Pos('$', S); 2266 if P > 0 then 2267 2267 begin 2268 s := Copy(s, p+ 1, maxint);2269 p := Pos('\', s);2270 if p> 0 then2271 s := Copy(s, 1, p- 1);2272 SearchResult.AddLine( s, pkNormal, 0, hkText + hkCrossLink, h);2268 S := Copy(S, P + 1, maxint); 2269 P := Pos('\', S); 2270 if P > 0 then 2271 S := Copy(S, 1, P - 1); 2272 SearchResult.AddLine(S, pkNormal, 0, hkText + hkCrossLink, H); 2273 2273 end; 2274 2274 end; … … 2278 2278 RightMargin := InnerWidth - 16 - GetSystemMetrics(SM_CXVSCROLL); 2279 2279 OffScreen.Canvas.Font.Assign(UniFont[ftNormal]); 2280 for i:= 0 to SearchResult.Count - 1 do2280 for I := 0 to SearchResult.Count - 1 do 2281 2281 begin 2282 while BiColorTextWidth(OffScreen.Canvas, SearchResult[ i]) >2282 while BiColorTextWidth(OffScreen.Canvas, SearchResult[I]) > 2283 2283 RightMargin - 32 do 2284 SearchResult[ i] := copy(SearchResult[i], 1, length(SearchResult[i]) - 1)2284 SearchResult[I] := Copy(SearchResult[I], 1, Length(SearchResult[I]) - 1) 2285 2285 end; 2286 2286 end;
Note:
See TracChangeset
for help on using the changeset viewer.