Changeset 417 for trunk/LocalPlayer/CityScreen.pas
- Timestamp:
- Nov 17, 2021, 11:11:01 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/CityScreen.pas
r380 r417 93 93 procedure OnPlaySound(var Msg: TMessage); message WM_PLAYSOUND; 94 94 public 95 RestoreUnFocus: integer;95 RestoreUnFocus: Integer; 96 96 CloseAction: TCityCloseAction; 97 97 procedure OffscreenPaint; override; … … 148 148 wZoomEnvironment = 68; 149 149 150 ImpPosition: array [28 .. nImp - 1] of integer = (-1, // imTrGoods 150 ImpPosition: array [28 .. nImp - 1] of Integer = ( 151 -1, // imTrGoods 151 152 21, // imBarracks 152 153 6, // imGranary … … 192 193 193 194 var 194 ImpSorted: array [0 .. nImp - 1] of integer;195 ImpSorted: array [0 .. nImp - 1] of Integer; 195 196 196 197 procedure TCityDlg.FormCreate(Sender: TObject); … … 206 207 SmallMapMode := smImprovements; 207 208 ZoomArea := 1; 208 ProdHint := false;209 ProdHint := False; 209 210 RestoreUnFocus := -1; 210 211 OpenSoundEvent := -1; … … 489 490 var 490 491 x, y, xGr, i, j, iix, d, dx, dy, PrCost, Cnt, Loc1, FreeSupp, Paintiix, 491 HappyGain, OptiType, rx, ry, TrueFood, TrueProd, TruePoll: integer;492 av: integer;492 HappyGain, OptiType, rx, ry, TrueFood, TrueProd, TruePoll: Integer; 493 av: Integer; 493 494 PrName, s: string; 494 495 UnitInfo: TUnitInfo; 495 496 UnitReport: TUnitReport; 496 IsCityAlive, CanGrow: boolean;497 IsCityAlive, CanGrow: Boolean; 497 498 begin 498 499 inherited; … … 509 510 TrueProd := c.Prod; 510 511 TruePoll := c.Pollution; 511 if supervising or (cix < 0) then512 if Supervising or (cix < 0) then 512 513 begin // normalize city from after-turn state 513 dec(TrueFood, Report.FoodSurplus);514 Dec(TrueFood, Report.FoodSurplus); 514 515 if TrueFood < 0 then 515 516 TrueFood := 0; // shouldn't happen 516 dec(TrueProd, Report.Production);517 Dec(TrueProd, Report.Production); 517 518 if TrueProd < 0 then 518 519 TrueProd := 0; // shouldn't happen 519 dec(TruePoll, Report.AddPollution);520 Dec(TruePoll, Report.AddPollution); 520 521 if TruePoll < 0 then 521 522 TruePoll := 0; // shouldn't happen … … 534 535 535 536 Offscreen.Canvas.Font.Assign(UniFont[ftCaption]); 536 RisedTextOut( offscreen.Canvas, 42, 7, Caption);537 with offscreen.Canvas do537 RisedTextOut(Offscreen.Canvas, 42, 7, Caption); 538 with Offscreen.Canvas do 538 539 begin // city size 539 brush.Color := $000000;540 Brush.Color := $000000; 540 541 FillRect(Rect(8 + 1, 7 + 1, 36 + 1, 32 + 1)); 541 brush.Color := $FFFFFF;542 Brush.Color := $FFFFFF; 542 543 FillRect(Rect(8, 7, 36, 32)); 543 brush.style := bsClear;544 Brush.style := bsClear; 544 545 Font.Color := $000000; 545 s := inttostr(c.Size);546 TextOut(8 + 14 - textwidth(s) div 2, 7, s);546 s := IntToStr(c.Size); 547 TextOut(8 + 14 - TextWidth(s) div 2, 7, s); 547 548 end; 548 549 Offscreen.Canvas.Font.Assign(UniFont[ftSmall]); … … 959 960 end // unit visible in display 960 961 else 961 dec(FreeSupp, UnitReport.ProdSupport);962 inc(Cnt);962 Dec(FreeSupp, UnitReport.ProdSupport); 963 Inc(Cnt); 963 964 end; 964 965 PageCount := (Cnt + 5) div 6; … … 973 974 PageDownBtn.Visible := PageCount > 1; 974 975 975 with offscreen.Canvas do976 with Offscreen.Canvas do 976 977 begin 977 978 { display project now } … … 1067 1068 end; 1068 1069 1069 NextCityBtn.Visible := false;1070 PrevCityBtn.Visible := false;1070 NextCityBtn.Visible := False; 1071 PrevCityBtn.Visible := False; 1071 1072 end; 1072 1073 Page := 0; … … 1082 1083 1083 1084 // check if port 1084 IsPort := false;1085 IsPort := False; 1085 1086 for dx := -2 to 2 do 1086 1087 for dy := -2 to 2 do 1087 if abs(dx) + abs(dy) = 2 then1088 if Abs(dx) + Abs(dy) = 2 then 1088 1089 begin 1089 1090 Loc1 := dLoc(cLoc, dx, dy); 1090 1091 if (Loc1 >= 0) and (Loc1 < G.lx * G.ly) and 1091 1092 (MyMap[Loc1] and fTerrain < fGrass) then 1092 IsPort := true;1093 IsPort := True; 1093 1094 end; 1094 1095 … … 1105 1106 OpenSoundEvent := -1; 1106 1107 OffscreenPaint; 1107 Timer1.Enabled := true;1108 Timer1.Enabled := True; 1108 1109 end; 1109 1110 … … 1152 1153 InitZoomCityMap; 1153 1154 SmartUpdateContent; 1154 exit;1155 Exit; 1155 1156 end; 1156 1157 if (ssLeft in Shift) and (x >= xSupport) and (x < xSupport + wSupport) and … … 1161 1162 InitZoomCityMap; 1162 1163 SmartUpdateContent; 1163 exit;1164 Exit; 1164 1165 end; 1165 1166 if not AllowChange then 1166 exit; // not an own city1167 Exit; // Not an own city 1167 1168 1168 1169 if (ssLeft in Shift) then … … 1585 1586 procedure TCityDlg.FormClose(Sender: TObject; var Action: TCloseAction); 1586 1587 begin 1587 Timer1.Enabled := false;1588 ProdHint := false;1588 Timer1.Enabled := False; 1589 ProdHint := False; 1589 1590 MarkCityLoc := -1; 1590 1591 if Optimize_cixTileChange >= 0 then … … 1751 1752 if Page > 0 then 1752 1753 begin 1753 dec(Page);1754 Dec(Page); 1754 1755 SmartUpdateContent; 1755 1756 end; … … 1760 1761 if Page < PageCount - 1 then 1761 1762 begin 1762 inc(Page);1763 Inc(Page); 1763 1764 SmartUpdateContent; 1764 1765 end;
Note:
See TracChangeset
for help on using the changeset viewer.