Changeset 356


Ignore:
Timestamp:
Apr 8, 2021, 9:57:38 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Made city small map mode enumeration type.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/CityScreen.pas

    r352 r356  
    1515type
    1616  TCityCloseAction = (None, RestoreFocus, StepFocus);
     17  TSmallMapMode = (smSupportedUnits, smImprovements);
    1718
    1819  TCityDlg = class(TBufferedDrawDlg)
     
    5960    cix: Integer;
    6061    cLoc: Integer;
    61     Mode: Integer;
     62    SmallMapMode: TSmallMapMode;
    6263    ZoomArea: Integer;
    6364    Page: Integer;
     
    111112
    112113const
    113   { modes }
    114   mSupp = 1;
    115   mImp = 2;
    116 
    117114  wBar = 106;
    118115  xDiv = 400;
     
    205202  AreaMap.SetPaintBounds(xmArea - 192, ymArea - 96 - 32, xmArea + 192,
    206203    ymArea + 96);
    207   Mode := mImp;
     204  SmallMapMode := smImprovements;
    208205  ZoomArea := 1;
    209206  ProdHint := false;
     
    269266procedure TCityDlg.Reset;
    270267begin
    271   Mode := mImp;
     268  SmallMapMode := smImprovements;
    272269  ZoomArea := 1;
    273270end;
     
    375372  BitBltCanvas(ZoomCityMap.Canvas, 0, 0, wZoomMap, hZoomMap,
    376373    Back.Canvas, xZoomMap, yZoomMap);
    377   if Mode = mImp then begin
     374  if SmallMapMode = smImprovements then begin
    378375    if ZoomArea < 3 then begin
    379376      ImageOp_B(ZoomCityMap, CityMapTemplate, 0, 0, 376 * SizeClass,
     
    795792  BitBltCanvas(offscreen.Canvas, xSmallMap, ySmallMap, wSmallMap, hSmallMap,
    796793    SmallCityMap.Canvas, 0, 0);
    797   if Mode = mImp then
     794  if SmallMapMode = smImprovements then
    798795    Frame(offscreen.Canvas, xSmallMap + 48 * (ZoomArea div 3),
    799796      ySmallMap + 24 * (ZoomArea mod 3), xSmallMap + 48 * (ZoomArea div 3) + 49,
     
    811808  x := xSupport + wSupport div 2;
    812809  y := ySupport + hSupport div 2;
    813   if Mode = mSupp then
     810  if SmallMapMode = smSupportedUnits then
    814811  begin
    815812    offscreen.Canvas.brush.Color := MainTexture.ColorMark;
     
    826823  for i := 0 to 5 do
    827824    imix[i] := -1;
    828   if Mode = mImp then
     825  if SmallMapMode = smImprovements then
    829826  begin
    830827    if ZoomArea = 5 then
     
    918915      Imp5Area.Hint := '';
    919916  end
    920   else { if mode=mSupp then }
     917  else { if SmallMapMode=smSupportedUnits then }
    921918  begin
    922919    LoweredTextout(offscreen.Canvas, -1, MainTexture, xZoomMap + 6,
     
    10491046  else { enemy city }
    10501047  begin
    1051     Mode := mImp;
     1048    SmallMapMode := smImprovements;
    10521049    Server(sGetCity, me, cLoc, GetCityData);
    10531050    c := GetCityData.c;
     
    11471144    (y >= ySmallMap) and (y < ySmallMap + hSmallMap) then
    11481145  begin
    1149     Mode := mImp;
     1146    SmallMapMode := smImprovements;
    11501147    ZoomArea := (y - ySmallMap) * 3 div hSmallMap + 3 *
    11511148      ((x - xSmallMap) * 2 div wSmallMap);
     
    11581155    (y >= ySupport) and (y < ySupport + hSupport) then
    11591156  begin
    1160     Mode := mSupp;
     1157    SmallMapMode := smSupportedUnits;
    11611158    Page := 0;
    11621159    InitZoomCityMap;
     
    11901187        ChooseProject;
    11911188      end
    1192     else if (Mode = mImp) and (x >= xZoomMap) and (x < xZoomMap + wZoomMap) and
     1189    else if (SmallMapMode = smImprovements) and (x >= xZoomMap) and (x < xZoomMap + wZoomMap) and
    11931190      (y >= yZoomMap) and (y < yZoomMap + hZoomMap) then
    11941191    begin
     
    12041201        if iix >= 0 then
    12051202          if ssShift in Shift then
    1206             HelpDlg.ShowNewContent(Mode or wmPersistent, hkImp, iix)
     1203            HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkImp, iix)
    12071204          else if (ClientMode < scContact) then
    12081205            with MessgExDlg do
     
    13011298      end;
    13021299    end
    1303     else if (Mode = mSupp) and (x >= xZoomMap) and (x < xZoomMap + wZoomMap) and
     1300    else if (SmallMapMode = smSupportedUnits) and (x >= xZoomMap) and (x < xZoomMap + wZoomMap) and
    13041301      (y >= yZoomMap) and (y < yZoomMap + hZoomMap) then
    13051302    begin
     
    13361333          Loc1 := dLoc(cLoc, dx, dy);
    13371334          if (Loc1 >= 0) and (Loc1 < G.lx * G.ly) then
    1338             HelpOnTerrain(Loc1, Mode or wmPersistent)
     1335            HelpOnTerrain(Loc1, FWindowMode or wmPersistent)
    13391336        end
    13401337        else if (ClientMode < scContact) and (cGov <> gAnarchy) and
Note: See TracChangeset for help on using the changeset viewer.