Changeset 531 for trunk/LocalPlayer


Ignore:
Timestamp:
Mar 27, 2024, 12:31:14 PM (9 months ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
Location:
trunk/LocalPlayer
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/CityType.pas

    r530 r531  
    2323    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    2424    procedure DeleteBtnClick(Sender: TObject);
    25   public
    26     procedure ShowNewContent(NewMode: TWindowMode);
    2725  protected
    2826    procedure OffscreenPaint; override;
     
    3028    nPool, dragiix, ctype: Integer;
    3129    Pooliix: array [0 .. nImp - 1] of Integer;
    32     listed: Set of 0 .. nImp;
     30    Listed: set of 0 .. nImp;
    3331    Changed: Boolean;
    3432    procedure LoadType(NewType: Integer);
    3533    procedure SaveType;
     34  public
     35    procedure ShowNewContent(NewMode: TWindowMode);
    3636  end;
    3737
     
    158158  nPool := 0;
    159159  for iix := nWonder to nImp - 1 do
    160     if not(iix in listed) and (Imp[iix].Kind = ikCommon) and (iix <> imTrGoods)
     160    if not(iix in Listed) and (Imp[iix].Kind = ikCommon) and (iix <> imTrGoods)
    161161      and (Imp[iix].Preq <> preNA) and
    162162      ((Imp[iix].Preq = preNone) or (MyRO.Tech[Imp[iix].Preq] >= tsApplicable))
     
    195195begin
    196196  ctype := NewType;
    197   listed := [];
     197  Listed := [];
    198198  I := 0;
    199199  while MyData.ImpOrder[ctype, I] >= 0 do
    200200  begin
    201     Include(listed, MyData.ImpOrder[ctype, I]);
     201    Include(Listed, MyData.ImpOrder[ctype, I]);
    202202    Inc(I);
    203203  end;
     
    295295    Assert(MyData.ImpOrder[ctype, I] = iix);
    296296    Move(MyData.ImpOrder[ctype, I + 1], MyData.ImpOrder[ctype, I], nImp - I);
    297     Exclude(listed, iix);
     297    Exclude(Listed, iix);
    298298  end;
    299299
     
    308308      (Y < yList + nListRow * 32) then
    309309    begin
    310       if dragiix in listed then
     310      if dragiix in Listed then
    311311        UnList(dragiix);
    312312      I := (X - xList) div 42 + (Y - yList) div 32 * nListCol;
     
    316316        nImp - I - 1);
    317317      MyData.ImpOrder[ctype, I] := dragiix;
    318       Include(listed, dragiix);
     318      Include(Listed, dragiix);
    319319      Changed := True;
    320320    end
    321     else if (dragiix in listed) and (X >= xPool) and (X < xPool + nPoolCol * 42)
     321    else if (dragiix in Listed) and (X >= xPool) and (X < xPool + nPoolCol * 42)
    322322      and (Y >= yPool) and (Y < yPool + nPoolRow * 32) then
    323323    begin
     
    340340begin
    341341  FillChar(MyData.ImpOrder[ctype], SizeOf(MyData.ImpOrder[ctype]), Byte(-1));
    342   listed := [];
     342  Listed := [];
    343343  Changed := True;
    344344  SmartUpdateContent;
  • trunk/LocalPlayer/ClientTools.pas

    r522 r531  
    446446    eDied - job done and died (thurst) }
    447447var
    448   stage, NextJob, Tile: Integer;
    449   Done: set of jNone .. jPoll;
     448  Stage, NextJob, Tile: Integer;
     449  Done: set of jNone..jPoll;
    450450begin
    451451  Done := [];
     
    470470  while (Result <> eOK) and (Result <> eDied) do
    471471  begin
    472     stage := -1;
     472    Stage := -1;
    473473    repeat
    474       if stage = -1 then
     474      if Stage = -1 then
    475475        NextJob := jPoll
    476476      else
    477         NextJob := Jobs[Tile and fTerrain, stage];
     477        NextJob := Jobs[Tile and fTerrain, Stage];
    478478      if (NextJob = jNone) or not (NextJob in Done) then
    479479        Break;
    480       Inc(stage);
    481     until stage = 5;
    482     if (stage = 5) or (NextJob = jNone) then
     480      Inc(Stage);
     481    until Stage = 5;
     482    if (Stage = 5) or (NextJob = jNone) then
    483483    begin
    484484      Result := eJobDone;
  • trunk/LocalPlayer/Draft.pas

    r530 r531  
    2727    procedure PaintBox1MouseUp(Sender: TObject; Button: TMouseButton;
    2828      Shift: TShiftState; X, Y: Integer);
    29   public
    30     procedure ShowNewContent(NewMode: TWindowMode);
    31   protected
    32     procedure OffscreenPaint; override;
    3329  private
    3430    Domain, MaxLines, Lines, Cut, yDomain, yFeature, yWeight, yTotal, yView,
     
    3834    function IsFeatureInList(D, I: Integer): Boolean;
    3935    procedure SetDomain(D: Integer);
     36  protected
     37    procedure OffscreenPaint; override;
     38  public
     39    procedure ShowNewContent(NewMode: TWindowMode);
    4040  end;
    4141
     
    211211        Y := yTotal + 76;
    212212        LoweredTextOut(Offscreen.Canvas, -1, MainTexture, xTotal - 2, Y,
    213           Phrases.Lookup('COSTDIFF' + char(48 + G.Difficulty[Me])));
     213          Phrases.Lookup('COSTDIFF' + Char(48 + G.Difficulty[Me])));
    214214        LoweredTextOut(Offscreen.Canvas, -1, MainTexture,
    215215          xTotal2 + 148 + 30, Y, '=');
  • trunk/LocalPlayer/Enhance.pas

    r496 r531  
    3939  private
    4040    NoMap: TIsoMap;
    41   public
    42     procedure ShowNewContent(NewMode: TWindowMode; TerrType: Integer = -1);
    4341  protected
    4442    Page: Integer;
    4543    procedure OffscreenPaint; override;
     44  public
     45    procedure ShowNewContent(NewMode: TWindowMode; TerrType: Integer = -1);
    4646  end;
    4747
  • trunk/LocalPlayer/Help.pas

    r530 r531  
    113113    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    114114    procedure SearchBtnClick(Sender: TObject);
    115   protected
    116     procedure OffscreenPaint; override;
    117115  private
    118116    Kind: TLinkCategory;
     
    141139    procedure OnScroll(var Msg: TMessage); message WM_VSCROLL;
    142140    procedure OnMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE;
     141  protected
     142    procedure OffscreenPaint; override;
    143143  public
    144144    HistItems: THistItems;
  • trunk/LocalPlayer/NatStat.pas

    r530 r531  
    3232    procedure ScrollDownBtnClick(Sender: TObject);
    3333    procedure TellAIBtnClick(Sender: TObject);
    34   public
    35     procedure CheckAge;
    36     procedure ShowNewContent(NewMode: TWindowMode; P: Integer = -1);
    37     procedure EcoChange;
    3834  protected
    3935    procedure OffscreenPaint; override;
     
    5046    ReportText: TStringList;
    5147    procedure GenerateReportText;
     48  public
     49    procedure CheckAge;
     50    procedure ShowNewContent(NewMode: TWindowMode; P: Integer = -1);
     51    procedure EcoChange;
    5252  end;
    5353
     
    244244            if ExtinctPart then
    245245              S := '(' + S + ')';
    246             ReportText.Add(char(48 + Treaty) + S);
     246            ReportText.Add(Char(48 + Treaty) + S);
    247247          end;
    248248  end;
  • trunk/LocalPlayer/Nego.pas

    r522 r531  
    481481procedure TNegoDlg.OffscreenPaint;
    482482var
    483   I, cred: Integer;
     483  I, Cred: Integer;
    484484  S: string;
    485485  OkEnabled: Boolean;
     
    600600  // show credibility
    601601  Offscreen.Canvas.Font.Assign(UniFont[ftTiny]);
    602   cred := MyRO.EnemyReport[DipMem[Me].pContact].Credibility;
    603   case cred of
     602  Cred := MyRO.EnemyReport[DipMem[Me].pContact].Credibility;
     603  case Cred of
    604604    0 .. 49:
    605605      I := 3;
     
    609609      I := 1;
    610610  end;
    611   PaintProgressBar(Offscreen.Canvas, I, xCred0, yCred0 + 17, (cred + 2) div 5,
     611  PaintProgressBar(Offscreen.Canvas, I, xCred0, yCred0 + 17, (Cred + 2) div 5,
    612612    0, 20, MainTexture);
    613   S := IntToStr(cred);
     613  S := IntToStr(Cred);
    614614  RisedTextOut(Offscreen.Canvas, xCred0 + 10 -
    615615    (BiColorTextWidth(Offscreen.Canvas, S) + 1) div 2, yCred0, S);
  • trunk/LocalPlayer/Rates.pas

    r530 r531  
    4545procedure TRatesDlg.OffscreenPaint;
    4646var
    47   P, X, Y, current, Max, I: Integer;
     47  P, X, Y, Current, Max, I: Integer;
    4848  S, s1: string;
    4949begin
     
    112112    X := 16;
    113113    Y := 81;
    114     current := (100 - MyRO.LuxRate - MyRO.TaxRate) * 120 div 100;
     114    Current := (100 - MyRO.LuxRate - MyRO.TaxRate) * 120 div 100;
    115115    Max := 120;
    116116    Frame(Offscreen.Canvas, X - 1, Y - 1, X + Max, Y + 7, $000000, $000000);
     
    119119    with Offscreen.Canvas do
    120120    begin
    121       for I := 0 to current div 8 - 1 do
     121      for I := 0 to Current div 8 - 1 do
    122122        BitBltBitmap(Offscreen, X + Max - 8 - I * 8, Y, 8, 7,
    123123          HGrSystem.Data, 104, 9 + 8 * 2);
    124       BitBltBitmap(Offscreen, X + Max - current, Y, current - 8 * (current div 8), 7,
     124      BitBltBitmap(Offscreen, X + Max - Current, Y, Current - 8 * (Current div 8), 7,
    125125        HGrSystem.Data, 104, 9 + 8 * 2);
    126126      Brush.Color := $000000;
    127       FillRect(Rect(X, Y, X + Max - current, Y + 7));
     127      FillRect(Rect(X, Y, X + Max - Current, Y + 7));
    128128      Brush.Style := TBrushStyle.bsClear;
    129129    end;
  • trunk/LocalPlayer/Select.pas

    r530 r531  
    10731073  PPicture, PTestPicture: ^TModelPicture;
    10741074  ModelOk: array [0 .. 4095] of Boolean;
    1075   ok: Boolean;
     1075  Ok: Boolean;
    10761076begin
    10771077  for I := 0 to MaxLayer - 1 do
     
    11081108        begin
    11091109          { if MyModel[i].Kind=mkSlaves then
    1110             ok:= MyRO.Wonder[woPyramids].EffectiveOwner=Me
     1110            Ok:= MyRO.Wonder[woPyramids].EffectiveOwner=Me
    11111111            else } if MyModel[I].Domain = dSea then
    11121112          begin
    1113             ok := False;
     1113            Ok := False;
    11141114            for dx := -2 to 2 do
    11151115              for dy := -2 to 2 do
     
    11201120                    ((MyMap[Loc1] and fTerrain = fShore) or
    11211121                    (MyMap[Loc1] and fCanal > 0)) then
    1122                     ok := True;
     1122                    Ok := True;
    11231123                end;
    11241124          end
    11251125          else
    1126             ok := True;
    1127           if ok then
     1126            Ok := True;
     1127          if Ok then
    11281128          begin
    11291129            if MyModel[I].Status and msObsolete = 0 then
     
    11631163          Inc(Lines[0]);
    11641164        end;
    1165         ok := False;
     1165        Ok := False;
    11661166        for I := 0 to nDomains - 1 do
    11671167          if (upgrade[I, 0].Preq = preNone) or
    11681168            (MyRO.Tech[upgrade[I, 0].Preq] >= tsApplicable) then
    1169             ok := True;
    1170         if ok then { new unit class }
     1169            Ok := True;
     1170        if Ok then { new unit class }
    11711171        begin
    11721172          Code[0, Lines[0]] := adMilitary;
     
    12551255        for I := 0 to nAdv - 1 do
    12561256        begin
    1257           ok := (MyRO.Tech[I] <> tsNA) or (MyRO.ResearchTech = I);
     1257          Ok := (MyRO.Tech[I] <> tsNA) or (MyRO.ResearchTech = I);
    12581258          for J := 1 to nColumn - 1 do
    12591259            with MyRO.EnemyReport[Column[J]]^ do
    12601260              if (Tech[I] <> tsNA) or (TurnOfCivilReport >= 0) and
    12611261                (ResearchTech = I) then
    1262                 ok := True;
    1263           if ok then
     1262                Ok := True;
     1263          if Ok then
    12641264          begin
    12651265            Code[0, Lines[0]] := I;
     
    12691269        SortTechs;
    12701270
    1271         ok := MyRO.ResearchTech = adMilitary;
     1271        Ok := MyRO.ResearchTech = adMilitary;
    12721272        for J := 1 to nColumn - 1 do
    12731273          with MyRO.EnemyReport[Column[J]]^ do
    12741274            if (MyRO.Alive and (1 shl Column[J]) <> 0) and
    12751275              (TurnOfCivilReport >= 0) and (ResearchTech = adMilitary) then
    1276               ok := True;
    1277         if ok then
     1276              Ok := True;
     1277        if Ok then
    12781278        begin
    12791279          Code[0, Lines[0]] := adMilitary;
     
    13301330        begin // check if opponent already has this model
    13311331          MakeModelInfo(Me, mix, MyModel[mix], mi);
    1332           ok := True;
     1332          Ok := True;
    13331333          for emix := 0 to MyRO.nEnemyModel - 1 do
    13341334            if (MyRO.EnemyModel[emix].Owner = DipMem[Me].pContact) and
    13351335              IsSameModel(MyRO.EnemyModel[emix], mi) then
    1336               ok := False;
    1337           if ok then
     1336              Ok := False;
     1337          if Ok then
    13381338          begin
    13391339            Code[0, Lines[0]] := mix;
     
    14141414            if not Assigned(PPicture.HGr) then
    14151415              InitEnemyModel(emix);
    1416             ok := True;
     1416            Ok := True;
    14171417            if MainScreen.mNames.Checked then
    14181418              for J := 0 to Lines[0] - 1 do
     
    14261426                begin
    14271427                  Code[1, J] := 1;
    1428                   ok := False;
     1428                  Ok := False;
    14291429                  Break;
    14301430                end;
    14311431              end;
    1432             if ok then
     1432            if Ok then
    14331433            begin
    14341434              Code[0, Lines[0]] := emix;
  • trunk/LocalPlayer/Term.pas

    r530 r531  
    421421    procedure UpdateKeyShortcuts;
    422422    procedure SetFullScreen(Active: Boolean);
    423     procedure PaintZoomedTile(dst: TBitmap; X, Y, Loc: Integer);
     423    procedure PaintZoomedTile(Dst: TBitmap; X, Y, Loc: Integer);
    424424  public
    425425    UsedOffscreenWidth: Integer;
     
    850850function AttackSound(Code: Integer): string;
    851851begin
    852   Result := 'ATTACK_' + char(48 + Code div 100 mod 10) +
    853     char(48 + Code div 10 mod 10) + char(48 + Code mod 10);
     852  Result := 'ATTACK_' + Char(48 + Code div 100 mod 10) +
     853    Char(48 + Code div 10 mod 10) + Char(48 + Code mod 10);
    854854end;
    855855
     
    931931          else OpenSound:=AttackSound(ModelCode(mi)); }
    932932        if MyModel[MyData.ToldModels].Kind = mkSelfDeveloped then
    933           OpenSound := 'NEWMODEL_' + char(48 + Age);
     933          OpenSound := 'NEWMODEL_' + Char(48 + Age);
    934934        MessgText := Phrases.Lookup('MODELAVAILABLE');
    935935        if GameMode = cMovie then
     
    989989end;
    990990
    991 procedure TMainScreen.PaintZoomedTile(dst: TBitmap; X, Y, Loc: Integer);
     991procedure TMainScreen.PaintZoomedTile(Dst: TBitmap; X, Y, Loc: Integer);
    992992
    993993  procedure TSprite(xDst, yDst, xSrc, ySrc: Integer);
    994994  begin
    995995    with NoMapPanel do
    996       Sprite(dst, HGrTerrain, X + xDst, Y + yDst, xxt * 2, yyt * 3,
     996      Sprite(Dst, HGrTerrain, X + xDst, Y + yDst, xxt * 2, yyt * 3,
    997997        1 + xSrc * (xxt * 2 + 1), 1 + ySrc * (yyt * 3 + 1));
    998998  end;
     
    10011001  begin
    10021002    with NoMapPanel do begin
    1003       Sprite(dst, HGrTerrain, X + xxt, Y + yyt + 2, xxt * 2, yyt * 2 - 2,
     1003      Sprite(Dst, HGrTerrain, X + xxt, Y + yyt + 2, xxt * 2, yyt * 2 - 2,
    10041004        1 + xSrc * (xxt * 2 + 1), 3 + yyt + ySrc * (yyt * 3 + 1));
    1005       Sprite(dst, HGrTerrain, X + 4, Y + 2 * yyt, xxt * 2 - 4, yyt * 2,
     1005      Sprite(Dst, HGrTerrain, X + 4, Y + 2 * yyt, xxt * 2 - 4, yyt * 2,
    10061006        5 + xSrc * (xxt * 2 + 1), 1 + yyt + ySrc * (yyt * 3 + 1));
    1007       Sprite(dst, HGrTerrain, X + xxt * 2, Y + 2 * yyt, xxt * 2 - 4, yyt * 2,
     1007      Sprite(Dst, HGrTerrain, X + xxt * 2, Y + 2 * yyt, xxt * 2 - 4, yyt * 2,
    10081008        1 + xSrc * (xxt * 2 + 1), 1 + yyt + ySrc * (yyt * 3 + 1));
    1009       Sprite(dst, HGrTerrain, X + xxt, Y + yyt * 3, xxt * 2, yyt * 2 - 2,
     1009      Sprite(Dst, HGrTerrain, X + xxt, Y + yyt * 3, xxt * 2, yyt * 2 - 2,
    10101010        1 + xSrc * (xxt * 2 + 1), 1 + yyt + ySrc * (yyt * 3 + 1));
    10111011    end;
     
    15191519  Color: TColor;
    15201520  Name: string;
    1521   ok: Boolean;
     1521  Ok: Boolean;
    15221522begin
    15231523  UnusedTribeFiles.Clear;
    1524   ok := FindFirst(LocalizedFilePath('Tribes') + DirectorySeparator + '*' + CevoTribeExt,
     1524  Ok := FindFirst(LocalizedFilePath('Tribes') + DirectorySeparator + '*' + CevoTribeExt,
    15251525    faArchive + faReadOnly, SearchRec) = 0;
    1526   if not ok then
     1526  if not Ok then
    15271527  begin
    15281528    FindClose(SearchRec);
    1529     ok := FindFirst(LocalizedFilePath('Tribes' + DirectorySeparator + '*' + CevoTribeExt),
     1529    Ok := FindFirst(LocalizedFilePath('Tribes' + DirectorySeparator + '*' + CevoTribeExt),
    15301530      faArchive + faReadOnly, SearchRec) = 0;
    15311531  end;
    1532   if ok then
     1532  if Ok then
    15331533    repeat
    15341534      SearchRec.Name := Copy(SearchRec.Name, 1, Length(SearchRec.Name) - Length(CevoTribeExt));
     
    20782078        else
    20792079        begin
    2080           S := Tribe[Me].TPhrase('AGE' + char(48 + Age));
     2080          S := Tribe[Me].TPhrase('AGE' + Char(48 + Age));
    20812081          MessgText := Format(S, [TurnToString(MyRO.Turn)]);
    20822082        end;
     
    20862086        { else begin Kind:=mkOkHelp; HelpKind:=hkAdv; HelpNo:=AgePreq[age]; end };
    20872087        CenterTo := NewAgeCenterTo;
    2088         OpenSound := 'AGE_' + char(48 + Age);
     2088        OpenSound := 'AGE_' + Char(48 + Age);
    20892089        Application.ProcessMessages;
    20902090        ShowModal;
     
    22502250          Item := 'RESEARCH_GENERAL';
    22512251          if GameMode <> cMovie then
    2252             OpenSound := 'NEWADVANCE_' + char(48 + Age);
     2252            OpenSound := 'NEWADVANCE_' + Char(48 + Age);
    22532253          Item2 := Phrases.Lookup('ADVANCES', ad);
    22542254          if ad in FutureTech then
     
    24442444              begin // !!! Shinkansen
    24452445                MoveResult := eOK;
    2446                 ok := True;
     2446                Ok := True;
    24472447                for I := 0 to MoveAdviceData.nStep - 1 do
    24482448                begin
     
    24542454                  // don't attack during auto move
    24552455                  begin
    2456                     ok := False;
    2457                     Break
     2456                    Ok := False;
     2457                    Break;
    24582458                  end
    24592459                  else
     
    24712471                    then
    24722472                    begin
    2473                       ok := False;
     2473                      Ok := False;
    24742474                      Break;
    24752475                    end;
     
    24782478                Stop := not ok or (Loc = MoveAdviceData.ToLoc) or
    24792479                  (MoveAdviceData.ToLoc = maNextCity) and
    2480                   (MyMap[Loc] and fCity <> 0)
     2480                  (MyMap[Loc] and fCity <> 0);
    24812481              end
    24822482              else
     
    29772977          with MessgExDlg do
    29782978          begin
    2979             OpenSound := 'CONTACT_' + char(48 + MyRO.EnemyReport[Integer(Data)
     2979            OpenSound := 'CONTACT_' + Char(48 + MyRO.EnemyReport[Integer(Data)
    29802980              ].Attitude);
    29812981            MessgText := Tribe[Integer(Data)].TPhrase('FRCONTACT');
     
    30053005        InitTurn(NewPlayer);
    30063006        if Command = scDipStart then
    3007           Play('CONTACT_' + char(48 + MyRO.Attitude[DipMem[NewPlayer]
     3007          Play('CONTACT_' + Char(48 + MyRO.Attitude[DipMem[NewPlayer]
    30083008            .pContact]))
    30093009        else if Command = scDipCancelTreaty then
     
    47184718var
    47194719  ProcessOptions: Integer;
    4720   rec: TRect;
     4720  Rec: TRect;
    47214721  DoInvalidate: Boolean;
    47224722begin
     
    47594759        Exit; { map window not moved }
    47604760      Offscreen.Canvas.Font.Assign(UniFont[ftSmall]);
    4761       rec := Rect(0, 0, MapWidth, MapHeight);
     4761      Rec := Rect(0, 0, MapWidth, MapHeight);
    47624762{$IFDEF WINDOWS}
    47634763      ScrollDC(Offscreen.Canvas.Handle, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt,
     
    47664766{$IFDEF UNIX}
    47674767      ScrollDC(Offscreen.Canvas, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt,
    4768         rec, rec, 0, nil);
     4768        Rec, Rec, 0, nil);
    47694769{$ENDIF}
    47704770      for DoInvalidate := False to FastScrolling do begin
    47714771        if DoInvalidate then begin
    4772           rec.Bottom := MapHeight - Overlap;
     4772          Rec.Bottom := MapHeight - Overlap;
    47734773{$IFDEF WINDOWS}
    47744774          ScrollDC(Canvas.Handle, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, rec,
     
    47774777{$IFDEF UNIX}
    47784778          ScrollDC(Canvas, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt,
    4779             rec, rec, 0, nil);
     4779            Rec, Rec, 0, nil);
    47804780{$ENDIF}
    47814781          ProcessOptions := prInvalidate;
     
    71537153    else if BHelp.Test(ShortCut) then mHelp.Click;
    71547154    (*if Shift = [ssCtrl] then
    7155       case char(Key) of
     7155      case Char(Key) of
    71567156         'A':
    71577157          begin // auto symmetry
  • trunk/LocalPlayer/Tribes.pas

    r468 r531  
    430430    I := 0;
    431431    while (I < Count) and (Copy(Strings[I], 1, 6) <>
    432         '#AGE' + char(48 + Age) + ' ') do
     432        '#AGE' + Char(48 + Age) + ' ') do
    433433      Inc(I);
    434434    if I < Count then
     
    489489var
    490490  I: Integer;
    491   ok: Boolean;
     491  Ok: Boolean;
    492492begin
    493493  with Info do
     
    516516
    517517      // read model name from tribe script
    518       ok := False;
     518      Ok := False;
    519519      for I := 0 to Script.Count - 1 do
    520520      begin
    521521        Input := Script[I];
    522522        if Input = '#UNITS ' + ExtractFileNameOnly(GrName) then
    523           ok := True
     523          Ok := True
    524524        else if (Input <> '') and (Input[1] = '#') then
    525           ok := False
    526         else if ok and (GetNum = pix) then
     525          Ok := False
     526        else if Ok and (GetNum = pix) then
    527527        begin
    528528          Get;
  • trunk/LocalPlayer/UnitStat.pas

    r530 r531  
    293293  end;
    294294
    295   procedure FeatureBar(dst: TBitmap; X, Y: Integer; const mi: TModelInfo;
     295  procedure FeatureBar(Dst: TBitmap; X, Y: Integer; const mi: TModelInfo;
    296296    T: TTexture);
    297297  var
    298     I, W, dx, num: Integer;
     298    I, W, dx, Num: Integer;
    299299    S: string;
    300300  begin
    301     DarkGradient(dst.Canvas, X - 6, Y + 1, 180, 1);
    302     with dst.Canvas do
     301    DarkGradient(Dst.Canvas, X - 6, Y + 1, 180, 1);
     302    with Dst.Canvas do
    303303      if mi.Kind >= $10 then
    304304      begin
     
    315315        for I := 3 to nFeature - 1 do
    316316        begin
    317           num := 0;
     317          Num := 0;
    318318          case I of
    319319            mcSeaTrans:
    320320              if mi.Domain = dSea then
    321                 num := mi.TTrans;
     321                Num := mi.TTrans;
    322322            mcCarrier:
    323323              if mi.Domain = dSea then
    324                 num := mi.ATrans_Fuel;
     324                Num := mi.ATrans_Fuel;
    325325            mcBombs:
    326               num := mi.Bombs;
     326              Num := mi.Bombs;
    327327            mcFuel:
    328328              if mi.Domain = dAir then
    329                 num := mi.ATrans_Fuel;
     329                Num := mi.ATrans_Fuel;
    330330            mcAirTrans:
    331331              if mi.Domain = dAir then
    332                 num := mi.TTrans;
     332                Num := mi.TTrans;
    333333            mcFirstNonCap .. nFeature - 1:
    334334              if mi.Cap and (1 shl (I - mcFirstNonCap)) <> 0 then
    335                 num := 1;
     335                Num := 1;
    336336          end;
    337           if (num > 0) and
     337          if (Num > 0) and
    338338            ((I <> mcSE) or (mi.Cap and (1 shl (mcNP - mcFirstNonCap)) = 0))
    339339          then
    340340          begin
    341             if num > 1 then
     341            if Num > 1 then
    342342            begin
    343               S := IntToStr(num);
     343              S := IntToStr(Num);
    344344              W := TextWidth(S);
    345345              Brush.Color := $FFFFFF;
     
    352352            FrameRect(Rect(X - 3 + dx, Y + 2, X + 11 + dx, Y + 16));
    353353            Brush.Style := TBrushStyle.bsClear;
    354             Sprite(dst, HGrSystem, X - 1 + dx, Y + 4, 10, 10,
     354            Sprite(Dst, HGrSystem, X - 1 + dx, Y + 4, 10, 10,
    355355              66 + I mod 11 * 11, 137 + I div 11 * 11);
    356356            Inc(dx, 15);
     
    360360  end;
    361361
    362   procedure NumberBarS(dst: TBitmap; X, Y: Integer; Cap, S: string; T: TTexture);
    363   begin
    364     DLine(dst.Canvas, X - 2, X + 170, Y + 16, T.ColorBevelShade, T.ColorBevelLight);
    365     LoweredTextOut(dst.Canvas, -1, T, X - 2, Y, Cap);
    366     RisedTextout(dst.Canvas, X + 170 - BiColorTextWidth(dst.Canvas, S), Y, S);
     362  procedure NumberBarS(Dst: TBitmap; X, Y: Integer; Cap, S: string; T: TTexture);
     363  begin
     364    DLine(Dst.Canvas, X - 2, X + 170, Y + 16, T.ColorBevelShade, T.ColorBevelLight);
     365    LoweredTextOut(Dst.Canvas, -1, T, X - 2, Y, Cap);
     366    RisedTextout(Dst.Canvas, X + 170 - BiColorTextWidth(Dst.Canvas, S), Y, S);
    367367  end;
    368368
Note: See TracChangeset for help on using the changeset viewer.