Changeset 447 for trunk/Start.pas
- Timestamp:
- May 19, 2022, 10:39:34 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Start.pas
r442 r447 69 69 procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 70 70 procedure FormMouseDown(Sender: TObject; Button: TMouseButton; 71 Shift: TShiftState; x, y: integer);71 Shift: TShiftState; X, Y: Integer); 72 72 procedure FormMouseUp(Sender: TObject; Button: TMouseButton; 73 Shift: TShiftState; x, y: integer);74 procedure FormMouseMove(Sender: TObject; Shift: TShiftState; x, y: integer);73 Shift: TShiftState; X, Y: Integer); 74 procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); 75 75 procedure Up1BtnClick(Sender: TObject); 76 76 procedure Down1BtnClick(Sender: TObject); … … 122 122 MiniMap: TMiniMap; 123 123 LastGame: string; 124 procedure DrawAction( y, IconIndex: integer; HeaderItem, TextItem: string);124 procedure DrawAction(Y, IconIndex: Integer; HeaderItem, TextItem: string); 125 125 procedure InitPopup(PlayerIndex: Integer); 126 126 procedure OfferBrain(Brain: TBrain; FixedLines: Integer); … … 129 129 procedure ChangeTab(NewTab: TStartTab); 130 130 procedure UnlistBackupFile(FileName: string); 131 procedure SmartInvalidate(x0, y0, x1, y1: integer;132 invalidateTab0: boolean = false); overload;131 procedure SmartInvalidate(x0, y0, x1, y1: Integer; 132 invalidateTab0: Boolean = False); overload; 133 133 procedure LoadConfig; 134 134 procedure SaveConfig; … … 160 160 // attention: lx*ly+1 must be prime! 161 161 { MaxWorldSize=8; 162 lxpre: array[0..nWorldSize-1] of integer =(30,40,50,60,70,90,110,130);163 lypre: array[0..nWorldSize-1] of integer =(46,52,60,70,84,94,110,130);162 lxpre: array[0..nWorldSize-1] of Integer =(30,40,50,60,70,90,110,130); 163 lypre: array[0..nWorldSize-1] of Integer =(46,52,60,70,84,94,110,130); 164 164 DefaultWorldTiles=4200; } 165 165 MaxWorldSize = 6; … … 192 192 dxBrain = 104; 193 193 dyBrain = 80; 194 xBrain: array [0 .. nPlOffered - 1] of integer = (x0Brain, x0Brain,194 xBrain: array [0 .. nPlOffered - 1] of Integer = (x0Brain, x0Brain, 195 195 x0Brain + dxBrain, x0Brain + dxBrain, x0Brain + dxBrain, x0Brain, 196 196 x0Brain - dxBrain, x0Brain - dxBrain, x0Brain - dxBrain); 197 yBrain: array [0 .. nPlOffered - 1] of integer = (y0Brain, y0Brain - dyBrain,197 yBrain: array [0 .. nPlOffered - 1] of Integer = (y0Brain, y0Brain - dyBrain, 198 198 y0Brain - dyBrain, y0Brain, y0Brain + dyBrain, y0Brain + dyBrain, 199 199 y0Brain + dyBrain, y0Brain, y0Brain - dyBrain); … … 202 202 TabHeight = 40; 203 203 204 InitAlive: array [1 .. nPl] of integer = (1, 1 + 2, 1 + 2 + 32,204 InitAlive: array [1 .. nPl] of Integer = (1, 1 + 2, 1 + 2 + 32, 205 205 1 + 2 + 8 + 128, 1 + 2 + 8 + 32 + 128, 1 + 2 + 8 + 16 + 64 + 128, 206 206 1 + 2 + 4 + 16 + 32 + 64 + 256, 511 - 32, 511, 511 - 32, 511, 511 - 32, 511, 207 207 511 - 32, 511); 208 InitMulti: array [nPlOffered + 1 .. nPl] of integer = (256, 256, 256 + 128,208 InitMulti: array [nPlOffered + 1 .. nPl] of Integer = (256, 256, 256 + 128, 209 209 256 + 128, 256 + 128 + 64, 256 + 128 + 64); 210 210 211 PlayerAutoDiff: array [1 .. 5] of integer = (1, 1, 2, 2, 3);212 EnemyAutoDiff: array [1 .. 5] of integer = (4, 3, 2, 1, 1);211 PlayerAutoDiff: array [1 .. 5] of Integer = (1, 1, 2, 2, 3); 212 EnemyAutoDiff: array [1 .. 5] of Integer = (4, 3, 2, 1, 1); 213 213 214 214 { TStartDlg } … … 216 216 procedure TStartDlg.FormCreate(Sender: TObject); 217 217 var 218 x, i: Integer;218 X, I: Integer; 219 219 PlayerSlot: TPlayerSlot; 220 220 AIBrains: TBrains; … … 236 236 237 237 BrainDefault := nil; 238 for i:= Brains.IndexOf(BrainRandom) to Brains.Count - 1 do239 if AnsiCompareFileName(DefaultAI, Brains[ i].FileName) = 0 then240 BrainDefault := Brains[ i];238 for I := Brains.IndexOf(BrainRandom) to Brains.Count - 1 do 239 if AnsiCompareFileName(DefaultAI, Brains[I].FileName) = 0 then 240 BrainDefault := Brains[I]; 241 241 if (BrainDefault = BrainRandom) and (Brains.GetKindCount(btAI) < 2) then 242 242 BrainDefault := nil; … … 260 260 ReplayBtn.Hint := Phrases.Lookup('BTN_REPLAY'); 261 261 PlayerSlots.Count := nPlOffered; 262 for i:= 0 to PlayerSlots.Count - 1 do263 with PlayerSlots[ i] do begin262 for I := 0 to PlayerSlots.Count - 1 do 263 with PlayerSlots[I] do begin 264 264 DiffUpBtn := TButtonC.Create(self); 265 265 DiffUpBtn.Graphic := HGrSystem.Data; 266 DiffUpBtn.left := xBrain[ i] - 18;267 DiffUpBtn.top := yBrain[ i] + 39;266 DiffUpBtn.left := xBrain[I] - 18; 267 DiffUpBtn.top := yBrain[I] + 39; 268 268 DiffUpBtn.ButtonIndex := 1; 269 269 DiffUpBtn.Parent := self; … … 271 271 DiffDownBtn := TButtonC.Create(self); 272 272 DiffDownBtn.Graphic := HGrSystem.Data; 273 DiffDownBtn.left := xBrain[ i] - 18;274 DiffDownBtn.top := yBrain[ i] + 51;273 DiffDownBtn.left := xBrain[I] - 18; 274 DiffDownBtn.top := yBrain[I] + 51; 275 275 DiffDownBtn.ButtonIndex := 0; 276 276 DiffDownBtn.Parent := self; 277 277 DiffDownBtn.OnClick := DiffBtnClick; 278 278 end; 279 for i:= 6 to 8 do280 with PlayerSlots[ i] do begin279 for I := 6 to 8 do 280 with PlayerSlots[I] do begin 281 281 MultiBtn := TButtonC.Create(self); 282 282 MultiBtn.Graphic := HGrSystem.Data; 283 MultiBtn.left := xBrain[ i] - 18;284 MultiBtn.top := yBrain[ i];283 MultiBtn.left := xBrain[I] - 18; 284 MultiBtn.top := yBrain[I]; 285 285 MultiBtn.Parent := self; 286 286 MultiBtn.OnClick := MultiBtnClick; … … 288 288 end; 289 289 290 x:= BiColorTextWidth(Canvas, Phrases.Lookup('STARTCONTROLS', 7)) div 2;291 CustomizeBtn.left := x0Brain + 32 - 16 - x;290 X := BiColorTextWidth(Canvas, Phrases.Lookup('STARTCONTROLS', 7)) div 2; 291 CustomizeBtn.left := x0Brain + 32 - 16 - X; 292 292 if AutoDiff < 0 then 293 293 CustomizeBtn.ButtonIndex := 3 … … 339 339 end; 340 340 341 procedure TStartDlg.SmartInvalidate(x0, y0, x1, y1: integer;342 invalidateTab0: boolean);343 var 344 i: integer;341 procedure TStartDlg.SmartInvalidate(x0, y0, x1, y1: Integer; 342 invalidateTab0: Boolean); 343 var 344 I: Integer; 345 345 r0, r1: HRgn; 346 346 begin 347 347 r0 := CreateRectRgn(x0, y0, x1, y1); 348 for i:= 0 to ControlCount - 1 do349 if not (Controls[ i] is TArea) and Controls[i].Visible then348 for I := 0 to ControlCount - 1 do 349 if not (Controls[I] is TArea) and Controls[I].Visible then 350 350 begin 351 with Controls[ i].BoundsRect do351 with Controls[I].BoundsRect do 352 352 r1 := CreateRectRgn(left, top, Right, Bottom); 353 353 CombineRgn(r0, r0, r1, RGN_DIFF); … … 359 359 DeleteObject(r1); 360 360 end; 361 InvalidateRgn(Handle, r0, false);361 InvalidateRgn(Handle, r0, False); 362 362 DeleteObject(r0); 363 363 end; … … 530 530 end; 531 531 532 procedure TStartDlg.DrawAction( y, IconIndex: integer; HeaderItem, TextItem: string);532 procedure TStartDlg.DrawAction(Y, IconIndex: Integer; HeaderItem, TextItem: string); 533 533 begin 534 534 Canvas.Font.Assign(UniFont[ftCaption]); 535 535 Canvas.Font.Style := Canvas.Font.Style + [fsUnderline]; 536 RisedTextOut(Canvas, xAction, y- 3, Phrases2.Lookup(HeaderItem));536 RisedTextOut(Canvas, xAction, Y - 3, Phrases2.Lookup(HeaderItem)); 537 537 Canvas.Font.Assign(UniFont[ftNormal]); 538 538 BiColorTextOut(Canvas, Colors.Canvas.Pixels[clkAge0 - 1, cliDimmedText], 539 $000000, xAction, y+ 21, Phrases2.Lookup(TextItem));539 $000000, xAction, Y + 21, Phrases2.Lookup(TextItem)); 540 540 541 541 UnshareBitmap(LogoBuffer); 542 542 BitBltCanvas(LogoBuffer.Canvas, 0, 0, 50, 50, Canvas, 543 xActionIcon - 2, y- 2);543 xActionIcon - 2, Y - 2); 544 544 GlowFrame(LogoBuffer, 8, 8, 34, 34, $202020); 545 BitBltCanvas(Canvas, xActionIcon - 2, y- 2, 50, 50,545 BitBltCanvas(Canvas, xActionIcon - 2, Y - 2, 50, 50, 546 546 LogoBuffer.Canvas, 0, 0); 547 BitBltCanvas(Canvas, xActionIcon, y, 40, 40, BigImp.Canvas,547 BitBltCanvas(Canvas, xActionIcon, Y, 40, 40, BigImp.Canvas, 548 548 (IconIndex mod 7) * xSizeBig + 8, (IconIndex div 7) * ySizeBig); 549 RFrame(Canvas, xActionIcon - 1, y - 1, xActionIcon + 40, y+ 40,549 RFrame(Canvas, xActionIcon - 1, Y - 1, xActionIcon + 40, Y + 40, 550 550 $000000, $000000); 551 551 end; … … 555 555 TabNames: array[TStartTab] of Integer = (0, 11, 3, 4); 556 556 var 557 i, w, h, xMini, yMini, y: integer;558 s: string;557 I, W, H, xMini, yMini, Y: Integer; 558 S: string; 559 559 Tab2: TStartTab; 560 560 MainAction: TMainAction; … … 588 588 589 589 // draw tabs 590 Frame(Canvas, 2, 2 + 2 * integer(Tab <> tbMain), TabOffset + (0 + 1) * TabSize - 1,590 Frame(Canvas, 2, 2 + 2 * Integer(Tab <> tbMain), TabOffset + (0 + 1) * TabSize - 1, 591 591 TabHeight, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 592 Frame(Canvas, 1, 1 + 2 * integer(Tab <> tbMain), TabOffset + (0 + 1) * TabSize,592 Frame(Canvas, 1, 1 + 2 * Integer(Tab <> tbMain), TabOffset + (0 + 1) * TabSize, 593 593 TabHeight, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 594 Canvas.Pixels[1, 1 + 2 * integer(Tab <> tbMain)] := MainTexture.ColorBevelShade;594 Canvas.Pixels[1, 1 + 2 * Integer(Tab <> tbMain)] := MainTexture.ColorBevelShade; 595 595 for Tab2 := tbMap to tbPrevious do 596 596 begin 597 Frame(Canvas, TabOffset + Integer(Tab2) * TabSize + 2, 2 + 2 * integer(Tab <> Tab2),597 Frame(Canvas, TabOffset + Integer(Tab2) * TabSize + 2, 2 + 2 * Integer(Tab <> Tab2), 598 598 TabOffset + (Integer(Tab2) + 1) * TabSize - 1, TabHeight, MainTexture.ColorBevelLight, 599 599 MainTexture.ColorBevelShade); 600 Frame(Canvas, TabOffset + Integer(Tab2) * TabSize + 1, 1 + 2 * integer(Tab <> Tab2),600 Frame(Canvas, TabOffset + Integer(Tab2) * TabSize + 1, 1 + 2 * Integer(Tab <> Tab2), 601 601 TabOffset + (Integer(Tab2) + 1) * TabSize, TabHeight, MainTexture.ColorBevelLight, 602 602 MainTexture.ColorBevelShade); 603 Canvas.Pixels[TabOffset + Integer(Tab2) * TabSize + 1, 1 + 2 * integer(Tab <> Tab2)] :=603 Canvas.Pixels[TabOffset + Integer(Tab2) * TabSize + 1, 1 + 2 * Integer(Tab <> Tab2)] := 604 604 MainTexture.ColorBevelShade; 605 605 end; … … 607 607 for Tab2 := tbMap to tbPrevious do 608 608 begin 609 s:= Phrases.Lookup('STARTCONTROLS', TabNames[Tab2]);609 S := Phrases.Lookup('STARTCONTROLS', TabNames[Tab2]); 610 610 RisedTextOut(Canvas, TabOffset + Integer(Tab2) * TabSize + 1 + 611 (TabSize - BiColorTextWidth(Canvas, s)) div 2,612 10 + 2 * integer(Tab <> Tab2), s);611 (TabSize - BiColorTextWidth(Canvas, S)) div 2, 612 10 + 2 * Integer(Tab <> Tab2), S); 613 613 end; 614 614 Frame(Canvas, TabOffset + 4 * TabSize + 1, -1, ClientWidth, TabHeight, … … 640 640 UnshareBitmap(LogoBuffer); 641 641 BitBltCanvas(LogoBuffer.Canvas, 0, 0, MenuLogo.Width, MenuLogo.Height, Canvas, 6, 642 3 + 2 * integer(Tab <> tbMain));642 3 + 2 * Integer(Tab <> tbMain)); 643 643 644 644 ImageOp_BCC(LogoBuffer, Templates.Data, 0, 0, MenuLogo.Left, MenuLogo.Top, … … 646 646 ImageOp_BCC(LogoBuffer, Templates.Data, 10, 27, MenuLogo.Left + 10, 647 647 MenuLogo.Top + 27, MenuLogo.Width - 10, 9, $BFBF20, $4040DF); // logo part 2 648 BitBltCanvas(Canvas, 6, 3 + 2 * integer(Tab <> tbMain), MenuLogo.Width, MenuLogo.Height,648 BitBltCanvas(Canvas, 6, 3 + 2 * Integer(Tab <> tbMain), MenuLogo.Width, MenuLogo.Height, 649 649 LogoBuffer.Canvas, 0, 0); 650 650 651 651 if Page = pgMain then begin 652 652 if SelectedAction <> maNone then // mark selected action 653 for i:= 0 to (ClientWidth - 2 * ActionSideBorder) div wBuffer + 1 do653 for I := 0 to (ClientWidth - 2 * ActionSideBorder) div wBuffer + 1 do 654 654 begin 655 w := ClientWidth - 2 * ActionSideBorder - i* wBuffer;656 if w> wBuffer then657 w:= wBuffer;658 h:= ActionPitch;659 if yAction + Integer(SelectedAction) * ActionPitch - 8 + h> ClientHeight - ActionBottomBorder655 W := ClientWidth - 2 * ActionSideBorder - I * wBuffer; 656 if W > wBuffer then 657 W := wBuffer; 658 H := ActionPitch; 659 if yAction + Integer(SelectedAction) * ActionPitch - 8 + H > ClientHeight - ActionBottomBorder 660 660 then 661 h:= ClientHeight - ActionBottomBorder -661 H := ClientHeight - ActionBottomBorder - 662 662 (yAction + Integer(SelectedAction) * ActionPitch - 8); 663 663 664 664 UnshareBitmap(LogoBuffer); 665 BitBltCanvas(LogoBuffer.Canvas, 0, 0, w, h, Canvas,666 ActionSideBorder + i* wBuffer, yAction + Integer(SelectedAction) * ActionPitch665 BitBltCanvas(LogoBuffer.Canvas, 0, 0, W, H, Canvas, 666 ActionSideBorder + I * wBuffer, yAction + Integer(SelectedAction) * ActionPitch 667 667 - 8); 668 MakeBlue(LogoBuffer, 0, 0, w, h);669 BitBltCanvas(Canvas, ActionSideBorder + i* wBuffer,670 yAction + Integer(SelectedAction) * ActionPitch - 8, w, h,668 MakeBlue(LogoBuffer, 0, 0, W, H); 669 BitBltCanvas(Canvas, ActionSideBorder + I * wBuffer, 670 yAction + Integer(SelectedAction) * ActionPitch - 8, W, H, 671 671 LogoBuffer.Canvas, 0, 0); 672 672 end; 673 y:= yAction;673 Y := yAction; 674 674 for MainAction := Low(TMainActionSet) to High(TMainActionSet) do 675 675 begin 676 676 if MainAction in ActionsOffered then 677 677 case MainAction of 678 maConfig: DrawAction( y, 25, 'ACTIONHEADER_CONFIG', 'ACTION_CONFIG');679 maManual: DrawAction( y, 19, 'ACTIONHEADER_MANUAL', 'ACTION_MANUAL');680 maCredits: DrawAction( y, 22, 'ACTIONHEADER_CREDITS', 'ACTION_CREDITS');681 maAIDev: DrawAction( y, 24, 'ACTIONHEADER_AIDEV', 'ACTION_AIDEV');678 maConfig: DrawAction(Y, 25, 'ACTIONHEADER_CONFIG', 'ACTION_CONFIG'); 679 maManual: DrawAction(Y, 19, 'ACTIONHEADER_MANUAL', 'ACTION_MANUAL'); 680 maCredits: DrawAction(Y, 22, 'ACTIONHEADER_CREDITS', 'ACTION_CREDITS'); 681 maAIDev: DrawAction(Y, 24, 'ACTIONHEADER_AIDEV', 'ACTION_AIDEV'); 682 682 maWeb: 683 683 begin 684 684 Canvas.Font.Assign(UniFont[ftCaption]); 685 685 // Canvas.Font.Style:=Canvas.Font.Style+[fsUnderline]; 686 RisedTextOut(Canvas, xActionIcon + 99, y,686 RisedTextOut(Canvas, xActionIcon + 99, Y, 687 687 Format(Phrases2.Lookup('ACTIONHEADER_WEB'), [CevoHomepageShort])); 688 688 Canvas.Font.Assign(UniFont[ftNormal]); … … 690 690 UnshareBitmap(LogoBuffer); 691 691 BitBltCanvas(LogoBuffer.Canvas, 0, 0, LinkArrows.Width, LinkArrows.Height, Canvas, 692 xActionIcon, y+ 2);692 xActionIcon, Y + 2); 693 693 ImageOp_BCC(LogoBuffer, Templates.Data, Point(0, 0), LinkArrows.BoundsRect, 0, 694 694 Colors.Canvas.Pixels[clkAge0 - 1, cliDimmedText]); 695 BitBltCanvas(Canvas, xActionIcon, y+ 2, LinkArrows.Width, LinkArrows.Height,695 BitBltCanvas(Canvas, xActionIcon, Y + 2, LinkArrows.Width, LinkArrows.Height, 696 696 LogoBuffer.Canvas, 0, 0); 697 697 end; 698 698 end; 699 Inc( y, ActionPitch);699 Inc(Y, ActionPitch); 700 700 end; 701 701 end … … 705 705 TurnToString(MaxTurn), 344, y0Mini + 61, 170); 706 706 707 s:= Phrases.Lookup('STARTCONTROLS', 7);708 w := Canvas.TextWidth(s);709 LoweredTextOut(Canvas, -2, MainTexture, x0Brain + 32 - wdiv 2,710 y0Brain + dyBrain + 69, s);707 S := Phrases.Lookup('STARTCONTROLS', 7); 708 W := Canvas.TextWidth(S); 709 LoweredTextOut(Canvas, -2, MainTexture, x0Brain + 32 - W div 2, 710 y0Brain + dyBrain + 69, S); 711 711 712 712 InitOrnament; 713 713 if AutoDiff < 0 then 714 714 begin 715 for i:= 12 to 19 do716 if ( i < 13) or (i> 17) then begin717 BitBltCanvas(Canvas, 9 + i* 27, yLogo - 2, Ornament.Width, Ornament.Height,715 for I := 12 to 19 do 716 if (I < 13) or (I > 17) then begin 717 BitBltCanvas(Canvas, 9 + I * 27, yLogo - 2, Ornament.Width, Ornament.Height, 718 718 HGrSystem2.Mask.Canvas, Ornament.Left, Ornament.Top, SRCAND); 719 BitBltCanvas(Canvas, 9 + i* 27, yLogo - 2, Ornament.Width, Ornament.Height,719 BitBltCanvas(Canvas, 9 + I * 27, yLogo - 2, Ornament.Width, Ornament.Height, 720 720 HGrSystem2.Data.Canvas, Ornament.Left, Ornament.Top, SRCPAINT); 721 721 end; … … 723 723 MainTexture.ColorBevelShade); 724 724 725 for i:= 0 to nPlOffered - 1 do726 if 1 shl iand SlotAvailable <> 0 then725 for I := 0 to nPlOffered - 1 do 726 if 1 shl I and SlotAvailable <> 0 then 727 727 begin 728 if Assigned(PlayersBrain[ i]) then729 FrameImage(Canvas, PlayersBrain[ i].Picture, xBrain[i], yBrain[i],730 64, 64, 0, 0, true)728 if Assigned(PlayersBrain[I]) then 729 FrameImage(Canvas, PlayersBrain[I].Picture, xBrain[I], yBrain[I], 730 64, 64, 0, 0, True) 731 731 else 732 FrameImage(Canvas, EmptyPicture, xBrain[ i], yBrain[i], 64, 64,733 0, 0, true);734 if Assigned(PlayersBrain[I]) and (PlayersBrain[ i].Kind in [btTerm, btRandom, btAI]) then732 FrameImage(Canvas, EmptyPicture, xBrain[I], yBrain[I], 64, 64, 733 0, 0, True); 734 if Assigned(PlayersBrain[I]) and (PlayersBrain[I].Kind in [btTerm, btRandom, btAI]) then 735 735 begin 736 BitBltCanvas(Canvas, xBrain[ i] - 18, yBrain[i] + 19, 12, 14,737 HGrSystem.Data.Canvas, 134 + (Difficulty[ i] - 1) *736 BitBltCanvas(Canvas, xBrain[I] - 18, yBrain[I] + 19, 12, 14, 737 HGrSystem.Data.Canvas, 134 + (Difficulty[I] - 1) * 738 738 13, 28); 739 Frame(Canvas, xBrain[ i] - 19, yBrain[i] + 18, xBrain[i] - 18 + 12,740 yBrain[ i] + (19 + 14), $000000, $000000);741 RFrame(Canvas, PlayerSlots[ i].DiffUpBtn.left - 1, PlayerSlots[i].DiffUpBtn.top - 1,742 PlayerSlots[ i].DiffUpBtn.left + 12, PlayerSlots[i].DiffUpBtn.top + 24,739 Frame(Canvas, xBrain[I] - 19, yBrain[I] + 18, xBrain[I] - 18 + 12, 740 yBrain[I] + (19 + 14), $000000, $000000); 741 RFrame(Canvas, PlayerSlots[I].DiffUpBtn.left - 1, PlayerSlots[I].DiffUpBtn.top - 1, 742 PlayerSlots[I].DiffUpBtn.left + 12, PlayerSlots[I].DiffUpBtn.top + 24, 743 743 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 744 744 with Canvas do 745 745 begin 746 746 Brush.Color := $000000; 747 FillRect(Rect(xBrain[ i] - 5, yBrain[i] + 25, xBrain[i] - 2,748 yBrain[ i] + 27));747 FillRect(Rect(xBrain[I] - 5, yBrain[I] + 25, xBrain[I] - 2, 748 yBrain[I] + 27)); 749 749 Brush.Style := bsClear; 750 750 end; … … 754 754 PlayerSlots[I].MultiBtn.left + 12, PlayerSlots[I].MultiBtn.top + 12, 755 755 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 756 BitBltCanvas(Canvas, xBrain[ i] - 31, yBrain[i], 13, 12,756 BitBltCanvas(Canvas, xBrain[I] - 31, yBrain[I], 13, 12, 757 757 HGrSystem.Data.Canvas, 88, 47); 758 758 end; 759 759 end; 760 if Assigned(PlayersBrain[ i]) then760 if Assigned(PlayersBrain[I]) then 761 761 begin 762 PlayerSlots[ i].DiffUpBtn.Hint := Format(Phrases.Lookup('STARTCONTROLS', 9),763 [PlayersBrain[ i].Name]);764 PlayerSlots[ i].DiffDownBtn.Hint := PlayerSlots[i].DiffUpBtn.Hint;762 PlayerSlots[I].DiffUpBtn.Hint := Format(Phrases.Lookup('STARTCONTROLS', 9), 763 [PlayersBrain[I].Name]); 764 PlayerSlots[I].DiffDownBtn.Hint := PlayerSlots[I].DiffUpBtn.Hint; 765 765 end; 766 766 end; … … 773 773 yMain + 140 { y0Mini-77 } , Phrases.Lookup('STARTCONTROLS', 15)); 774 774 if Page = pgStartRandom then 775 s:= IntToStr(AutoEnemies)775 S := IntToStr(AutoEnemies) 776 776 else if nMapStartPositions = 0 then 777 s:= '0'777 S := '0' 778 778 else 779 s:= IntToStr(nMapStartPositions - 1);780 RisedTextOut(Canvas, 198 - BiColorTextWidth(Canvas, s), yMain + 140, s);779 S := IntToStr(nMapStartPositions - 1); 780 RisedTextOut(Canvas, 198 - BiColorTextWidth(Canvas, S), yMain + 140, S); 781 781 782 782 DLine(Canvas, 24, xDefault - 6, yMain + 164 + 19, … … 786 786 if AutoDiff = 1 then 787 787 FrameImage(Canvas, Brains.GetBeginner.Picture, xDefault, yDefault, 64, 788 64, 0, 0, false)788 64, 0, 0, False) 789 789 else 790 790 FrameImage(Canvas, BrainDefault.Picture, xDefault, yDefault, 64, 64, 791 0, 0, true);791 0, 0, True); 792 792 DLine(Canvas, 56, 272, y0Mini + 61 + 19, MainTexture.ColorBevelLight, 793 793 MainTexture.ColorBevelShade); … … 795 795 RisedTextOut(Canvas, 56, y0Mini + 61, 796 796 Phrases.Lookup('STARTCONTROLS', 14)); 797 s:= Phrases.Lookup('AUTODIFF', AutoDiff - 1);798 RisedTextOut(Canvas, 272 - BiColorTextWidth(Canvas, s), y0Mini + 61, s);799 800 for i:= 0 to 19 do801 if ( i < 2) or (i> 6) then begin802 BitBltCanvas(Canvas, 9 + i* 27, yLogo - 2, Ornament.Width, Ornament.Height,797 S := Phrases.Lookup('AUTODIFF', AutoDiff - 1); 798 RisedTextOut(Canvas, 272 - BiColorTextWidth(Canvas, S), y0Mini + 61, S); 799 800 for I := 0 to 19 do 801 if (I < 2) or (I > 6) then begin 802 BitBltCanvas(Canvas, 9 + I * 27, yLogo - 2, Ornament.Width, Ornament.Height, 803 803 HGrSystem2.Mask.Canvas, Ornament.Left, Ornament.Top, SRCAND); 804 BitBltCanvas(Canvas, 9 + i* 27, yLogo - 2, Ornament.Width, Ornament.Height,804 BitBltCanvas(Canvas, 9 + I * 27, yLogo - 2, Ornament.Width, Ornament.Height, 805 805 HGrSystem2.Data.Canvas, Ornament.Left, Ornament.Top, SRCPAINT); 806 806 end; … … 825 825 MainTexture.ColorBevelShade); 826 826 RisedTextOut(Canvas, 344, y0Mini + 61, Phrases.Lookup('STARTCONTROLS', 8)); 827 s:= TurnToString(LoadTurn);828 RisedTextOut(Canvas, 514 - BiColorTextWidth(Canvas, s), y0Mini + 61, s);827 S := TurnToString(LoadTurn); 828 RisedTextOut(Canvas, 514 - BiColorTextWidth(Canvas, S), y0Mini + 61, S); 829 829 end 830 830 else if Page = pgEditRandom then … … 840 840 begin 841 841 // DLine(Canvas,344,514,y0Mini+61+19,MainTexture.ColorBevelLight,MainTexture.ColorBevelShade); 842 s:= Format(Phrases2.Lookup('MAPPROP'),842 S := Format(Phrases2.Lookup('MAPPROP'), 843 843 [(nMapLandTiles * 100 + 556) div 1112, 844 844 // 1112 is typical for world with 100% size and default land mass 845 845 nMapStartPositions]); 846 RisedTextOut(Canvas, x0Mini - BiColorTextWidth(Canvas, s) div 2,847 y0Mini + 61, s);846 RisedTextOut(Canvas, x0Mini - BiColorTextWidth(Canvas, S) div 2, 847 y0Mini + 61, S); 848 848 end; 849 849 … … 888 888 MainTexture.ColorBevelLight); 889 889 890 s:= '';890 S := ''; 891 891 if MiniMap.Mode = mmPicture then 892 892 begin … … 894 894 MiniMap.Bitmap.Canvas, 0, 0); 895 895 if Page = pgStartRandom then 896 s:= Phrases.Lookup('RANMAP')896 S := Phrases.Lookup('RANMAP') 897 897 end 898 898 else if MiniMap.Mode = mmMultiPlayer then 899 s:= Phrases.Lookup('MPMAP')899 S := Phrases.Lookup('MPMAP') 900 900 else if Page = pgStartMap then 901 s:= Copy(MapFileName, 1, Length(MapFileName) - Length(CevoMapExt))901 S := Copy(MapFileName, 1, Length(MapFileName) - Length(CevoMapExt)) 902 902 else if Page = pgEditMap then 903 s:= List.Items[List.ItemIndex]903 S := List.Items[List.ItemIndex] 904 904 else if Page = pgNoLoad then 905 s:= Phrases.Lookup('NOGAMES');906 if s<> '' then907 RisedTextOut(Canvas, x0Mini + 2 - BiColorTextWidth(Canvas, s) div 2,908 y0Mini - 8, s);905 S := Phrases.Lookup('NOGAMES'); 906 if S <> '' then 907 RisedTextOut(Canvas, x0Mini + 2 - BiColorTextWidth(Canvas, S) div 2, 908 y0Mini - 8, S); 909 909 end; 910 910 end; … … 959 959 begin // load 960 960 FileName := List.Items[List.ItemIndex]; 961 if LoadGame(GetSavedDir + DirectorySeparator, FileName + CevoExt, LoadTurn, false)961 if LoadGame(GetSavedDir + DirectorySeparator, FileName + CevoExt, LoadTurn, False) 962 962 then 963 963 UnlistBackupFile(FileName) … … 979 979 with Reg do 980 980 try 981 OpenKey(AppRegistryKey, true);981 OpenKey(AppRegistryKey, True); 982 982 if ValueExists('GameCount') then GameCount := ReadInteger('GameCount') 983 983 else GameCount := 0; … … 1168 1168 if Assigned(PlayersBrain[I]) and (PlayersBrain[I].Kind = btTerm) then begin 1169 1169 PlayersBrain[I] := nil; 1170 PlayerSlots[I].DiffUpBtn.Visible := false;1170 PlayerSlots[I].DiffUpBtn.Visible := False; 1171 1171 PlayerSlots[I].DiffUpBtn.Tag := 0; 1172 PlayerSlots[I].DiffDownBtn.Visible := false;1172 PlayerSlots[I].DiffDownBtn.Visible := False; 1173 1173 PlayerSlots[I].DiffDownBtn.Tag := 0; 1174 1174 if PlayerSlots[I].OfferMultiple then begin 1175 PlayerSlots[I].MultiBtn.Visible := false;1175 PlayerSlots[I].MultiBtn.Visible := False; 1176 1176 PlayerSlots[I].MultiBtn.Tag := 0; 1177 1177 end; … … 1199 1199 J := FixedLines; 1200 1200 while (J < PopupMenu1.Items.Count) and 1201 (StrIComp( pchar(MenuItem.Caption), pchar(PopupMenu1.Items[J].Caption)) > 0) do1201 (StrIComp(PChar(MenuItem.Caption), PChar(PopupMenu1.Items[J].Caption)) > 0) do 1202 1202 Inc(J); 1203 1203 MenuItem.RadioItem := True; … … 1210 1210 var 1211 1211 I: Integer; 1212 FixedLines: integer;1212 FixedLines: Integer; 1213 1213 MenuItem: TMenuItem; 1214 1214 AIBrains: TBrains; … … 1244 1244 end; 1245 1245 for I := Brains.IndexOf(BrainTerm) downto 0 do // offer game interfaces 1246 if (PlayerPopupIndex = 0) or (Brains[ i].Kind = btTerm) and1246 if (PlayerPopupIndex = 0) or (Brains[I].Kind = btTerm) and 1247 1247 (PlayersBrain[0].Kind <> btNoTerm) then begin 1248 1248 OfferBrain(Brains[I], FixedLines); … … 1268 1268 if (AIBrains[I].Flags and fMultiple <> 0) or (AIBrains[I].Flags and fUsed = 0) 1269 1269 or (Brains[I] = PlayersBrain[PlayerPopupIndex]) then 1270 OfferBrain(AIBrains[ i], FixedLines);1270 OfferBrain(AIBrains[I], FixedLines); 1271 1271 FreeAndNil(AIBrains); 1272 1272 end; … … 1283 1283 repeat 1284 1284 I := FormerGames.Count; 1285 while (I > 0) and (F.Time < integer(FormerGames.Objects[I - 1])) do1285 while (I > 0) and (F.Time < Integer(FormerGames.Objects[I - 1])) do 1286 1286 Dec(I); 1287 1287 FormerGames.InsertObject(I, Copy(F.Name, 1, Length(F.Name) - 5), … … 1297 1297 procedure TStartDlg.UpdateMaps; 1298 1298 var 1299 f: TSearchRec;1299 F: TSearchRec; 1300 1300 begin 1301 1301 Maps.Clear; 1302 if FindFirst(GetMapsDir + DirectorySeparator + '*' + CevoMapExt, $21, f) = 0 then1302 if FindFirst(GetMapsDir + DirectorySeparator + '*' + CevoMapExt, $21, F) = 0 then 1303 1303 repeat 1304 Maps.Add(Copy( f.Name, 1, Length(f.Name) - Length(CevoMapExt)));1305 until FindNext( f) <> 0;1304 Maps.Add(Copy(F.Name, 1, Length(F.Name) - Length(CevoMapExt))); 1305 until FindNext(F) <> 0; 1306 1306 FindClose(F); 1307 1307 Maps.Sort; … … 1314 1314 procedure TStartDlg.ChangePage(NewPage: TStartPage); 1315 1315 var 1316 i, j, p1: integer;1317 s: string;1316 I, J, p1: Integer; 1317 S: string; 1318 1318 Reg: TRegistry; 1319 InvalidateTab0: boolean;1319 InvalidateTab0: Boolean; 1320 1320 begin 1321 1321 InvalidateTab0 := (Page = pgMain) or (NewPage = pgMain); … … 1326 1326 StartBtn.Caption := Phrases.Lookup('STARTCONTROLS', 1); 1327 1327 if Page = pgStartRandom then 1328 i:= nPlOffered1328 I := nPlOffered 1329 1329 else 1330 1330 begin 1331 i:= nMapStartPositions;1332 if i= 0 then1331 I := nMapStartPositions; 1332 if I = 0 then 1333 1333 begin 1334 1334 PlayersBrain[0] := BrainSuperVirtual; … … 1336 1336 end; 1337 1337 if PlayersBrain[0].Kind in [btNoTerm, btSuperVirtual] then 1338 inc(i);1339 if i> nPl then1340 i:= nPl;1341 if i<= nPlOffered then1338 Inc(I); 1339 if I > nPl then 1340 I := nPl; 1341 if I <= nPlOffered then 1342 1342 MultiControl := 0 1343 1343 else 1344 MultiControl := InitMulti[ i];1344 MultiControl := InitMulti[I]; 1345 1345 end; 1346 if InitAlive[ i] <> SlotAvailable then1346 if InitAlive[I] <> SlotAvailable then 1347 1347 if Page = pgStartRandom then 1348 1348 begin // restore AI assignment of last start … … 1353 1353 for p1 := 0 to nPlOffered - 1 do begin 1354 1354 PlayersBrain[p1] := nil; 1355 s:= ReadString('Control' + IntToStr(p1));1355 S := ReadString('Control' + IntToStr(p1)); 1356 1356 Difficulty[p1] := ReadInteger('Diff' + IntToStr(p1)); 1357 if s<> '' then1358 for j:= 0 to Brains.Count - 1 do1359 if AnsiCompareFileName( s, Brains[j].FileName) = 0 then1360 PlayersBrain[p1] := Brains[ j];1357 if S <> '' then 1358 for J := 0 to Brains.Count - 1 do 1359 if AnsiCompareFileName(S, Brains[J].FileName) = 0 then 1360 PlayersBrain[p1] := Brains[J]; 1361 1361 end; 1362 1362 finally … … 1366 1366 else 1367 1367 for p1 := 1 to nPl - 1 do 1368 if 1 shl p1 and InitAlive[ i] <> 0 then1368 if 1 shl p1 and InitAlive[I] <> 0 then 1369 1369 begin 1370 1370 PlayersBrain[p1] := BrainDefault; … … 1373 1373 else 1374 1374 PlayersBrain[p1] := nil; 1375 SlotAvailable := InitAlive[ i];1376 for i:= 0 to nPlOffered - 1 do1377 if (AutoDiff < 0) and Assigned(PlayersBrain[ i]) and1378 (PlayersBrain[ i].Kind in [btTerm, btRandom, btAI]) then1375 SlotAvailable := InitAlive[I]; 1376 for I := 0 to nPlOffered - 1 do 1377 if (AutoDiff < 0) and Assigned(PlayersBrain[I]) and 1378 (PlayersBrain[I].Kind in [btTerm, btRandom, btAI]) then 1379 1379 begin 1380 PlayerSlots[ i].DiffUpBtn.Tag := 768;1381 PlayerSlots[ i].DiffDownBtn.Tag := 768;1380 PlayerSlots[I].DiffUpBtn.Tag := 768; 1381 PlayerSlots[I].DiffDownBtn.Tag := 768; 1382 1382 end 1383 1383 else 1384 1384 begin 1385 PlayerSlots[ i].DiffUpBtn.Tag := 0;1386 PlayerSlots[ i].DiffDownBtn.Tag := 0;1385 PlayerSlots[I].DiffUpBtn.Tag := 0; 1386 PlayerSlots[I].DiffDownBtn.Tag := 0; 1387 1387 end; 1388 for i:= 6 to 8 do1389 if (AutoDiff < 0) and Assigned(PlayersBrain[ i]) and1390 (PlayersBrain[ i].Kind in [btTerm, btRandom, btAI]) then1388 for I := 6 to 8 do 1389 if (AutoDiff < 0) and Assigned(PlayersBrain[I]) and 1390 (PlayersBrain[I].Kind in [btTerm, btRandom, btAI]) then 1391 1391 begin 1392 PlayerSlots[ i].MultiBtn.Tag := 768;1393 PlayerSlots[ i].MultiBtn.ButtonIndex := 2 + (MultiControl shr i) and 1;1394 PlayerSlots[ i].MultiBtn.Enabled := Page = pgStartRandom1392 PlayerSlots[I].MultiBtn.Tag := 768; 1393 PlayerSlots[I].MultiBtn.ButtonIndex := 2 + (MultiControl shr I) and 1; 1394 PlayerSlots[I].MultiBtn.Enabled := Page = pgStartRandom 1395 1395 end 1396 1396 else 1397 PlayerSlots[ i].MultiBtn.Tag := 0;1397 PlayerSlots[I].MultiBtn.Tag := 0; 1398 1398 if (AutoDiff > 0) and (Page <> pgStartMap) then 1399 1399 begin … … 1434 1434 1435 1435 PaintInfo; 1436 for i:= 0 to ControlCount - 1 do1437 Controls[ i].Visible := Controls[i].Tag and (256 shl Integer(Page)) <> 0;1436 for I := 0 to ControlCount - 1 do 1437 Controls[I].Visible := Controls[I].Tag and (256 shl Integer(Page)) <> 0; 1438 1438 if Page = pgLoad then 1439 1439 ReplayBtn.Visible := MiniMap.Mode <> mmMultiPlayer; … … 1479 1479 1480 1480 procedure TStartDlg.FormMouseDown(Sender: TObject; Button: TMouseButton; 1481 Shift: TShiftState; x, y: integer);1481 Shift: TShiftState; X, Y: Integer); 1482 1482 var 1483 1483 I: Integer; 1484 1484 begin 1485 if ( y < TabHeight + 1) and (x- TabOffset < TabSize * 4) and1486 (( x- TabOffset) div TabSize <> Integer(Tab)) then1485 if (Y < TabHeight + 1) and (X - TabOffset < TabSize * 4) and 1486 ((X - TabOffset) div TabSize <> Integer(Tab)) then 1487 1487 begin 1488 1488 // Play('BUTTON_DOWN'); 1489 1489 ListIndex[Tab] := List.ItemIndex; 1490 ChangeTab(TStartTab(( x- TabOffset) div TabSize));1490 ChangeTab(TStartTab((X - TabOffset) div TabSize)); 1491 1491 end 1492 1492 else if Page = pgMain then begin … … 1503 1503 begin 1504 1504 for I := 0 to nPlOffered - 1 do 1505 if (1 shl I and SlotAvailable <> 0) and ( x>= xBrain[I]) and1506 ( y >= yBrain[I]) and (x < xBrain[I] + 64) and (y< yBrain[I] + 64) then1505 if (1 shl I and SlotAvailable <> 0) and (X >= xBrain[I]) and 1506 (Y >= yBrain[I]) and (X < xBrain[I] + 64) and (Y < yBrain[I] + 64) then 1507 1507 begin 1508 1508 InitPopup(I); … … 1514 1514 end 1515 1515 else if (AutoDiff > 1) and ((Page = pgStartRandom) or (Page = pgStartMap)) and 1516 ( x >= xDefault) and (y >= yDefault) and (x< xDefault + 64) and1517 ( y< yDefault + 64) then1516 (X >= xDefault) and (Y >= yDefault) and (X < xDefault + 64) and 1517 (Y < yDefault + 64) then 1518 1518 if Brains.GetKindCount(btAI) < 2 then 1519 1519 SimpleMessage(Phrases.Lookup('NOALTAI')) … … 1523 1523 PopupMenu1.Popup(left + xDefault + 4, top + yDefault + 4); 1524 1524 end 1525 else if (Page = pgLoad) and (LastTurn > 0) and ( y>= yTurnSlider) and1526 ( y < yTurnSlider + 7) and (x>= xTurnSlider) and1527 ( x<= xTurnSlider + wTurnSlider) then1528 begin 1529 LoadTurn := LastTurn * ( x- xTurnSlider) div wTurnSlider;1525 else if (Page = pgLoad) and (LastTurn > 0) and (Y >= yTurnSlider) and 1526 (Y < yTurnSlider + 7) and (X >= xTurnSlider) and 1527 (X <= xTurnSlider + wTurnSlider) then 1528 begin 1529 LoadTurn := LastTurn * (X - xTurnSlider) div wTurnSlider; 1530 1530 SmartInvalidate(xTurnSlider - 2, y0Mini + 61, xTurnSlider + wTurnSlider + 2, 1531 1531 yTurnSlider + 9); … … 1540 1540 if MaxTurn < 1400 then 1541 1541 begin 1542 inc(MaxTurn, 200);1542 Inc(MaxTurn, 200); 1543 1543 SmartInvalidate(344, y0Mini + 61, 514, y0Mini + 82); 1544 1544 end; … … 1546 1546 if LoadTurn < LastTurn then 1547 1547 begin 1548 inc(LoadTurn);1548 Inc(LoadTurn); 1549 1549 SmartInvalidate(xTurnSlider - 2, y0Mini + 61, xTurnSlider + wTurnSlider 1550 1550 + 2, yTurnSlider + 9); … … 1553 1553 if StartLandMass < 96 then 1554 1554 begin 1555 inc(StartLandMass, 5);1555 Inc(StartLandMass, 5); 1556 1556 PaintInfo; 1557 1557 SmartInvalidate(344, y0Mini + 61, 514, y0Mini + 61 + 21); … … 1566 1566 if MaxTurn > 400 then 1567 1567 begin 1568 dec(MaxTurn, 200);1568 Dec(MaxTurn, 200); 1569 1569 SmartInvalidate(344, y0Mini + 61, 514, y0Mini + 82); 1570 1570 end; … … 1572 1572 if LoadTurn > 0 then 1573 1573 begin 1574 dec(LoadTurn);1574 Dec(LoadTurn); 1575 1575 SmartInvalidate(xTurnSlider - 2, y0Mini + 61, xTurnSlider + wTurnSlider 1576 1576 + 2, yTurnSlider + 9); … … 1579 1579 if StartLandMass > 10 then 1580 1580 begin 1581 dec(StartLandMass, 5);1581 Dec(StartLandMass, 5); 1582 1582 PaintInfo; 1583 1583 SmartInvalidate(344, y0Mini + 61, 514, y0Mini + 61 + 21); … … 1634 1634 procedure TStartDlg.RenameBtnClick(Sender: TObject); 1635 1635 var 1636 i: integer;1636 I: Integer; 1637 1637 NewName: string; 1638 f: file;1639 ok: boolean;1638 F: file; 1639 ok: Boolean; 1640 1640 MapPictureFileName: string; 1641 1641 begin … … 1655 1655 (NewName <> List.Items[List.ItemIndex]) then 1656 1656 begin 1657 for i:= 1 to Length(NewName) do1658 if NewName[ i] in ['\', '/', ':', '*', '?', '"', '<', '>', '|'] then1657 for I := 1 to Length(NewName) do 1658 if NewName[I] in ['\', '/', ':', '*', '?', '"', '<', '>', '|'] then 1659 1659 begin 1660 SimpleMessage(Format(Phrases.Lookup('NOFILENAME'), [NewName[ i]]));1660 SimpleMessage(Format(Phrases.Lookup('NOFILENAME'), [NewName[I]])); 1661 1661 Exit; 1662 1662 end; 1663 1663 if Page = pgLoad then 1664 AssignFile( f, GetSavedDir + DirectorySeparator + List.Items[List.ItemIndex] + CevoExt)1664 AssignFile(F, GetSavedDir + DirectorySeparator + List.Items[List.ItemIndex] + CevoExt) 1665 1665 else 1666 AssignFile( f, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] +1666 AssignFile(F, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] + 1667 1667 CevoMapExt); 1668 ok := true;1668 ok := True; 1669 1669 try 1670 1670 if Page = pgLoad then 1671 Rename( f, GetSavedDir + DirectorySeparator + NewName + CevoExt)1671 Rename(F, GetSavedDir + DirectorySeparator + NewName + CevoExt) 1672 1672 else 1673 Rename( f, GetMapsDir + DirectorySeparator + NewName + CevoMapExt);1673 Rename(F, GetMapsDir + DirectorySeparator + NewName + CevoMapExt); 1674 1674 except 1675 1675 // Play('INVALID'); … … 1682 1682 if FileExists(MapPictureFileName) then 1683 1683 try 1684 AssignFile( f, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex]1684 AssignFile(F, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] 1685 1685 + CevoMapPictureExt); 1686 Rename( f, GetMapsDir + DirectorySeparator + NewName + CevoMapPictureExt);1686 Rename(F, GetMapsDir + DirectorySeparator + NewName + CevoMapPictureExt); 1687 1687 except 1688 1688 end; … … 1704 1704 procedure TStartDlg.DeleteBtnClick(Sender: TObject); 1705 1705 var 1706 iDel: integer;1707 f: file;1706 iDel: Integer; 1707 F: file; 1708 1708 begin 1709 1709 if List.ItemIndex >= 0 then … … 1718 1718 begin 1719 1719 if Page = pgLoad then 1720 AssignFile( f, GetSavedDir + DirectorySeparator + List.Items[List.ItemIndex] + CevoExt)1720 AssignFile(F, GetSavedDir + DirectorySeparator + List.Items[List.ItemIndex] + CevoExt) 1721 1721 else 1722 AssignFile( f, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] +1722 AssignFile(F, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] + 1723 1723 CevoMapExt); 1724 Erase( f);1724 Erase(F); 1725 1725 iDel := List.ItemIndex; 1726 1726 if Page = pgLoad then … … 1743 1743 List.Invalidate; 1744 1744 if Page = pgLoad then 1745 TurnValid := false;1745 TurnValid := False; 1746 1746 PaintInfo; 1747 1747 if Page = pgLoad then … … 1842 1842 1843 1843 procedure TStartDlg.FormMouseUp(Sender: TObject; Button: TMouseButton; 1844 Shift: TShiftState; x, y: integer);1844 Shift: TShiftState; X, Y: Integer); 1845 1845 begin 1846 1846 Tracking := False; … … 1848 1848 1849 1849 procedure TStartDlg.FormMouseMove(Sender: TObject; Shift: TShiftState; 1850 x, y: integer);1850 X, Y: Integer); 1851 1851 var 1852 1852 OldLoadTurn: Integer; … … 1855 1855 if Tracking then 1856 1856 begin 1857 x := x- xTurnSlider;1858 if x< 0 then1859 x:= 01860 else if x> wTurnSlider then1861 x:= wTurnSlider;1857 X := X - xTurnSlider; 1858 if X < 0 then 1859 X := 0 1860 else if X > wTurnSlider then 1861 X := wTurnSlider; 1862 1862 OldLoadTurn := LoadTurn; 1863 LoadTurn := LastTurn * xdiv wTurnSlider;1863 LoadTurn := LastTurn * X div wTurnSlider; 1864 1864 if LoadTurn < OldLoadTurn then 1865 1865 begin … … 1879 1879 else if Page = pgMain then 1880 1880 begin 1881 if ( x >= ActionSideBorder) and (x< ClientWidth - ActionSideBorder) and1882 ( y >= yAction - 8) and (y< ClientHeight - ActionBottomBorder) then1881 if (X >= ActionSideBorder) and (X < ClientWidth - ActionSideBorder) and 1882 (Y >= yAction - 8) and (Y < ClientHeight - ActionBottomBorder) then 1883 1883 begin 1884 NewSelectedAction := TMainAction(( y- (yAction - 8)) div ActionPitch);1884 NewSelectedAction := TMainAction((Y - (yAction - 8)) div ActionPitch); 1885 1885 if not (NewSelectedAction in ActionsOffered) then 1886 1886 NewSelectedAction := maNone;
Note:
See TracChangeset
for help on using the changeset viewer.