Changeset 447 for trunk/Start.pas


Ignore:
Timestamp:
May 19, 2022, 10:39:34 PM (2 years ago)
Author:
chronos
Message:
  • Modified: Use first capital letter in identifiers.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Start.pas

    r442 r447  
    6969    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    7070    procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
    71       Shift: TShiftState; x, y: integer);
     71      Shift: TShiftState; X, Y: Integer);
    7272    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);
    7575    procedure Up1BtnClick(Sender: TObject);
    7676    procedure Down1BtnClick(Sender: TObject);
     
    122122    MiniMap: TMiniMap;
    123123    LastGame: string;
    124     procedure DrawAction(y, IconIndex: integer; HeaderItem, TextItem: string);
     124    procedure DrawAction(Y, IconIndex: Integer; HeaderItem, TextItem: string);
    125125    procedure InitPopup(PlayerIndex: Integer);
    126126    procedure OfferBrain(Brain: TBrain; FixedLines: Integer);
     
    129129    procedure ChangeTab(NewTab: TStartTab);
    130130    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;
    133133    procedure LoadConfig;
    134134    procedure SaveConfig;
     
    160160  // attention: lx*ly+1 must be prime!
    161161  { 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);
    164164    DefaultWorldTiles=4200; }
    165165  MaxWorldSize = 6;
     
    192192  dxBrain = 104;
    193193  dyBrain = 80;
    194   xBrain: array [0 .. nPlOffered - 1] of integer = (x0Brain, x0Brain,
     194  xBrain: array [0 .. nPlOffered - 1] of Integer = (x0Brain, x0Brain,
    195195    x0Brain + dxBrain, x0Brain + dxBrain, x0Brain + dxBrain, x0Brain,
    196196    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,
    198198    y0Brain - dyBrain, y0Brain, y0Brain + dyBrain, y0Brain + dyBrain,
    199199    y0Brain + dyBrain, y0Brain, y0Brain - dyBrain);
     
    202202  TabHeight = 40;
    203203
    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,
    205205    1 + 2 + 8 + 128, 1 + 2 + 8 + 32 + 128, 1 + 2 + 8 + 16 + 64 + 128,
    206206    1 + 2 + 4 + 16 + 32 + 64 + 256, 511 - 32, 511, 511 - 32, 511, 511 - 32, 511,
    207207    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,
    209209    256 + 128, 256 + 128 + 64, 256 + 128 + 64);
    210210
    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);
    213213
    214214{ TStartDlg }
     
    216216procedure TStartDlg.FormCreate(Sender: TObject);
    217217var
    218   x, i: Integer;
     218  X, I: Integer;
    219219  PlayerSlot: TPlayerSlot;
    220220  AIBrains: TBrains;
     
    236236
    237237  BrainDefault := nil;
    238   for i := Brains.IndexOf(BrainRandom) to Brains.Count - 1 do
    239     if AnsiCompareFileName(DefaultAI, Brains[i].FileName) = 0 then
    240       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];
    241241  if (BrainDefault = BrainRandom) and (Brains.GetKindCount(btAI) < 2) then
    242242    BrainDefault := nil;
     
    260260  ReplayBtn.Hint := Phrases.Lookup('BTN_REPLAY');
    261261  PlayerSlots.Count := nPlOffered;
    262   for i := 0 to PlayerSlots.Count - 1 do
    263   with PlayerSlots[i] do begin
     262  for I := 0 to PlayerSlots.Count - 1 do
     263  with PlayerSlots[I] do begin
    264264    DiffUpBtn := TButtonC.Create(self);
    265265    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;
    268268    DiffUpBtn.ButtonIndex := 1;
    269269    DiffUpBtn.Parent := self;
     
    271271    DiffDownBtn := TButtonC.Create(self);
    272272    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;
    275275    DiffDownBtn.ButtonIndex := 0;
    276276    DiffDownBtn.Parent := self;
    277277    DiffDownBtn.OnClick := DiffBtnClick;
    278278  end;
    279   for i := 6 to 8 do
    280   with PlayerSlots[i] do begin
     279  for I := 6 to 8 do
     280  with PlayerSlots[I] do begin
    281281    MultiBtn := TButtonC.Create(self);
    282282    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];
    285285    MultiBtn.Parent := self;
    286286    MultiBtn.OnClick := MultiBtnClick;
     
    288288  end;
    289289
    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;
    292292  if AutoDiff < 0 then
    293293    CustomizeBtn.ButtonIndex := 3
     
    339339end;
    340340
    341 procedure TStartDlg.SmartInvalidate(x0, y0, x1, y1: integer;
    342   invalidateTab0: boolean);
    343 var
    344   i: integer;
     341procedure TStartDlg.SmartInvalidate(x0, y0, x1, y1: Integer;
     342  invalidateTab0: Boolean);
     343var
     344  I: Integer;
    345345  r0, r1: HRgn;
    346346begin
    347347  r0 := CreateRectRgn(x0, y0, x1, y1);
    348   for i := 0 to ControlCount - 1 do
    349     if not (Controls[i] is TArea) and Controls[i].Visible then
     348  for I := 0 to ControlCount - 1 do
     349    if not (Controls[I] is TArea) and Controls[I].Visible then
    350350    begin
    351       with Controls[i].BoundsRect do
     351      with Controls[I].BoundsRect do
    352352        r1 := CreateRectRgn(left, top, Right, Bottom);
    353353      CombineRgn(r0, r0, r1, RGN_DIFF);
     
    359359    DeleteObject(r1);
    360360  end;
    361   InvalidateRgn(Handle, r0, false);
     361  InvalidateRgn(Handle, r0, False);
    362362  DeleteObject(r0);
    363363end;
     
    530530end;
    531531
    532 procedure TStartDlg.DrawAction(y, IconIndex: integer; HeaderItem, TextItem: string);
     532procedure TStartDlg.DrawAction(Y, IconIndex: Integer; HeaderItem, TextItem: string);
    533533begin
    534534  Canvas.Font.Assign(UniFont[ftCaption]);
    535535  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));
    537537  Canvas.Font.Assign(UniFont[ftNormal]);
    538538  BiColorTextOut(Canvas, Colors.Canvas.Pixels[clkAge0 - 1, cliDimmedText],
    539     $000000, xAction, y + 21, Phrases2.Lookup(TextItem));
     539    $000000, xAction, Y + 21, Phrases2.Lookup(TextItem));
    540540
    541541  UnshareBitmap(LogoBuffer);
    542542  BitBltCanvas(LogoBuffer.Canvas, 0, 0, 50, 50, Canvas,
    543     xActionIcon - 2, y - 2);
     543    xActionIcon - 2, Y - 2);
    544544  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,
    546546    LogoBuffer.Canvas, 0, 0);
    547   BitBltCanvas(Canvas, xActionIcon, y, 40, 40, BigImp.Canvas,
     547  BitBltCanvas(Canvas, xActionIcon, Y, 40, 40, BigImp.Canvas,
    548548    (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,
    550550    $000000, $000000);
    551551end;
     
    555555  TabNames: array[TStartTab] of Integer = (0, 11, 3, 4);
    556556var
    557   i, w, h, xMini, yMini, y: integer;
    558   s: string;
     557  I, W, H, xMini, yMini, Y: Integer;
     558  S: string;
    559559  Tab2: TStartTab;
    560560  MainAction: TMainAction;
     
    588588
    589589  // 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,
    591591    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,
    593593    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;
    595595  for Tab2 := tbMap to tbPrevious do
    596596  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),
    598598      TabOffset + (Integer(Tab2) + 1) * TabSize - 1, TabHeight, MainTexture.ColorBevelLight,
    599599      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),
    601601      TabOffset + (Integer(Tab2) + 1) * TabSize, TabHeight, MainTexture.ColorBevelLight,
    602602      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)] :=
    604604      MainTexture.ColorBevelShade;
    605605  end;
     
    607607  for Tab2 := tbMap to tbPrevious do
    608608  begin
    609     s := Phrases.Lookup('STARTCONTROLS', TabNames[Tab2]);
     609    S := Phrases.Lookup('STARTCONTROLS', TabNames[Tab2]);
    610610    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);
    613613  end;
    614614  Frame(Canvas, TabOffset + 4 * TabSize + 1, -1, ClientWidth, TabHeight,
     
    640640  UnshareBitmap(LogoBuffer);
    641641  BitBltCanvas(LogoBuffer.Canvas, 0, 0, MenuLogo.Width, MenuLogo.Height, Canvas, 6,
    642     3 + 2 * integer(Tab <> tbMain));
     642    3 + 2 * Integer(Tab <> tbMain));
    643643
    644644  ImageOp_BCC(LogoBuffer, Templates.Data, 0, 0, MenuLogo.Left, MenuLogo.Top,
     
    646646  ImageOp_BCC(LogoBuffer, Templates.Data, 10, 27, MenuLogo.Left + 10,
    647647    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,
    649649    LogoBuffer.Canvas, 0, 0);
    650650
    651651  if Page = pgMain then begin
    652652    if SelectedAction <> maNone then // mark selected action
    653       for i := 0 to (ClientWidth - 2 * ActionSideBorder) div wBuffer + 1 do
     653      for I := 0 to (ClientWidth - 2 * ActionSideBorder) div wBuffer + 1 do
    654654      begin
    655         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
     655        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
    660660        then
    661           h := ClientHeight - ActionBottomBorder -
     661          H := ClientHeight - ActionBottomBorder -
    662662            (yAction + Integer(SelectedAction) * ActionPitch - 8);
    663663
    664664        UnshareBitmap(LogoBuffer);
    665         BitBltCanvas(LogoBuffer.Canvas, 0, 0, w, h, Canvas,
    666           ActionSideBorder + i * wBuffer, yAction + Integer(SelectedAction) * ActionPitch
     665        BitBltCanvas(LogoBuffer.Canvas, 0, 0, W, H, Canvas,
     666          ActionSideBorder + I * wBuffer, yAction + Integer(SelectedAction) * ActionPitch
    667667          - 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,
    671671          LogoBuffer.Canvas, 0, 0);
    672672      end;
    673     y := yAction;
     673    Y := yAction;
    674674    for MainAction := Low(TMainActionSet) to High(TMainActionSet) do
    675675    begin
    676676      if MainAction in ActionsOffered then
    677677        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');
    682682          maWeb:
    683683            begin
    684684              Canvas.Font.Assign(UniFont[ftCaption]);
    685685              // Canvas.Font.Style:=Canvas.Font.Style+[fsUnderline];
    686               RisedTextOut(Canvas, xActionIcon + 99, y,
     686              RisedTextOut(Canvas, xActionIcon + 99, Y,
    687687                Format(Phrases2.Lookup('ACTIONHEADER_WEB'), [CevoHomepageShort]));
    688688              Canvas.Font.Assign(UniFont[ftNormal]);
     
    690690              UnshareBitmap(LogoBuffer);
    691691              BitBltCanvas(LogoBuffer.Canvas, 0, 0, LinkArrows.Width, LinkArrows.Height, Canvas,
    692                 xActionIcon, y + 2);
     692                xActionIcon, Y + 2);
    693693              ImageOp_BCC(LogoBuffer, Templates.Data, Point(0, 0), LinkArrows.BoundsRect, 0,
    694694                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,
    696696                LogoBuffer.Canvas, 0, 0);
    697697            end;
    698698        end;
    699       Inc(y, ActionPitch);
     699      Inc(Y, ActionPitch);
    700700    end;
    701701  end
     
    705705      TurnToString(MaxTurn), 344, y0Mini + 61, 170);
    706706
    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);
     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);
    711711
    712712    InitOrnament;
    713713    if AutoDiff < 0 then
    714714    begin
    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,
     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,
    718718            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,
    720720            HGrSystem2.Data.Canvas, Ornament.Left, Ornament.Top, SRCPAINT);
    721721        end;
     
    723723        MainTexture.ColorBevelShade);
    724724
    725       for i := 0 to nPlOffered - 1 do
    726         if 1 shl i and SlotAvailable <> 0 then
     725      for I := 0 to nPlOffered - 1 do
     726        if 1 shl I and SlotAvailable <> 0 then
    727727        begin
    728           if Assigned(PlayersBrain[i]) then
    729             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)
    731731          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]) then
     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]) then
    735735          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) *
    738738              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,
    743743              MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    744744            with Canvas do
    745745            begin
    746746              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));
    749749              Brush.Style := bsClear;
    750750            end;
     
    754754                PlayerSlots[I].MultiBtn.left + 12, PlayerSlots[I].MultiBtn.top + 12,
    755755                MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    756               BitBltCanvas(Canvas, xBrain[i] - 31, yBrain[i], 13, 12,
     756              BitBltCanvas(Canvas, xBrain[I] - 31, yBrain[I], 13, 12,
    757757                HGrSystem.Data.Canvas, 88, 47);
    758758            end;
    759759          end;
    760           if Assigned(PlayersBrain[i]) then
     760          if Assigned(PlayersBrain[I]) then
    761761          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;
    765765          end;
    766766        end;
     
    773773        yMain + 140 { y0Mini-77 } , Phrases.Lookup('STARTCONTROLS', 15));
    774774      if Page = pgStartRandom then
    775         s := IntToStr(AutoEnemies)
     775        S := IntToStr(AutoEnemies)
    776776      else if nMapStartPositions = 0 then
    777         s := '0'
     777        S := '0'
    778778      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);
    781781
    782782      DLine(Canvas, 24, xDefault - 6, yMain + 164 + 19,
     
    786786      if AutoDiff = 1 then
    787787        FrameImage(Canvas, Brains.GetBeginner.Picture, xDefault, yDefault, 64,
    788           64, 0, 0, false)
     788          64, 0, 0, False)
    789789      else
    790790        FrameImage(Canvas, BrainDefault.Picture, xDefault, yDefault, 64, 64,
    791           0, 0, true);
     791          0, 0, True);
    792792      DLine(Canvas, 56, 272, y0Mini + 61 + 19, MainTexture.ColorBevelLight,
    793793        MainTexture.ColorBevelShade);
     
    795795      RisedTextOut(Canvas, 56, y0Mini + 61,
    796796        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 do
    801         if (i < 2) or (i > 6) then begin
    802           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,
    803803            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,
    805805            HGrSystem2.Data.Canvas, Ornament.Left, Ornament.Top, SRCPAINT);
    806806        end;
     
    825825        MainTexture.ColorBevelShade);
    826826    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);
    829829  end
    830830  else if Page = pgEditRandom then
     
    840840  begin
    841841    // DLine(Canvas,344,514,y0Mini+61+19,MainTexture.ColorBevelLight,MainTexture.ColorBevelShade);
    842     s := Format(Phrases2.Lookup('MAPPROP'),
     842    S := Format(Phrases2.Lookup('MAPPROP'),
    843843      [(nMapLandTiles * 100 + 556) div 1112,
    844844      // 1112 is typical for world with 100% size and default land mass
    845845      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);
    848848  end;
    849849
     
    888888      MainTexture.ColorBevelLight);
    889889
    890     s := '';
     890    S := '';
    891891    if MiniMap.Mode = mmPicture then
    892892    begin
     
    894894        MiniMap.Bitmap.Canvas, 0, 0);
    895895      if Page = pgStartRandom then
    896         s := Phrases.Lookup('RANMAP')
     896        S := Phrases.Lookup('RANMAP')
    897897    end
    898898    else if MiniMap.Mode = mmMultiPlayer then
    899       s := Phrases.Lookup('MPMAP')
     899      S := Phrases.Lookup('MPMAP')
    900900    else if Page = pgStartMap then
    901       s := Copy(MapFileName, 1, Length(MapFileName) - Length(CevoMapExt))
     901      S := Copy(MapFileName, 1, Length(MapFileName) - Length(CevoMapExt))
    902902    else if Page = pgEditMap then
    903       s := List.Items[List.ItemIndex]
     903      S := List.Items[List.ItemIndex]
    904904    else if Page = pgNoLoad then
    905       s := Phrases.Lookup('NOGAMES');
    906     if s <> '' then
    907       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);
    909909  end;
    910910end;
     
    959959      begin // load
    960960        FileName := List.Items[List.ItemIndex];
    961         if LoadGame(GetSavedDir + DirectorySeparator, FileName + CevoExt, LoadTurn, false)
     961        if LoadGame(GetSavedDir + DirectorySeparator, FileName + CevoExt, LoadTurn, False)
    962962        then
    963963          UnlistBackupFile(FileName)
     
    979979        with Reg do
    980980        try
    981           OpenKey(AppRegistryKey, true);
     981          OpenKey(AppRegistryKey, True);
    982982          if ValueExists('GameCount') then GameCount := ReadInteger('GameCount')
    983983            else GameCount := 0;
     
    11681168          if Assigned(PlayersBrain[I]) and (PlayersBrain[I].Kind = btTerm) then begin
    11691169            PlayersBrain[I] := nil;
    1170             PlayerSlots[I].DiffUpBtn.Visible := false;
     1170            PlayerSlots[I].DiffUpBtn.Visible := False;
    11711171            PlayerSlots[I].DiffUpBtn.Tag := 0;
    1172             PlayerSlots[I].DiffDownBtn.Visible := false;
     1172            PlayerSlots[I].DiffDownBtn.Visible := False;
    11731173            PlayerSlots[I].DiffDownBtn.Tag := 0;
    11741174            if PlayerSlots[I].OfferMultiple then begin
    1175               PlayerSlots[I].MultiBtn.Visible := false;
     1175              PlayerSlots[I].MultiBtn.Visible := False;
    11761176              PlayerSlots[I].MultiBtn.Tag := 0;
    11771177            end;
     
    11991199  J := FixedLines;
    12001200  while (J < PopupMenu1.Items.Count) and
    1201     (StrIComp(pchar(MenuItem.Caption), pchar(PopupMenu1.Items[J].Caption)) > 0) do
     1201    (StrIComp(PChar(MenuItem.Caption), PChar(PopupMenu1.Items[J].Caption)) > 0) do
    12021202    Inc(J);
    12031203  MenuItem.RadioItem := True;
     
    12101210var
    12111211  I: Integer;
    1212   FixedLines: integer;
     1212  FixedLines: Integer;
    12131213  MenuItem: TMenuItem;
    12141214  AIBrains: TBrains;
     
    12441244    end;
    12451245    for I := Brains.IndexOf(BrainTerm) downto 0 do // offer game interfaces
    1246       if (PlayerPopupIndex = 0) or (Brains[i].Kind = btTerm) and
     1246      if (PlayerPopupIndex = 0) or (Brains[I].Kind = btTerm) and
    12471247        (PlayersBrain[0].Kind <> btNoTerm) then begin
    12481248        OfferBrain(Brains[I], FixedLines);
     
    12681268        if (AIBrains[I].Flags and fMultiple <> 0) or (AIBrains[I].Flags and fUsed = 0)
    12691269          or (Brains[I] = PlayersBrain[PlayerPopupIndex]) then
    1270           OfferBrain(AIBrains[i], FixedLines);
     1270          OfferBrain(AIBrains[I], FixedLines);
    12711271      FreeAndNil(AIBrains);
    12721272    end;
     
    12831283    repeat
    12841284      I := FormerGames.Count;
    1285       while (I > 0) and (F.Time < integer(FormerGames.Objects[I - 1])) do
     1285      while (I > 0) and (F.Time < Integer(FormerGames.Objects[I - 1])) do
    12861286        Dec(I);
    12871287      FormerGames.InsertObject(I, Copy(F.Name, 1, Length(F.Name) - 5),
     
    12971297procedure TStartDlg.UpdateMaps;
    12981298var
    1299   f: TSearchRec;
     1299  F: TSearchRec;
    13001300begin
    13011301  Maps.Clear;
    1302   if FindFirst(GetMapsDir + DirectorySeparator + '*' + CevoMapExt, $21, f) = 0 then
     1302  if FindFirst(GetMapsDir + DirectorySeparator + '*' + CevoMapExt, $21, F) = 0 then
    13031303    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;
    13061306  FindClose(F);
    13071307  Maps.Sort;
     
    13141314procedure TStartDlg.ChangePage(NewPage: TStartPage);
    13151315var
    1316   i, j, p1: integer;
    1317   s: string;
     1316  I, J, p1: Integer;
     1317  S: string;
    13181318  Reg: TRegistry;
    1319   InvalidateTab0: boolean;
     1319  InvalidateTab0: Boolean;
    13201320begin
    13211321  InvalidateTab0 := (Page = pgMain) or (NewPage = pgMain);
     
    13261326        StartBtn.Caption := Phrases.Lookup('STARTCONTROLS', 1);
    13271327        if Page = pgStartRandom then
    1328           i := nPlOffered
     1328          I := nPlOffered
    13291329        else
    13301330        begin
    1331           i := nMapStartPositions;
    1332           if i = 0 then
     1331          I := nMapStartPositions;
     1332          if I = 0 then
    13331333          begin
    13341334            PlayersBrain[0] := BrainSuperVirtual;
     
    13361336          end;
    13371337          if PlayersBrain[0].Kind in [btNoTerm, btSuperVirtual] then
    1338             inc(i);
    1339           if i > nPl then
    1340             i := nPl;
    1341           if i <= nPlOffered then
     1338            Inc(I);
     1339          if I > nPl then
     1340            I := nPl;
     1341          if I <= nPlOffered then
    13421342            MultiControl := 0
    13431343          else
    1344             MultiControl := InitMulti[i];
     1344            MultiControl := InitMulti[I];
    13451345        end;
    1346         if InitAlive[i] <> SlotAvailable then
     1346        if InitAlive[I] <> SlotAvailable then
    13471347          if Page = pgStartRandom then
    13481348          begin // restore AI assignment of last start
     
    13531353              for p1 := 0 to nPlOffered - 1 do begin
    13541354                PlayersBrain[p1] := nil;
    1355                 s := ReadString('Control' + IntToStr(p1));
     1355                S := ReadString('Control' + IntToStr(p1));
    13561356                Difficulty[p1] := ReadInteger('Diff' + IntToStr(p1));
    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];
     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];
    13611361              end;
    13621362            finally
     
    13661366          else
    13671367            for p1 := 1 to nPl - 1 do
    1368               if 1 shl p1 and InitAlive[i] <> 0 then
     1368              if 1 shl p1 and InitAlive[I] <> 0 then
    13691369              begin
    13701370                PlayersBrain[p1] := BrainDefault;
     
    13731373              else
    13741374                PlayersBrain[p1] := nil;
    1375         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
     1375        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
    13791379          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;
    13821382          end
    13831383          else
    13841384          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;
    13871387          end;
    1388         for i := 6 to 8 do
    1389           if (AutoDiff < 0) and Assigned(PlayersBrain[i]) and
    1390             (PlayersBrain[i].Kind in [btTerm, btRandom, btAI]) then
     1388        for I := 6 to 8 do
     1389          if (AutoDiff < 0) and Assigned(PlayersBrain[I]) and
     1390            (PlayersBrain[I].Kind in [btTerm, btRandom, btAI]) then
    13911391          begin
    1392             PlayerSlots[i].MultiBtn.Tag := 768;
    1393             PlayerSlots[i].MultiBtn.ButtonIndex := 2 + (MultiControl shr i) and 1;
    1394             PlayerSlots[i].MultiBtn.Enabled := Page = pgStartRandom
     1392            PlayerSlots[I].MultiBtn.Tag := 768;
     1393            PlayerSlots[I].MultiBtn.ButtonIndex := 2 + (MultiControl shr I) and 1;
     1394            PlayerSlots[I].MultiBtn.Enabled := Page = pgStartRandom
    13951395          end
    13961396          else
    1397             PlayerSlots[i].MultiBtn.Tag := 0;
     1397            PlayerSlots[I].MultiBtn.Tag := 0;
    13981398        if (AutoDiff > 0) and (Page <> pgStartMap) then
    13991399        begin
     
    14341434
    14351435  PaintInfo;
    1436   for i := 0 to ControlCount - 1 do
    1437     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;
    14381438  if Page = pgLoad then
    14391439    ReplayBtn.Visible := MiniMap.Mode <> mmMultiPlayer;
     
    14791479
    14801480procedure TStartDlg.FormMouseDown(Sender: TObject; Button: TMouseButton;
    1481   Shift: TShiftState; x, y: integer);
     1481  Shift: TShiftState; X, Y: Integer);
    14821482var
    14831483  I: Integer;
    14841484begin
    1485   if (y < TabHeight + 1) and (x - TabOffset < TabSize * 4) and
    1486     ((x - TabOffset) div TabSize <> Integer(Tab)) then
     1485  if (Y < TabHeight + 1) and (X - TabOffset < TabSize * 4) and
     1486    ((X - TabOffset) div TabSize <> Integer(Tab)) then
    14871487  begin
    14881488    // Play('BUTTON_DOWN');
    14891489    ListIndex[Tab] := List.ItemIndex;
    1490     ChangeTab(TStartTab((x - TabOffset) div TabSize));
     1490    ChangeTab(TStartTab((X - TabOffset) div TabSize));
    14911491  end
    14921492  else if Page = pgMain then begin
     
    15031503  begin
    15041504    for I := 0 to nPlOffered - 1 do
    1505       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
     1505      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
    15071507      begin
    15081508        InitPopup(I);
     
    15141514  end
    15151515  else if (AutoDiff > 1) and ((Page = pgStartRandom) or (Page = pgStartMap)) and
    1516     (x >= xDefault) and (y >= yDefault) and (x < xDefault + 64) and
    1517     (y < yDefault + 64) then
     1516    (X >= xDefault) and (Y >= yDefault) and (X < xDefault + 64) and
     1517    (Y < yDefault + 64) then
    15181518    if Brains.GetKindCount(btAI) < 2 then
    15191519      SimpleMessage(Phrases.Lookup('NOALTAI'))
     
    15231523      PopupMenu1.Popup(left + xDefault + 4, top + yDefault + 4);
    15241524    end
    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;
     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;
    15301530    SmartInvalidate(xTurnSlider - 2, y0Mini + 61, xTurnSlider + wTurnSlider + 2,
    15311531      yTurnSlider + 9);
     
    15401540      if MaxTurn < 1400 then
    15411541      begin
    1542         inc(MaxTurn, 200);
     1542        Inc(MaxTurn, 200);
    15431543        SmartInvalidate(344, y0Mini + 61, 514, y0Mini + 82);
    15441544      end;
     
    15461546      if LoadTurn < LastTurn then
    15471547      begin
    1548         inc(LoadTurn);
     1548        Inc(LoadTurn);
    15491549        SmartInvalidate(xTurnSlider - 2, y0Mini + 61, xTurnSlider + wTurnSlider
    15501550          + 2, yTurnSlider + 9);
     
    15531553      if StartLandMass < 96 then
    15541554      begin
    1555         inc(StartLandMass, 5);
     1555        Inc(StartLandMass, 5);
    15561556        PaintInfo;
    15571557        SmartInvalidate(344, y0Mini + 61, 514, y0Mini + 61 + 21);
     
    15661566      if MaxTurn > 400 then
    15671567      begin
    1568         dec(MaxTurn, 200);
     1568        Dec(MaxTurn, 200);
    15691569        SmartInvalidate(344, y0Mini + 61, 514, y0Mini + 82);
    15701570      end;
     
    15721572      if LoadTurn > 0 then
    15731573      begin
    1574         dec(LoadTurn);
     1574        Dec(LoadTurn);
    15751575        SmartInvalidate(xTurnSlider - 2, y0Mini + 61, xTurnSlider + wTurnSlider
    15761576          + 2, yTurnSlider + 9);
     
    15791579      if StartLandMass > 10 then
    15801580      begin
    1581         dec(StartLandMass, 5);
     1581        Dec(StartLandMass, 5);
    15821582        PaintInfo;
    15831583        SmartInvalidate(344, y0Mini + 61, 514, y0Mini + 61 + 21);
     
    16341634procedure TStartDlg.RenameBtnClick(Sender: TObject);
    16351635var
    1636   i: integer;
     1636  I: Integer;
    16371637  NewName: string;
    1638   f: file;
    1639   ok: boolean;
     1638  F: file;
     1639  ok: Boolean;
    16401640  MapPictureFileName: string;
    16411641begin
     
    16551655      (NewName <> List.Items[List.ItemIndex]) then
    16561656    begin
    1657       for i := 1 to Length(NewName) do
    1658         if NewName[i] in ['\', '/', ':', '*', '?', '"', '<', '>', '|'] then
     1657      for I := 1 to Length(NewName) do
     1658        if NewName[I] in ['\', '/', ':', '*', '?', '"', '<', '>', '|'] then
    16591659        begin
    1660           SimpleMessage(Format(Phrases.Lookup('NOFILENAME'), [NewName[i]]));
     1660          SimpleMessage(Format(Phrases.Lookup('NOFILENAME'), [NewName[I]]));
    16611661          Exit;
    16621662        end;
    16631663      if Page = pgLoad then
    1664         AssignFile(f, GetSavedDir + DirectorySeparator + List.Items[List.ItemIndex] + CevoExt)
     1664        AssignFile(F, GetSavedDir + DirectorySeparator + List.Items[List.ItemIndex] + CevoExt)
    16651665      else
    1666         AssignFile(f, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] +
     1666        AssignFile(F, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] +
    16671667          CevoMapExt);
    1668       ok := true;
     1668      ok := True;
    16691669      try
    16701670        if Page = pgLoad then
    1671           Rename(f, GetSavedDir + DirectorySeparator + NewName + CevoExt)
     1671          Rename(F, GetSavedDir + DirectorySeparator + NewName + CevoExt)
    16721672        else
    1673           Rename(f, GetMapsDir + DirectorySeparator + NewName + CevoMapExt);
     1673          Rename(F, GetMapsDir + DirectorySeparator + NewName + CevoMapExt);
    16741674      except
    16751675        // Play('INVALID');
     
    16821682        if FileExists(MapPictureFileName) then
    16831683        try
    1684           AssignFile(f, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex]
     1684          AssignFile(F, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex]
    16851685            + CevoMapPictureExt);
    1686           Rename(f, GetMapsDir + DirectorySeparator + NewName + CevoMapPictureExt);
     1686          Rename(F, GetMapsDir + DirectorySeparator + NewName + CevoMapPictureExt);
    16871687        except
    16881688        end;
     
    17041704procedure TStartDlg.DeleteBtnClick(Sender: TObject);
    17051705var
    1706   iDel: integer;
    1707   f: file;
     1706  iDel: Integer;
     1707  F: file;
    17081708begin
    17091709  if List.ItemIndex >= 0 then
     
    17181718    begin
    17191719      if Page = pgLoad then
    1720         AssignFile(f, GetSavedDir + DirectorySeparator + List.Items[List.ItemIndex] + CevoExt)
     1720        AssignFile(F, GetSavedDir + DirectorySeparator + List.Items[List.ItemIndex] + CevoExt)
    17211721      else
    1722         AssignFile(f, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] +
     1722        AssignFile(F, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] +
    17231723          CevoMapExt);
    1724       Erase(f);
     1724      Erase(F);
    17251725      iDel := List.ItemIndex;
    17261726      if Page = pgLoad then
     
    17431743          List.Invalidate;
    17441744          if Page = pgLoad then
    1745             TurnValid := false;
     1745            TurnValid := False;
    17461746          PaintInfo;
    17471747          if Page = pgLoad then
     
    18421842
    18431843procedure TStartDlg.FormMouseUp(Sender: TObject; Button: TMouseButton;
    1844   Shift: TShiftState; x, y: integer);
     1844  Shift: TShiftState; X, Y: Integer);
    18451845begin
    18461846  Tracking := False;
     
    18481848
    18491849procedure TStartDlg.FormMouseMove(Sender: TObject; Shift: TShiftState;
    1850   x, y: integer);
     1850  X, Y: Integer);
    18511851var
    18521852  OldLoadTurn: Integer;
     
    18551855  if Tracking then
    18561856  begin
    1857     x := x - xTurnSlider;
    1858     if x < 0 then
    1859       x := 0
    1860     else if x > wTurnSlider then
    1861       x := wTurnSlider;
     1857    X := X - xTurnSlider;
     1858    if X < 0 then
     1859      X := 0
     1860    else if X > wTurnSlider then
     1861      X := wTurnSlider;
    18621862    OldLoadTurn := LoadTurn;
    1863     LoadTurn := LastTurn * x div wTurnSlider;
     1863    LoadTurn := LastTurn * X div wTurnSlider;
    18641864    if LoadTurn < OldLoadTurn then
    18651865    begin
     
    18791879  else if Page = pgMain then
    18801880  begin
    1881     if (x >= ActionSideBorder) and (x < ClientWidth - ActionSideBorder) and
    1882       (y >= yAction - 8) and (y < ClientHeight - ActionBottomBorder) then
     1881    if (X >= ActionSideBorder) and (X < ClientWidth - ActionSideBorder) and
     1882      (Y >= yAction - 8) and (Y < ClientHeight - ActionBottomBorder) then
    18831883    begin
    1884       NewSelectedAction := TMainAction((y - (yAction - 8)) div ActionPitch);
     1884      NewSelectedAction := TMainAction((Y - (yAction - 8)) div ActionPitch);
    18851885      if not (NewSelectedAction in ActionsOffered) then
    18861886        NewSelectedAction := maNone;
Note: See TracChangeset for help on using the changeset viewer.