Changeset 325
- Timestamp:
- Mar 23, 2021, 10:49:30 PM (4 years ago)
- Location:
- trunk/LocalPlayer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/CityScreen.pas
r324 r325 5 5 6 6 uses 7 {$IFDEF LINUX} 8 LMessages, 9 {$ENDIF} 7 {$IFDEF LINUX}LMessages,{$ENDIF} 10 8 Protocol, ClientTools, Term, ScreenTools, IsoEngine, BaseWin, 11 9 LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls, … … 53 51 procedure PageUpBtnClick(Sender: TObject); 54 52 procedure PageDownBtnClick(Sender: TObject); 55 53 private 54 c: TCity; 55 Report: TCityReportNew; 56 cOwner: Integer; 57 cGov: Integer; 58 emix: Integer; { enemy model index of produced unit } 59 cix: Integer; 60 cLoc: Integer; 61 Mode: Integer; 62 ZoomArea: Integer; 63 Page: Integer; 64 PageCount: Integer; 65 BlinkTime: Integer; 66 OpenSoundEvent: Integer; 67 SizeClass: Integer; 68 AgePrepared: Integer; 69 Optimize_cixTileChange: Integer; 70 Optimize_TilesBeforeChange: Integer; 71 Happened: cardinal; 72 imix: array [0 .. 15] of integer; 73 CityAreaInfo: TCityAreaInfo; 74 AreaMap: TIsoMap; 75 CityMapTemplate: TBitmap; 76 SmallCityMapTemplate: TBitmap; 77 Back: TBitmap; 78 SmallCityMap: TBitmap; 79 ZoomCityMap: TBitmap; 80 Template: TBitmap; 81 IsPort: Boolean; 82 ProdHint: Boolean; 83 AllowChange: Boolean; 84 procedure InitSmallCityMap; 85 procedure InitZoomCityMap; 86 procedure ChooseProject; 87 procedure ChangeCity(d: integer); 88 procedure ChangeResourceWeights(iResourceWeights: integer); 89 procedure OnPlaySound(var Msg: TMessage); message WM_PLAYSOUND; 56 90 public 57 91 RestoreUnFocus: integer; … … 61 95 procedure Reset; 62 96 procedure CheckAge; 63 64 private65 c: TCity;66 Report: TCityReportNew;67 cOwner, cGov, emix { enemy model index of produced unit } , cix, cLoc, Mode,68 ZoomArea, Page, PageCount, BlinkTime, OpenSoundEvent, SizeClass,69 AgePrepared: integer;70 Optimize_cixTileChange, Optimize_TilesBeforeChange: integer;71 Happened: cardinal;72 imix: array [0 .. 15] of integer;73 CityAreaInfo: TCityAreaInfo;74 AreaMap: TIsoMap;75 CityMapTemplate, SmallCityMapTemplate, Back, SmallCityMap, ZoomCityMap,76 Template: TBitmap;77 IsPort, ProdHint, AllowChange: boolean;78 procedure InitSmallCityMap;79 procedure InitZoomCityMap;80 procedure ChooseProject;81 procedure ChangeCity(d: integer);82 procedure ChangeResourceWeights(iResourceWeights: integer);83 procedure OnPlaySound(var Msg: TMessage); message WM_PLAYSOUND;84 97 end; 85 98 … … 87 100 CityDlg: TCityDlg; 88 101 102 89 103 implementation 90 104 91 105 uses 92 Select, Messg, MessgEx, Help, Tribes, Directories, Math, UPixelPointer,Sound;106 Select, Messg, MessgEx, Help, Tribes, Directories, Math, Sound; 93 107 94 108 {$R *.lfm} … … 278 292 c := MyCity[cix]; 279 293 case MyMap[cLoc] and fTerrain of 280 fPrairie: 281 cli1 := cliPrairie; 282 fHills: 283 cli1 := cliHills; 284 fTundra: 285 cli1 := cliTundra; 294 fPrairie: cli1 := cliPrairie; 295 fHills: cli1 := cliHills; 296 fTundra: cli1 := cliTundra; 286 297 else 287 298 cli1 := cliPlains; … … 1340 1351 not csResourceWeightsMask; // off 1341 1352 c.Status := MyCity[cix].Status; 1342 SmartUpdateContent 1353 SmartUpdateContent; 1343 1354 end; 1344 1355 exit; … … 1737 1748 begin 1738 1749 dec(Page); 1739 SmartUpdateContent 1750 SmartUpdateContent; 1740 1751 end; 1741 1752 end; … … 1746 1757 begin 1747 1758 inc(Page); 1748 SmartUpdateContent 1759 SmartUpdateContent; 1749 1760 end; 1750 1761 end; -
trunk/LocalPlayer/IsoEngine.pas
r324 r325 15 15 TIsoMap = class 16 16 private 17 const 18 Dirx: array [0..7] of Integer = (1, 2, 1, 0, -1, -2, -1, 0); 19 Diry: array [0..7] of Integer = (-1, 0, 1, 2, 1, 0, -1, -2); 17 20 procedure CityGrid(xm, ym: integer; CityAllowClick: Boolean); 18 21 function IsShoreTile(Loc: integer): boolean; … … 753 756 (MyMap[dLoc(Loc, -2, 2)] and fObserved <> 0) and 754 757 (MyMap[dLoc(Loc, 2, 2)] and fObserved <> 0) then 755 result := result or fObserved 758 result := result or fObserved; 756 759 end 757 760 else if Loc < 0 then … … 762 765 if (MyMap[dLoc(Loc, -1, 1)] and fObserved <> 0) and 763 766 (MyMap[dLoc(Loc, 1, 1)] and fObserved <> 0) then 764 result := result or fObserved 767 result := result or fObserved; 765 768 end 766 769 else if Loc < G.lx * (G.ly + 1) then … … 771 774 if (MyMap[dLoc(Loc, -1, -1)] and fObserved <> 0) and 772 775 (MyMap[dLoc(Loc, 1, -1)] and fObserved <> 0) then 773 result := result or fObserved 776 result := result or fObserved; 774 777 end 775 778 else if Loc < G.lx * (G.ly + 2) then … … 782 785 (MyMap[dLoc(Loc, -2, -2)] and fObserved <> 0) and 783 786 (MyMap[dLoc(Loc, 2, -2)] and fObserved <> 0) then 784 result := result or fObserved 785 end 786 end; 787 788 const 789 Dirx: array [0 .. 7] of integer = (1, 2, 1, 0, -1, -2, -1, 0); 790 Diry: array [0 .. 7] of integer = (-1, 0, 1, 2, 1, 0, -1, -2); 787 result := result or fObserved; 788 end; 789 end; 791 790 792 791 function TIsoMap.Connection4(Loc, Mask, Value: integer): integer; … … 811 810 function TIsoMap.Connection8(Loc, Mask: integer): integer; 812 811 var 813 Dir, ConnLoc: integer; 812 Dir: Integer; 813 ConnLoc: Integer; 814 814 begin 815 815 result := 0; … … 825 825 function TIsoMap.OceanConnection(Loc: integer): integer; 826 826 var 827 Dir, ConnLoc: integer; 827 Dir: Integer; 828 ConnLoc: Integer; 828 829 begin 829 830 result := 0; … … 839 840 procedure TIsoMap.PaintShore(x, y, Loc: integer); 840 841 var 841 Conn, Tile: integer; 842 Conn: Integer; 843 Tile: Integer; 842 844 begin 843 845 if (y <= FTop - yyt * 2) or (y > FBottom) or (x <= FLeft - xxt * 2) or … … 1333 1335 1334 1336 function TIsoMap.IsShoreTile(Loc: integer): boolean; 1335 const 1336 Dirx: array [0 .. 7] of integer = (1, 2, 1, 0, -1, -2, -1, 0); 1337 Diry: array [0 .. 7] of integer = (-1, 0, 1, 2, 1, 0, -1, -2); 1338 var 1339 Dir, ConnLoc: integer; 1337 var 1338 Dir: Integer; 1339 ConnLoc: integer; 1340 1340 begin 1341 1341 result := false; … … 1345 1345 if (ConnLoc < 0) or (ConnLoc >= G.lx * G.ly) or 1346 1346 ((MyMap[ConnLoc] - 2) and fTerrain < 13) then 1347 result := true 1348 end 1347 result := true; 1348 end; 1349 1349 end; 1350 1350 -
trunk/LocalPlayer/Term.pas
r321 r325 224 224 procedure MovieSpeedBtnClick(Sender: TObject); 225 225 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; 230 252 BrushType: Cardinal; 231 trix: array [0 .. 63] of integer;253 trix: array [0 .. 63] of Integer; 232 254 AILogo: array [0 .. nPl - 1] of TBitmap; 233 Mini, Panel, TopBar: TBitmap; 255 Mini: TBitmap; 256 Panel: TBitmap; 257 TopBar: TBitmap; 234 258 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; 237 267 PrevWindowState: TWindowState; 238 268 CurrentWindowState: TWindowState; … … 322 352 end; 323 353 324 TPriceSet = Set of $00 .. $FF;354 TPriceSet = set of $00 .. $FF; 325 355 326 356 const … … 416 446 sbAll = $FF; 417 447 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)); 419 450 420 451 type … … 432 463 ToldWonders: array [0 .. 27] of TWonderInfo; 433 464 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; 434 474 end; 435 475 … … 468 508 TribeOriginal: array [0 .. nPl - 1] of Boolean; 469 509 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; 478 511 479 512 function CityEventName(i: integer): string; … … 4189 4222 Brush.Style := bsClear; 4190 4223 OffscreenUser := self; 4191 exit 4224 exit; 4192 4225 end; 4193 4226 … … 4214 4247 offscreen.Canvas.Font.Assign(UniFont[ftSmall]); 4215 4248 ProcessRect(xw, yw, MapWidth div xxt, MapHeight div yyt, 4216 prPaint or prInvalidate) 4249 prPaint or prInvalidate); 4217 4250 end 4218 4251 else … … 4285 4318 TopBarHeight + MapHeight - overlap); 4286 4319 RectInvalidate(xMidPanel, TopBarHeight + MapHeight - overlap, xRightPanel, 4287 TopBarHeight + MapHeight) 4320 TopBarHeight + MapHeight); 4288 4321 end; 4289 4322 // if (xwd<>xw) or (ywd<>yw) then … … 4953 4986 end; 4954 4987 RectInvalidate(0, 0, ClientWidth, TopBarHeight); 4955 end; { PanelPaint }4988 end; 4956 4989 4957 4990 procedure TMainScreen.FocusOnLoc(Loc: integer; Options: integer = 0); … … 4968 5001 begin 4969 5002 Centre(Loc); 4970 PaintAllMaps 5003 PaintAllMaps; 4971 5004 end 4972 5005 else if not MapValid then … … 5003 5036 begin 5004 5037 NewFocus := uix; 5005 Break 5038 Break; 5006 5039 end 5007 5040 else … … 5011 5044 begin 5012 5045 NewFocus := uix; 5013 Dist := TestDist 5014 end 5015 end 5046 Dist := TestDist; 5047 end; 5048 end; 5016 5049 end; 5017 5050 if GotoOnly then … … 5043 5076 PanelPaint; 5044 5077 end; 5045 end; { NextUnit }5078 end; 5046 5079 5047 5080 procedure TMainScreen.Scroll(dx, dy: integer); … … 5083 5116 PaintLocTemp(MyUn[UnFocus].Loc) 5084 5117 else if TurnComplete and not supervising then 5085 EOT.SetButtonIndexFast(eotBlinkOn) 5086 end 5118 EOT.SetButtonIndexFast(eotBlinkOn); 5119 end; 5087 5120 end 5088 5121 else … … 5113 5146 Screen.ActiveForm.OnDeactivate(nil); 5114 5147 Scroll(dx, dy); 5115 end 5148 end; 5116 5149 end; 5117 5150 … … 5134 5167 EOT.SetButtonIndexFast(eotBlinkOff) 5135 5168 else if BlinkTime = BlinkOffTime then 5136 EOT.SetButtonIndexFast(eotBlinkOn) 5137 end 5138 end 5169 EOT.SetButtonIndexFast(eotBlinkOn); 5170 end; 5171 end; 5139 5172 end; 5140 5173 … … 5155 5188 else if yw > ywmax then 5156 5189 yw := ywmax; 5157 end 5190 end; 5158 5191 end; 5159 5192
Note:
See TracChangeset
for help on using the changeset viewer.