Ignore:
Timestamp:
Mar 23, 2021, 10:49:30 PM (3 years ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Term.pas

    r321 r325  
    224224    procedure MovieSpeedBtnClick(Sender: TObject);
    225225  private
    226     xw, yw, xwd, ywd, xwMini, ywMini, xMidPanel, xRightPanel, xTroop, xTerrain,
    227       xMini, yMini, ywmax, ywcenter, TroopLoc, TrCnt, TrRow, TrPitch, MapWidth,
    228       MapOffset, MapHeight, BlinkTime, BrushLoc, EditLoc, xMouse,
    229       yMouse: integer;
     226    xw: Integer;
     227    yw: Integer;
     228    xwd: Integer;
     229    ywd: Integer;
     230    xwMini: Integer;
     231    ywMini: Integer;
     232    xMidPanel: Integer;
     233    xRightPanel: Integer;
     234    xTroop: Integer;
     235    xTerrain: Integer;
     236    xMini: Integer;
     237    yMini: Integer;
     238    ywmax: Integer;
     239    ywcenter: Integer;
     240    TroopLoc: Integer;
     241    TrCnt: Integer;
     242    TrRow: Integer;
     243    TrPitch: Integer;
     244    MapWidth: Integer;
     245    MapOffset: Integer;
     246    MapHeight: Integer;
     247    BlinkTime: Integer;
     248    BrushLoc: Integer;
     249    EditLoc: Integer;
     250    xMouse: Integer;
     251    yMouse: Integer;
    230252    BrushType: Cardinal;
    231     trix: array [0 .. 63] of integer;
     253    trix: array [0 .. 63] of Integer;
    232254    AILogo: array [0 .. nPl - 1] of TBitmap;
    233     Mini, Panel, TopBar: TBitmap;
     255    Mini: TBitmap;
     256    Panel: TBitmap;
     257    TopBar: TBitmap;
    234258    sb: TPVScrollbar;
    235     Closable, RepaintOnResize, Tracking, TurnComplete, Edited, GoOnPhase,
    236       HaveStrategyAdvice, FirstMovieTurn: boolean;
     259    Closable: Boolean;
     260    RepaintOnResize: Boolean;
     261    Tracking: Boolean;
     262    TurnComplete: Boolean;
     263    Edited: Boolean;
     264    GoOnPhase: Boolean;
     265    HaveStrategyAdvice: Boolean;
     266    FirstMovieTurn: Boolean;
    237267    PrevWindowState: TWindowState;
    238268    CurrentWindowState: TWindowState;
     
    322352  end;
    323353
    324   TPriceSet = Set of $00 .. $FF;
     354  TPriceSet = set of $00 .. $FF;
    325355
    326356const
     
    416446  sbAll = $FF;
    417447
    418   TileSizes: array [TTileSize] of TPoint = ((X: 33; Y: 16), (X: 48; Y: 24), (X: 72; Y: 36));
     448  TileSizes: array [TTileSize] of TPoint = ((X: 33; Y: 16), (X: 48; Y: 24),
     449    (X: 72; Y: 36));
    419450
    420451type
     
    432463    ToldWonders: array [0 .. 27] of TWonderInfo;
    433464    ToldTech: array [0 .. nAdv - 1] of ShortInt;
     465  end;
     466
     467  TDipMem = record
     468    pContact: Integer;
     469    SentCommand: Integer;
     470    FormerTreaty: Integer;
     471    SentOffer: TOffer;
     472    DeliveredPrices: TPriceSet;
     473    ReceivedPrices: TPriceSet;
    434474  end;
    435475
     
    468508  TribeOriginal: array [0 .. nPl - 1] of Boolean;
    469509  LostArmy: array [0 .. nPl * nMmax - 1] of Integer;
    470   DipMem: array [0 .. nPl - 1] of record
    471     pContact: Integer;
    472     SentCommand: Integer;
    473     FormerTreaty: Integer;
    474     SentOffer: TOffer;
    475     DeliveredPrices: TPriceSet;
    476     ReceivedPrices: TPriceSet;
    477   end;
     510  DipMem: array [0 .. nPl - 1] of TDipMem;
    478511
    479512function CityEventName(i: integer): string;
     
    41894222      Brush.Style := bsClear;
    41904223      OffscreenUser := self;
    4191       exit
     4224      exit;
    41924225    end;
    41934226
     
    42144247    offscreen.Canvas.Font.Assign(UniFont[ftSmall]);
    42154248    ProcessRect(xw, yw, MapWidth div xxt, MapHeight div yyt,
    4216       prPaint or prInvalidate)
     4249      prPaint or prInvalidate);
    42174250  end
    42184251  else
     
    42854318        TopBarHeight + MapHeight - overlap);
    42864319    RectInvalidate(xMidPanel, TopBarHeight + MapHeight - overlap, xRightPanel,
    4287       TopBarHeight + MapHeight)
     4320      TopBarHeight + MapHeight);
    42884321  end;
    42894322  // if (xwd<>xw) or (ywd<>yw) then
     
    49534986  end;
    49544987  RectInvalidate(0, 0, ClientWidth, TopBarHeight);
    4955 end; { PanelPaint }
     4988end;
    49564989
    49574990procedure TMainScreen.FocusOnLoc(Loc: integer; Options: integer = 0);
     
    49685001  begin
    49695002    Centre(Loc);
    4970     PaintAllMaps
     5003    PaintAllMaps;
    49715004  end
    49725005  else if not MapValid then
     
    50035036        begin
    50045037          NewFocus := uix;
    5005           Break
     5038          Break;
    50065039        end
    50075040        else
     
    50115044          begin
    50125045            NewFocus := uix;
    5013             Dist := TestDist
    5014           end
    5015         end
     5046            Dist := TestDist;
     5047          end;
     5048        end;
    50165049    end;
    50175050    if GotoOnly then
     
    50435076    PanelPaint;
    50445077  end;
    5045 end; { NextUnit }
     5078end;
    50465079
    50475080procedure TMainScreen.Scroll(dx, dy: integer);
     
    50835116          PaintLocTemp(MyUn[UnFocus].Loc)
    50845117        else if TurnComplete and not supervising then
    5085           EOT.SetButtonIndexFast(eotBlinkOn)
    5086       end
     5118          EOT.SetButtonIndexFast(eotBlinkOn);
     5119      end;
    50875120    end
    50885121    else
     
    51135146            Screen.ActiveForm.OnDeactivate(nil);
    51145147          Scroll(dx, dy);
    5115         end
     5148        end;
    51165149      end;
    51175150
     
    51345167          EOT.SetButtonIndexFast(eotBlinkOff)
    51355168        else if BlinkTime = BlinkOffTime then
    5136           EOT.SetButtonIndexFast(eotBlinkOn)
    5137       end
    5138     end
     5169          EOT.SetButtonIndexFast(eotBlinkOn);
     5170      end;
     5171    end;
    51395172end;
    51405173
     
    51555188    else if yw > ywmax then
    51565189      yw := ywmax;
    5157   end
     5190  end;
    51585191end;
    51595192
Note: See TracChangeset for help on using the changeset viewer.