Changeset 330 for trunk/LocalPlayer/Battle.pas
- Timestamp:
- Mar 26, 2021, 2:16:04 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Battle.pas
r313 r330 6 6 uses 7 7 ScreenTools, Protocol, ButtonBase, ButtonA, Types, LCLIntf, LCLType, 8 SysUtils, Classes, Graphics, Controls, Forms, DrawDlg ;8 SysUtils, Classes, Graphics, Controls, Forms, DrawDlg, IsoEngine; 9 9 10 10 type 11 12 { TBattleDlg } 13 11 14 TBattleDlg = class(TDrawDlg) 12 15 OKBtn: TButtonA; 13 16 CancelBtn: TButtonA; 17 procedure FormDestroy(Sender: TObject); 14 18 procedure FormPaint(Sender: TObject); 15 19 procedure FormMouseDown(Sender: TObject; Button: TMouseButton; … … 21 25 procedure OKBtnClick(Sender: TObject); 22 26 procedure CancelBtnClick(Sender: TObject); 27 procedure PaintBattleOutcome(ca: TCanvas; xm, ym, uix, ToLoc: Integer; 28 Forecast: TBattleForecastEx); 29 private 30 IsoMap: TIsoMap; 23 31 public 24 32 uix, ToLoc: Integer; … … 30 38 BattleDlg: TBattleDlg; 31 39 32 procedure PaintBattleOutcome(ca: TCanvas; xm, ym, uix, ToLoc: Integer;33 Forecast: TBattleForecastEx);34 35 40 implementation 36 41 37 42 uses 38 Term, ClientTools , IsoEngine;43 Term, ClientTools; 39 44 40 45 {$R *.lfm} … … 48 53 FirstStrikeColor = $A0A0A0; 49 54 50 procedure PaintBattleOutcome(ca: TCanvas; xm, ym, uix, ToLoc: Integer;55 procedure TBattleDlg.PaintBattleOutcome(ca: TCanvas; xm, ym, uix, ToLoc: Integer; 51 56 Forecast: TBattleForecastEx); 52 57 var … … 172 177 (LADamage - LAAvoidedDamage - TextSize.cy) div 2, LabelText); 173 178 174 NoMap.SetOutput(Buffer);179 IsoMap.SetOutput(Buffer); 175 180 BitBltCanvas(Buffer.Canvas, 0, 0, 66, 48, ca, xm + 8 + 4, 176 181 ym - 8 - 12 - 48); … … 184 189 else Sprite(Buffer,HGrTerrain,0,16,66,32,1+7*(xxt*2+1),1+yyt+2*(2+TerrType-fForest)*(yyt*3+1)); 185 190 end; } 186 NoMap.PaintUnit(1, 0, UnitInfo, 0);191 IsoMap.PaintUnit(1, 0, UnitInfo, 0); 187 192 BitBltCanvas(ca, xm + 8 + 4, ym - 8 - 12 - 48, 66, 48, Buffer.Canvas, 188 193 0, 0); … … 192 197 MakeUnitInfo(me, MyUn[uix], UnitInfo); 193 198 UnitInfo.Flags := UnitInfo.Flags and not unFortified; 194 NoMap.PaintUnit(1, 0, UnitInfo, 0);199 IsoMap.PaintUnit(1, 0, UnitInfo, 0); 195 200 BitBltCanvas(ca, xm - 8 - 4 - 66, ym + 8 + 12, 66, 48, Buffer.Canvas, 0, 0); 196 201 end; { PaintBattleOutcome } … … 198 203 procedure TBattleDlg.FormCreate(Sender: TObject); 199 204 begin 205 IsoMap := TIsoMap.Create; 200 206 OKBtn.Caption := Phrases.Lookup('BTN_YES'); 201 207 CancelBtn.Caption := Phrases.Lookup('BTN_NO'); … … 276 282 end; 277 283 284 procedure TBattleDlg.FormDestroy(Sender: TObject); 285 begin 286 FreeAndNil(IsoMap); 287 end; 288 278 289 procedure TBattleDlg.FormMouseDown(Sender: TObject; Button: TMouseButton; 279 290 Shift: TShiftState; X, Y: Integer);
Note:
See TracChangeset
for help on using the changeset viewer.