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/LocalPlayer/UnitStat.pas

    r442 r447  
    2828  public
    2929    procedure CheckAge;
    30     procedure ShowNewContent_OwnModel(NewMode: TWindowMode; mix: integer);
    31     procedure ShowNewContent_OwnUnit(NewMode: TWindowMode; uix: integer);
    32     procedure ShowNewContent_EnemyUnit(NewMode: TWindowMode; euix: integer);
    33     procedure ShowNewContent_EnemyLoc(NewMode: TWindowMode; Loc: integer);
    34     procedure ShowNewContent_EnemyModel(NewMode: TWindowMode; emix: integer);
    35     procedure ShowNewContent_EnemyCity(NewMode: TWindowMode; Loc: integer);
     30    procedure ShowNewContent_OwnModel(NewMode: TWindowMode; mix: Integer);
     31    procedure ShowNewContent_OwnUnit(NewMode: TWindowMode; uix: Integer);
     32    procedure ShowNewContent_EnemyUnit(NewMode: TWindowMode; euix: Integer);
     33    procedure ShowNewContent_EnemyLoc(NewMode: TWindowMode; Loc: Integer);
     34    procedure ShowNewContent_EnemyModel(NewMode: TWindowMode; emix: Integer);
     35    procedure ShowNewContent_EnemyCity(NewMode: TWindowMode; Loc: Integer);
    3636
    3737  protected
    3838    mixShow, // for dkOwnModel
    39     uixShow, euixShow, ecixShow, UnitLoc, AgePrepared: integer;
     39    uixShow, euixShow, ecixShow, UnitLoc, AgePrepared: Integer;
    4040    // for dkEnemyUnit, euixShow=-1 ->
    4141    mox: ^TModelInfo; // for dkEnemyModel
     
    121121procedure TUnitStatDlg.FormShow(Sender: TObject);
    122122var
    123   owner, mix: integer;
    124   IsSpecialUnit: boolean;
     123  owner, mix: Integer;
     124  IsSpecialUnit: Boolean;
    125125begin
    126126  if Kind in [dkEnemyUnit, dkEnemyCityDefense, dkEnemyCity] then
     
    132132        euixShow := MyRO.nEnemyUn - 1;
    133133        while (euixShow >= 0) and (MyRO.EnemyUn[euixShow].Loc <> UnitLoc) do
    134           dec(euixShow);
    135         assert(euixShow >= 0);
     134          Dec(euixShow);
     135        Assert(euixShow >= 0);
    136136      end;
    137137      with MyRO.EnemyUn[euixShow] do
     
    148148      ecixShow := MyRO.nEnemyCity - 1;
    149149      while (ecixShow >= 0) and (MyRO.EnemyCity[ecixShow].Loc <> UnitLoc) do
    150         dec(ecixShow);
    151       assert(ecixShow >= 0);
     150        Dec(ecixShow);
     151      Assert(ecixShow >= 0);
    152152    end;
    153153  end;
     
    178178  end;
    179179
    180   SwitchBtn.Visible := not supervising and (Kind = dkOwnModel);
    181   ConscriptsBtn.Visible := not supervising and (Kind = dkOwnModel) and
     180  SwitchBtn.Visible := not Supervising and (Kind = dkOwnModel);
     181  ConscriptsBtn.Visible := not Supervising and (Kind = dkOwnModel) and
    182182    (MyRO.Tech[adConscription] >= tsApplicable) and
    183183    (MyModel[mixShow].Domain = dGround) and (MyModel[mixShow].Kind < mkScout);
    184   IsSpecialUnit := false;
     184  IsSpecialUnit := False;
    185185  if Kind in [dkEnemyCity, dkEnemyCityDefense] then
    186186    Caption := CityName(MyRO.EnemyCity[ecixShow].ID)
     
    190190      dkOwnModel:
    191191        begin
    192           owner := me;
     192          owner := Me;
    193193          mix := mixShow;
    194194          IsSpecialUnit := MyModel[mix].Kind >= $10;
     
    196196      dkOwnUnit:
    197197        begin
    198           owner := me;
     198          owner := Me;
    199199          mix := MyUn[uixShow].mix;
    200200          IsSpecialUnit := MyModel[mix].Kind >= $10;
     
    218218end;
    219219
    220 procedure TUnitStatDlg.ShowNewContent_OwnModel(NewMode: TWindowMode; mix: integer);
     220procedure TUnitStatDlg.ShowNewContent_OwnModel(NewMode: TWindowMode; mix: Integer);
    221221begin
    222222  Kind := dkOwnModel;
     
    225225end;
    226226
    227 procedure TUnitStatDlg.ShowNewContent_OwnUnit(NewMode: TWindowMode; uix: integer);
     227procedure TUnitStatDlg.ShowNewContent_OwnUnit(NewMode: TWindowMode; uix: Integer);
    228228begin
    229229  Kind := dkOwnUnit;
     
    232232end;
    233233
    234 procedure TUnitStatDlg.ShowNewContent_EnemyUnit(NewMode: TWindowMode; euix: integer);
     234procedure TUnitStatDlg.ShowNewContent_EnemyUnit(NewMode: TWindowMode; euix: Integer);
    235235begin
    236236  Kind := dkEnemyUnit;
     
    240240end;
    241241
    242 procedure TUnitStatDlg.ShowNewContent_EnemyLoc(NewMode: TWindowMode; Loc: integer);
     242procedure TUnitStatDlg.ShowNewContent_EnemyLoc(NewMode: TWindowMode; Loc: Integer);
    243243begin
    244244  Kind := dkEnemyUnit;
     
    248248end;
    249249
    250 procedure TUnitStatDlg.ShowNewContent_EnemyModel(NewMode: TWindowMode; emix: integer);
     250procedure TUnitStatDlg.ShowNewContent_EnemyModel(NewMode: TWindowMode; emix: Integer);
    251251begin
    252252  Kind := dkEnemyModel;
     
    255255end;
    256256
    257 procedure TUnitStatDlg.ShowNewContent_EnemyCity(NewMode: TWindowMode; Loc: integer);
     257procedure TUnitStatDlg.ShowNewContent_EnemyCity(NewMode: TWindowMode; Loc: Integer);
    258258begin
    259259  if MyMap[Loc] and fUnit <> 0 then
     
    286286  PPicture: ^TModelPicture;
    287287
    288   function IsToCount(emix: integer): boolean;
     288  function IsToCount(emix: Integer): Boolean;
    289289  var
    290290    PTestPicture: ^TModelPicture;
     
    294294      PTestPicture := @Tribe[MyRO.EnemyModel[emix].owner].ModelPicture
    295295        [MyRO.EnemyModel[emix].mix];
    296       result := (PPicture.HGr = PTestPicture.HGr) and
     296      Result := (PPicture.HGr = PTestPicture.HGr) and
    297297        (PPicture.pix = PTestPicture.pix) and
    298298        (ModelHash(mox^) = ModelHash(MyRO.EnemyModel[emix]));
    299299    end
    300300    else
    301       result := (MyRO.EnemyModel[emix].owner = mox.owner) and
     301      Result := (MyRO.EnemyModel[emix].owner = mox.owner) and
    302302        (MyRO.EnemyModel[emix].mix = mox.mix);
    303303  end;
    304304
    305   procedure FeatureBar(dst: TBitmap; x, y: integer; const mi: TModelInfo;
     305  procedure FeatureBar(dst: TBitmap; X, Y: Integer; const mi: TModelInfo;
    306306    T: TTexture);
    307307  var
    308     i, w, dx, num: integer;
    309     s: string;
    310   begin
    311     DarkGradient(dst.Canvas, x - 6, y + 1, 180, 1);
     308    I, W, dx, num: Integer;
     309    S: string;
     310  begin
     311    DarkGradient(dst.Canvas, X - 6, Y + 1, 180, 1);
    312312    with dst.Canvas do
    313313      if mi.Kind >= $10 then
    314314      begin
    315         s := Phrases.Lookup('UNITSPECIAL');
     315        S := Phrases.Lookup('UNITSPECIAL');
    316316        Font.Color := $000000;
    317         Textout(x - 1, y + 1, s);
     317        Textout(X - 1, Y + 1, S);
    318318        Font.Color := $B0B0B0;
    319         Textout(x - 2, y, s);
     319        Textout(X - 2, Y, S);
    320320      end
    321321      else
     
    323323        Font.Color := $000000;
    324324        dx := 2;
    325         for i := 3 to nFeature - 1 do
     325        for I := 3 to nFeature - 1 do
    326326        begin
    327327          num := 0;
    328           case i of
     328          case I of
    329329            mcSeaTrans:
    330330              if mi.Domain = dSea then
     
    342342                num := mi.TTrans;
    343343            mcFirstNonCap .. nFeature - 1:
    344               if mi.Cap and (1 shl (i - mcFirstNonCap)) <> 0 then
     344              if mi.Cap and (1 shl (I - mcFirstNonCap)) <> 0 then
    345345                num := 1
    346346          end;
    347347          if (num > 0) and
    348             ((i <> mcSE) or (mi.Cap and (1 shl (mcNP - mcFirstNonCap)) = 0))
     348            ((I <> mcSE) or (mi.Cap and (1 shl (mcNP - mcFirstNonCap)) = 0))
    349349          then
    350350          begin
    351351            if num > 1 then
    352352            begin
    353               s := IntToStr(num);
    354               w := TextWidth(s);
     353              S := IntToStr(num);
     354              W := TextWidth(S);
    355355              Brush.Color := $FFFFFF;
    356               FillRect(Rect(x - 3 + dx, y + 2, x + w - 1 + dx, y + 16));
     356              FillRect(Rect(X - 3 + dx, Y + 2, X + W - 1 + dx, Y + 16));
    357357              Brush.Style := bsClear;
    358               Textout(x - 3 + dx + 1, y, s);
    359               inc(dx, w + 1)
     358              Textout(X - 3 + dx + 1, Y, S);
     359              Inc(dx, W + 1)
    360360            end;
    361361            Brush.Color := $C0C0C0;
    362             FrameRect(Rect(x - 3 + dx, y + 2, x + 11 + dx, y + 16));
     362            FrameRect(Rect(X - 3 + dx, Y + 2, X + 11 + dx, Y + 16));
    363363            Brush.Style := bsClear;
    364             Sprite(dst, HGrSystem, x - 1 + dx, y + 4, 10, 10,
    365               66 + i mod 11 * 11, 137 + i div 11 * 11);
    366             inc(dx, 15)
     364            Sprite(dst, HGrSystem, X - 1 + dx, Y + 4, 10, 10,
     365              66 + I mod 11 * 11, 137 + I div 11 * 11);
     366            Inc(dx, 15)
    367367          end;
    368368        end;
     
    370370  end; { featurebar }
    371371
    372   procedure NumberBarS(dst: TBitmap; x, y: integer; Cap, s: string; T: TTexture);
    373   begin
    374     DLine(dst.Canvas, x - 2, x + 170, y + 16, T.ColorBevelShade, T.ColorBevelLight);
    375     LoweredTextOut(dst.Canvas, -1, T, x - 2, y, Cap);
    376     RisedTextout(dst.Canvas, x + 170 - BiColorTextWidth(dst.Canvas, s), y, s);
     372  procedure NumberBarS(dst: TBitmap; X, Y: Integer; Cap, S: string; T: TTexture);
     373  begin
     374    DLine(dst.Canvas, X - 2, X + 170, Y + 16, T.ColorBevelShade, T.ColorBevelLight);
     375    LoweredTextOut(dst.Canvas, -1, T, X - 2, Y, Cap);
     376    RisedTextout(dst.Canvas, X + 170 - BiColorTextWidth(dst.Canvas, S), Y, S);
    377377  end;
    378378
    379379var
    380   i, j, x, y, cix, uix, emix, InProd, Available, Destroyed, Loc, Cnt, yView,
    381     yTotal, yCaption: integer;
    382   s: string;
     380  I, J, X, Y, cix, uix, emix, InProd, Available, Destroyed, Loc, Cnt, yView,
     381    yTotal, yCaption: Integer;
     382  S: string;
    383383  ui: TUnitInfo;
    384384  mi: TModelInfo;
     
    389389    dkOwnModel:
    390390      begin
    391         BitBltCanvas(offscreen.Canvas, 0, 0, wCommon, hOwnModel,
     391        BitBltCanvas(Offscreen.Canvas, 0, 0, wCommon, hOwnModel,
    392392          Back.Canvas, 0, 0);
    393393        yView := 13;
     
    396396    dkEnemyModel:
    397397      begin
    398         BitBltCanvas(offscreen.Canvas, 0, 0, wCommon, hEnemyModel,
     398        BitBltCanvas(Offscreen.Canvas, 0, 0, wCommon, hEnemyModel,
    399399          Back.Canvas, wCommon, 0);
    400400        yView := 13;
     
    403403    dkEnemyUnit, dkOwnUnit:
    404404      begin
    405         BitBltCanvas(offscreen.Canvas, 0, 0, wCommon, hEnemyUnit,
     405        BitBltCanvas(Offscreen.Canvas, 0, 0, wCommon, hEnemyUnit,
    406406          Back.Canvas, 2 * wCommon, 0);
    407407        yView := 13;
     
    410410    dkEnemyCityDefense:
    411411      begin
    412         BitBltCanvas(offscreen.Canvas, 0, 0, wCommon, hEnemyCityDefense,
     412        BitBltCanvas(Offscreen.Canvas, 0, 0, wCommon, hEnemyCityDefense,
    413413          Back.Canvas, 3 * wCommon, 0);
    414414        yView := 171;
     
    417417    dkEnemyCity:
    418418      begin
    419         BitBltCanvas(offscreen.Canvas, 0, 0, wCommon, hEnemyCity,
     419        BitBltCanvas(Offscreen.Canvas, 0, 0, wCommon, hEnemyCity,
    420420          Back.Canvas, 4 * wCommon, 0);
    421421      end;
     
    427427  begin // show city defense facilities
    428428    Cnt := 0;
    429     for i := 0 to 3 do
    430       if MyRO.EnemyCity[ecixShow].Flags and (2 shl i) <> 0 then
    431         inc(Cnt);
    432     x := (wCommon - Cnt * xSizeSmall) div 2 - (Cnt - 1) * 2;
    433     for i := 0 to 3 do
    434       if MyRO.EnemyCity[ecixShow].Flags and (2 shl i) <> 0 then
    435       begin
    436         case i of
    437           0: j := imWalls;
    438           1: j := imCoastalFort;
    439           2: j := imMissileBat;
    440           3: j := imBunker
     429    for I := 0 to 3 do
     430      if MyRO.EnemyCity[ecixShow].Flags and (2 shl I) <> 0 then
     431        Inc(Cnt);
     432    X := (wCommon - Cnt * xSizeSmall) div 2 - (Cnt - 1) * 2;
     433    for I := 0 to 3 do
     434      if MyRO.EnemyCity[ecixShow].Flags and (2 shl I) <> 0 then
     435      begin
     436        case I of
     437          0: J := imWalls;
     438          1: J := imCoastalFort;
     439          2: J := imMissileBat;
     440          3: J := imBunker
    441441        end;
    442         Frame(offscreen.Canvas, x - 1, yImp - 1, x + xSizeSmall,
     442        Frame(Offscreen.Canvas, X - 1, yImp - 1, X + xSizeSmall,
    443443          yImp + ySizeSmall, MainTexture.ColorBevelLight,
    444444          MainTexture.ColorBevelShade);
    445         BitBltCanvas(offscreen.Canvas, x, yImp, xSizeSmall, ySizeSmall,
    446           SmallImp.Canvas, j mod 7 * xSizeSmall,
    447           (j + SystemIconLines * 7) div 7 * ySizeSmall);
    448         inc(x, xSizeSmall + 4);
     445        BitBltCanvas(Offscreen.Canvas, X, yImp, xSizeSmall, ySizeSmall,
     446          SmallImp.Canvas, J mod 7 * xSizeSmall,
     447          (J + SystemIconLines * 7) div 7 * ySizeSmall);
     448        Inc(X, xSizeSmall + 4);
    449449      end;
    450450  end;
     
    454454    PPicture := @Tribe[mox.owner].ModelPicture[mox.mix];
    455455    Available := 0;
    456     if G.Difficulty[me] = 0 then // supervisor -- count stacked units too
     456    if G.Difficulty[Me] = 0 then // supervisor -- count stacked units too
    457457      for Loc := 0 to G.lx * G.ly - 1 do
    458458      begin
    459459        if MyMap[Loc] and fUnit <> 0 then
    460460        begin
    461           Server(sGetUnits, me, Loc, Cnt);
     461          Server(sGetUnits, Me, Loc, Cnt);
    462462          for uix := 0 to Cnt - 1 do
    463463            if IsToCount(MyRO.EnemyUn[MyRO.nEnemyUn + uix].emix) then
    464               inc(Available);
     464              Inc(Available);
    465465        end;
    466466      end
     
    469469        if (MyRO.EnemyUn[uix].Loc >= 0) and IsToCount(MyRO.EnemyUn[uix].emix)
    470470        then
    471           inc(Available);
     471          Inc(Available);
    472472    Destroyed := 0;
    473473    for emix := 0 to MyRO.nEnemyModel - 1 do
    474474      if IsToCount(emix) then
    475         inc(Destroyed, MyRO.EnemyModel[emix].Lost);
     475        Inc(Destroyed, MyRO.EnemyModel[emix].Lost);
    476476  end
    477477  else
     
    480480    for uix := 0 to MyRO.nUn - 1 do
    481481      if (MyUn[uix].Loc >= 0) and (MyUn[uix].mix = mixShow) then
    482         inc(Available);
     482        Inc(Available);
    483483    InProd := 0;
    484484    for cix := 0 to MyRO.nCity - 1 do
    485485      if (MyCity[cix].Loc >= 0) and
    486486        (MyCity[cix].Project and (cpImp + cpIndex) = mixShow) then
    487         inc(InProd);
    488   end;
    489 
    490   offscreen.Canvas.Font.Assign(UniFont[ftSmall]);
     487        Inc(InProd);
     488  end;
     489
     490  Offscreen.Canvas.Font.Assign(UniFont[ftSmall]);
    491491  if Kind in [dkEnemyCityDefense, dkEnemyCity] then
    492492  begin
    493     NoMap.SetOutput(offscreen);
    494     NoMap.PaintCity(ClientWidth div 2, 53, MyRO.EnemyCity[ecixShow], false);
    495 
    496     s := Tribe[MyRO.EnemyCity[ecixShow].owner].TPhrase('UNITOWNER');
    497     LoweredTextOut(offscreen.Canvas, -1, MainTexture,
    498       (ClientWidth - BiColorTextWidth(offscreen.Canvas, s)) div 2, 105, s);
     493    NoMap.SetOutput(Offscreen);
     494    NoMap.PaintCity(ClientWidth div 2, 53, MyRO.EnemyCity[ecixShow], False);
     495
     496    S := Tribe[MyRO.EnemyCity[ecixShow].owner].TPhrase('UNITOWNER');
     497    LoweredTextOut(Offscreen.Canvas, -1, MainTexture,
     498      (ClientWidth - BiColorTextWidth(Offscreen.Canvas, S)) div 2, 105, S);
    499499  end;
    500500
     
    502502  begin // show unit stats
    503503    if Kind = dkOwnModel then
    504       MakeModelInfo(me, mixShow, MyModel[mixShow], mi)
     504      MakeModelInfo(Me, mixShow, MyModel[mixShow], mi)
    505505    else if Kind = dkOwnUnit then
    506506    begin
    507       MakeUnitInfo(me, MyUn[uixShow], ui);
    508       MakeModelInfo(me, MyUn[uixShow].mix, MyModel[MyUn[uixShow].mix], mi);
     507      MakeUnitInfo(Me, MyUn[uixShow], ui);
     508      MakeModelInfo(Me, MyUn[uixShow].mix, MyModel[MyUn[uixShow].mix], mi);
    509509    end
    510510    else
     
    522522          { Frame(offscreen.canvas,xView-1,yView-1,xView+64,yView+48,
    523523            MainTexture.ColorBevelShade,MainTexture.ColorBevelLight);
    524             RFrame(offscreen.canvas,xView-2,yView-2,xView+65,yView+49,
     524            RFrame(Offscreen.Canvas,xView-2,yView-2,xView+65,yView+49,
    525525            MainTexture.ColorBevelShade,MainTexture.ColorBevelLight); }
    526           with offscreen.Canvas do
     526          with Offscreen.Canvas do
    527527          begin
    528528            Brush.Color := HGrSystem.Data.Canvas.Pixels[98, 67];
    529             offscreen.Canvas.FillRect(Rect(xView, yView, xView + 64,
     529            Offscreen.Canvas.FillRect(Rect(xView, yView, xView + 64,
    530530              yView + 16));
    531531            Brush.Style := bsClear;
     
    534534          if MyMap[Loc] and fTerrain >= fForest then
    535535          begin
    536             x := 1 + 2 * (xxt * 2 + 1);
    537             y := 1 + yyt + 2 * (yyt * 3 + 1);
     536            X := 1 + 2 * (xxt * 2 + 1);
     537            Y := 1 + yyt + 2 * (yyt * 3 + 1);
    538538          end
    539539          else
    540540          begin
    541             x := integer(MyMap[Loc] and fTerrain) * (xxt * 2 + 1) + 1;
    542             y := 1 + yyt;
     541            X := Integer(MyMap[Loc] and fTerrain) * (xxt * 2 + 1) + 1;
     542            Y := 1 + yyt;
    543543          end;
    544           for j := -1 to 1 do
    545             for i := -1 to 1 do
    546               if (i + j) and 1 = 0 then
     544          for J := -1 to 1 do
     545            for I := -1 to 1 do
     546              if (I + J) and 1 = 0 then
    547547              begin
    548                 Sprite(Buffer, HGrTerrain, i * xxt, j * yyt, xxt * 2,
    549                   yyt * 2, x, y);
     548                Sprite(Buffer, HGrTerrain, I * xxt, J * yyt, xxt * 2,
     549                  yyt * 2, X, Y);
    550550                if MyMap[Loc] and (fTerrain or fSpecial) = fGrass or fSpecial1
    551551                then
    552                   Sprite(Buffer, HGrTerrain, i * xxt, j * yyt, xxt * 2, yyt * 2,
     552                  Sprite(Buffer, HGrTerrain, I * xxt, J * yyt, xxt * 2, yyt * 2,
    553553                    1 + 2 * (xxt * 2 + 1), 1 + yyt + 1 * (yyt * 3 + 1))
    554554                else if (MyMap[Loc] and fTerrain = fForest) and
    555555                  IsJungle(Loc div G.lx) then
    556                   Sprite(Buffer, HGrTerrain, i * xxt, j * yyt, xxt * 2, yyt * 2,
     556                  Sprite(Buffer, HGrTerrain, I * xxt, J * yyt, xxt * 2, yyt * 2,
    557557                    1 + 7 * (xxt * 2 + 1), 1 + yyt + 19 * (yyt * 3 + 1))
    558558                else if MyMap[Loc] and fTerrain >= fForest then
    559                   Sprite(Buffer, HGrTerrain, i * xxt, j * yyt, xxt * 2, yyt * 2,
     559                  Sprite(Buffer, HGrTerrain, I * xxt, J * yyt, xxt * 2, yyt * 2,
    560560                    1 + 7 * (xxt * 2 + 1),
    561                     1 + yyt + 2 * integer(2 + MyMap[Loc] and fTerrain - fForest)
     561                    1 + yyt + 2 * Integer(2 + MyMap[Loc] and fTerrain - fForest)
    562562                    * (yyt * 3 + 1));
    563563              end;
    564           BitBltCanvas(offscreen.Canvas, xView, yView + 16, 64, 32,
     564          BitBltCanvas(Offscreen.Canvas, xView, yView + 16, 64, 32,
    565565            Buffer.Canvas, 1, 0);
    566566
    567567          // show unit, experience and health
    568           Sprite(offscreen, HGr, xView, yView, 64, 48, pix mod 10 * 65 + 1,
     568          Sprite(Offscreen, HGr, xView, yView, 64, 48, pix mod 10 * 65 + 1,
    569569            pix div 10 * 49 + 1);
    570570          if Flags and unFortified <> 0 then
    571             Sprite(offscreen, HGrStdUnits, xView, yView, xxu * 2, yyu * 2,
     571            Sprite(Offscreen, HGrStdUnits, xView, yView, xxu * 2, yyu * 2,
    572572              1 + 6 * (xxu * 2 + 1), 1);
    573           FrameImage(offscreen.Canvas, HGrSystem.Data, xView - 20,
     573          FrameImage(Offscreen.Canvas, HGrSystem.Data, xView - 20,
    574574            yView + 5, 12, 14, 121 + Exp div ExpCost * 13, 28);
    575575          if Health < 100 then
    576576          begin
    577             s := IntToStr(Health) + '%';
    578             LightGradient(offscreen.Canvas, xView - 45, yView + 24, 38,
     577            S := IntToStr(Health) + '%';
     578            LightGradient(Offscreen.Canvas, xView - 45, yView + 24, 38,
    579579              (ColorOfHealth(Health) and $FEFEFE shr 2) * 3);
    580             RisedTextout(offscreen.Canvas, xView - 45 + 20 -
    581               BiColorTextWidth(offscreen.Canvas, s) div 2, yView + 23, s);
     580            RisedTextout(Offscreen.Canvas, xView - 45 + 20 -
     581              BiColorTextWidth(Offscreen.Canvas, S) div 2, yView + 23, S);
    582582          end;
    583583
    584584          if Kind = dkEnemyUnit then
    585585          begin
    586             s := Tribe[mox.owner].TPhrase('UNITOWNER');
    587             LoweredTextOut(offscreen.Canvas, -1, MainTexture,
    588               (ClientWidth - BiColorTextWidth(offscreen.Canvas, s)) div 2,
    589               yView + 80, s);
     586            S := Tribe[mox.owner].TPhrase('UNITOWNER');
     587            LoweredTextOut(Offscreen.Canvas, -1, MainTexture,
     588              (ClientWidth - BiColorTextWidth(Offscreen.Canvas, S)) div 2,
     589              yView + 80, S);
    590590          end;
    591591        end
    592592      else
    593593      begin
    594         FrameImage(offscreen.Canvas, BigImp, xView + 4, yView, 56, 40, 0, 0);
    595         Sprite(offscreen, HGr, xView, yView - 4, 64, 44, pix mod 10 * 65 + 1,
     594        FrameImage(Offscreen.Canvas, BigImp, xView + 4, yView, 56, 40, 0, 0);
     595        Sprite(Offscreen, HGr, xView, yView - 4, 64, 44, pix mod 10 * 65 + 1,
    596596          pix div 10 * 49 + 1);
    597597      end;
    598598
    599       DarkGradient(offscreen.Canvas, xTotal - 6, yTotal + 1, 180, 2);
    600       RisedTextout(offscreen.Canvas, xTotal - 2, yTotal,
     599      DarkGradient(Offscreen.Canvas, xTotal - 6, yTotal + 1, 180, 2);
     600      RisedTextout(Offscreen.Canvas, xTotal - 2, yTotal,
    601601        Phrases.Lookup('UNITSTRENGTH'));
    602       s := IntToStr(mi.Attack) + '/' + IntToStr(mi.Defense);
    603       RisedTextout(offscreen.Canvas,
    604         xTotal + 170 - BiColorTextWidth(offscreen.Canvas, s), yTotal, s);
    605       FeatureBar(offscreen, xTotal, yTotal + 19, mi, MainTexture);
    606       NumberBarS(offscreen, xTotal, yTotal + 38, Phrases.Lookup('UNITSPEED'),
     602      S := IntToStr(mi.Attack) + '/' + IntToStr(mi.Defense);
     603      RisedTextout(Offscreen.Canvas,
     604        xTotal + 170 - BiColorTextWidth(Offscreen.Canvas, S), yTotal, S);
     605      FeatureBar(Offscreen, xTotal, yTotal + 19, mi, MainTexture);
     606      NumberBarS(Offscreen, xTotal, yTotal + 38, Phrases.Lookup('UNITSPEED'),
    607607        MovementToString(mi.Speed), MainTexture);
    608       LoweredTextOut(offscreen.Canvas, -1, MainTexture, xTotal - 2, yTotal + 57,
     608      LoweredTextOut(Offscreen.Canvas, -1, MainTexture, xTotal - 2, yTotal + 57,
    609609        Phrases.Lookup('UNITCOST'));
    610       DLine(offscreen.Canvas, xTotal - 2, xTotal + 170, yTotal + 57 + 16,
     610      DLine(Offscreen.Canvas, xTotal - 2, xTotal + 170, yTotal + 57 + 16,
    611611        MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    612       if G.Difficulty[me] = 0 then
    613         s := IntToStr(mi.cost)
     612      if G.Difficulty[Me] = 0 then
     613        S := IntToStr(mi.cost)
    614614      else
    615         s := IntToStr(mi.cost * BuildCostMod[G.Difficulty[me]] div 12);
    616       RisedTextout(offscreen.Canvas,
    617         xTotal + 159 - BiColorTextWidth(offscreen.Canvas, s), yTotal + 57, s);
    618       Sprite(offscreen, HGrSystem, xTotal + 160, yTotal + 57 + 5, 10,
     615        S := IntToStr(mi.cost * BuildCostMod[G.Difficulty[Me]] div 12);
     616      RisedTextout(Offscreen.Canvas,
     617        xTotal + 159 - BiColorTextWidth(Offscreen.Canvas, S), yTotal + 57, S);
     618      Sprite(Offscreen, HGrSystem, xTotal + 160, yTotal + 57 + 5, 10,
    619619        10, 88, 115);
    620620
     
    624624        begin
    625625          if MyModel[mixShow].Kind = mkEnemyDeveloped then
    626             LoweredTextOut(offscreen.Canvas, -1, MainTexture, xTotal - 2,
     626            LoweredTextOut(Offscreen.Canvas, -1, MainTexture, xTotal - 2,
    627627              (yTotal + StatDown - 19), Phrases.Lookup('UNITADOPT'))
    628628          else
    629             LoweredTextOut(offscreen.Canvas, -1, MainTexture, xTotal - 2,
     629            LoweredTextOut(Offscreen.Canvas, -1, MainTexture, xTotal - 2,
    630630              (yTotal + StatDown - 19), Phrases.Lookup('UNITINTRO'));
    631           DLine(offscreen.Canvas, xTotal - 2, xTotal + 170,
     631          DLine(Offscreen.Canvas, xTotal - 2, xTotal + 170,
    632632            (yTotal + StatDown - 19) + 16, MainTexture.ColorTextShade,
    633633            MainTexture.ColorTextLight);
    634           s := TurnToString(MyModel[mixShow].IntroTurn);
    635           RisedTextout(offscreen.Canvas,
    636             xTotal + 170 - BiColorTextWidth(offscreen.Canvas, s),
    637             (yTotal + StatDown - 19), s);
     634          S := TurnToString(MyModel[mixShow].IntroTurn);
     635          RisedTextout(Offscreen.Canvas,
     636            xTotal + 170 - BiColorTextWidth(Offscreen.Canvas, S),
     637            (yTotal + StatDown - 19), S);
    638638        end;
    639639
    640         NumberBar(offscreen, xTotal, yTotal + StatDown,
     640        NumberBar(Offscreen, xTotal, yTotal + StatDown,
    641641          Phrases.Lookup('UNITBUILT'), MyModel[mixShow].Built, MainTexture);
    642642        if MyModel[mixShow].Lost > 0 then
    643           NumberBar(offscreen, xTotal, yTotal + StatDown + 19,
     643          NumberBar(Offscreen, xTotal, yTotal + StatDown + 19,
    644644            Phrases.Lookup('UNITLOST'), MyModel[mixShow].Lost, MainTexture);
    645645        if InProd > 0 then
    646           NumberBar(offscreen, xTotal, yTotal + StatDown + 57,
     646          NumberBar(Offscreen, xTotal, yTotal + StatDown + 57,
    647647            Phrases.Lookup('UNITINPROD'), InProd, MainTexture);
    648648        if Available > 0 then
    649           NumberBar(offscreen, xTotal, yTotal + StatDown + 38,
     649          NumberBar(Offscreen, xTotal, yTotal + StatDown + 38,
    650650            Phrases.Lookup('UNITAVAILABLE'), Available, MainTexture);
    651651
     
    674674      begin
    675675        if Destroyed > 0 then
    676           NumberBar(offscreen, xTotal, yTotal + StatDown - 19,
     676          NumberBar(Offscreen, xTotal, yTotal + StatDown - 19,
    677677            Phrases.Lookup('UNITDESTROYED'), Destroyed, MainTexture);
    678678        if Available > 0 then
    679           NumberBar(offscreen, xTotal, yTotal + StatDown,
     679          NumberBar(Offscreen, xTotal, yTotal + StatDown,
    680680            Phrases.Lookup('UNITKNOWN'), Available, MainTexture);
    681681      end;
     
    683683  end;
    684684
    685   offscreen.Canvas.Font.Assign(UniFont[ftNormal]);
     685  Offscreen.Canvas.Font.Assign(UniFont[ftNormal]);
    686686  case Kind of
    687687    dkOwnModel, dkEnemyModel:
     
    692692      yCaption := 79;
    693693  end;
    694   RisedTextout(offscreen.Canvas,
    695     (ClientWidth - BiColorTextWidth(offscreen.Canvas, Caption)) div 2,
     694  RisedTextout(Offscreen.Canvas,
     695    (ClientWidth - BiColorTextWidth(Offscreen.Canvas, Caption)) div 2,
    696696    yCaption, Caption);
    697697end;
Note: See TracChangeset for help on using the changeset viewer.