Changeset 349 for branches/highdpi/LocalPlayer/Battle.pas
- Timestamp:
- Apr 6, 2021, 8:11:02 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/LocalPlayer/Battle.pas
r210 r349 6 6 uses 7 7 UDpiControls, 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: TDpiCanvas; 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: TDpiCanvas; 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: TDpiCanvas; xm, ym, uix, ToLoc: Integer;55 procedure TBattleDlg.PaintBattleOutcome(ca: TDpiCanvas; xm, ym, uix, ToLoc: Integer; 51 56 Forecast: TBattleForecastEx); 52 57 var … … 108 113 FanaticColor); 109 114 DpiBitCanvas(ca, xm - 12, ym - 12, 24, 24, 110 GrExt[HGrSystem].Mask.Canvas, 26, 146, SRCAND);115 HGrSystem.Mask.Canvas, 26, 146, SRCAND); 111 116 DpiBitCanvas(ca, xm - 12, ym - 12, 24, 24, 112 GrExt[HGrSystem].Data.Canvas, 26, 146, SRCPAINT);117 HGrSystem.Data.Canvas, 26, 146, SRCPAINT); 113 118 114 119 LabelText := Format('%d', [Forecast.AStr]); … … 133 138 begin 134 139 DpiBitCanvas(ca, xm + 9 + LDDamage - 7, ym - 6, 14, 17, 135 GrExt[HGrSystem].Mask.Canvas, 51, 153, SRCAND);140 HGrSystem.Mask.Canvas, 51, 153, SRCAND); 136 141 DpiBitCanvas(ca, xm + 8 + LDDamage - 7, ym - 7, 14, 17, 137 GrExt[HGrSystem].Mask.Canvas, 51, 153, SRCAND);142 HGrSystem.Mask.Canvas, 51, 153, SRCAND); 138 143 DpiBitCanvas(ca, xm + 8 + LDDamage - 7, ym - 7, 14, 17, 139 GrExt[HGrSystem].Data.Canvas, 51, 153, SRCPAINT);144 HGrSystem.Data.Canvas, 51, 153, SRCPAINT); 140 145 end; 141 146 LabelText := Format('%d', [DDamage]); … … 153 158 begin 154 159 DpiBitCanvas(ca, xm - 6, ym + 9 + LADamage - 7, 14, 17, 155 GrExt[HGrSystem].Mask.Canvas, 51, 153, SRCAND);160 HGrSystem.Mask.Canvas, 51, 153, SRCAND); 156 161 DpiBitCanvas(ca, xm - 7, ym + 8 + LADamage - 7, 14, 17, 157 GrExt[HGrSystem].Mask.Canvas, 51, 153, SRCAND);162 HGrSystem.Mask.Canvas, 51, 153, SRCAND); 158 163 DpiBitCanvas(ca, xm - 7, ym + 8 + LADamage - 7, 14, 17, 159 GrExt[HGrSystem].Data.Canvas, 51, 153, SRCPAINT);164 HGrSystem.Data.Canvas, 51, 153, SRCPAINT); 160 165 end; 161 166 LabelText := Format('%d', [MyUn[uix].Health - Forecast.EndHealthAtt]); … … 172 177 (LADamage - LAAvoidedDamage - TextSize.cy) div 2, LabelText); 173 178 174 NoMap.SetOutput(Buffer);179 IsoMap.SetOutput(Buffer); 175 180 DpiBitCanvas(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 DpiBitCanvas(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 DpiBitCanvas(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.