Changeset 465 for branches/highdpi/LocalPlayer/Battle.pas
- Timestamp:
- Nov 30, 2023, 10:16:14 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/LocalPlayer/Battle.pas
r361 r465 32 32 uix, ToLoc: Integer; 33 33 Forecast: TBattleForecastEx; 34 IsSuicideQuery: boolean; 35 end; 36 37 var 38 BattleDlg: TBattleDlg; 34 IsSuicideQuery: Boolean; 35 end; 36 39 37 40 38 implementation … … 62 60 TextSize: TSize; 63 61 LabelText: string; 64 FirstStrike: boolean;62 FirstStrike: Boolean; 65 63 begin 66 64 MaxBar := 65; … … 112 110 VLightGradient(ca, xm - 8, ym + 8 + LABaseDamage, LADamage - LABaseDamage, 113 111 FanaticColor); 114 DpiBit Canvas(ca, xm - 12, ym - 12, 24, 24,112 DpiBitBltCanvas(ca, xm - 12, ym - 12, 24, 24, 115 113 HGrSystem.Mask.Canvas, 26, 146, SRCAND); 116 DpiBit Canvas(ca, xm - 12, ym - 12, 24, 24,114 DpiBitBltCanvas(ca, xm - 12, ym - 12, 24, 24, 117 115 HGrSystem.Data.Canvas, 26, 146, SRCPAINT); 118 116 … … 137 135 if Forecast.EndHealthDef <= 0 then 138 136 begin 139 DpiBit Canvas(ca, xm + 9 + LDDamage - 7, ym - 6, 14, 17,137 DpiBitBltCanvas(ca, xm + 9 + LDDamage - 7, ym - 6, 14, 17, 140 138 HGrSystem.Mask.Canvas, 51, 153, SRCAND); 141 DpiBit Canvas(ca, xm + 8 + LDDamage - 7, ym - 7, 14, 17,139 DpiBitBltCanvas(ca, xm + 8 + LDDamage - 7, ym - 7, 14, 17, 142 140 HGrSystem.Mask.Canvas, 51, 153, SRCAND); 143 DpiBit Canvas(ca, xm + 8 + LDDamage - 7, ym - 7, 14, 17,141 DpiBitBltCanvas(ca, xm + 8 + LDDamage - 7, ym - 7, 14, 17, 144 142 HGrSystem.Data.Canvas, 51, 153, SRCPAINT); 145 143 end; … … 149 147 begin 150 148 if Forecast.EndHealthDef > 0 then 151 RisedTextOut(ca, xm + 10, ym - (TextSize.cy + 1) div 2, LabelText) 149 RisedTextOut(ca, xm + 10, ym - (TextSize.cy + 1) div 2, LabelText); 152 150 end 153 151 else … … 157 155 if Forecast.EndHealthAtt <= 0 then 158 156 begin 159 DpiBit Canvas(ca, xm - 6, ym + 9 + LADamage - 7, 14, 17,157 DpiBitBltCanvas(ca, xm - 6, ym + 9 + LADamage - 7, 14, 17, 160 158 HGrSystem.Mask.Canvas, 51, 153, SRCAND); 161 DpiBit Canvas(ca, xm - 7, ym + 8 + LADamage - 7, 14, 17,159 DpiBitBltCanvas(ca, xm - 7, ym + 8 + LADamage - 7, 14, 17, 162 160 HGrSystem.Mask.Canvas, 51, 153, SRCAND); 163 DpiBit Canvas(ca, xm - 7, ym + 8 + LADamage - 7, 14, 17,161 DpiBitBltCanvas(ca, xm - 7, ym + 8 + LADamage - 7, 14, 17, 164 162 HGrSystem.Data.Canvas, 51, 153, SRCPAINT); 165 163 end; … … 171 169 if Forecast.EndHealthAtt > 0 then 172 170 RisedTextOut(ca, xm - (TextSize.cx + 1) div 2, ym + 8 + LAAvoidedDamage, 173 LabelText) 171 LabelText); 174 172 end 175 173 else … … 178 176 179 177 IsoMap.SetOutput(Buffer); 180 DpiBit Canvas(Buffer.Canvas, 0, 0, 66, 48, ca, xm + 8 + 4,178 DpiBitBltCanvas(Buffer.Canvas, 0, 0, 66, 48, ca, xm + 8 + 4, 181 179 ym - 8 - 12 - 48); 182 180 { if TerrType<fForest then … … 190 188 end; } 191 189 IsoMap.PaintUnit(1, 0, UnitInfo, 0); 192 DpiBit Canvas(ca, xm + 8 + 4, ym - 8 - 12 - 48, 66, 48, Buffer.Canvas,190 DpiBitBltCanvas(ca, xm + 8 + 4, ym - 8 - 12 - 48, 66, 48, Buffer.Canvas, 193 191 0, 0); 194 192 195 DpiBit Canvas(Buffer.Canvas, 0, 0, 66, 48, ca, xm - 8 - 4 - 66,193 DpiBitBltCanvas(Buffer.Canvas, 0, 0, 66, 48, ca, xm - 8 - 4 - 66, 196 194 ym + 8 + 12); 197 MakeUnitInfo( me, MyUn[uix], UnitInfo);195 MakeUnitInfo(Me, MyUn[uix], UnitInfo); 198 196 UnitInfo.Flags := UnitInfo.Flags and not unFortified; 199 197 IsoMap.PaintUnit(1, 0, UnitInfo, 0); 200 DpiBit Canvas(ca, xm - 8 - 4 - 66, ym + 8 + 12, 66, 48, Buffer.Canvas, 0, 0);201 end; { PaintBattleOutcome }198 DpiBitBltCanvas(ca, xm - 8 - 4 - 66, ym + 8 + 12, 66, 48, Buffer.Canvas, 0, 0); 199 end; 202 200 203 201 procedure TBattleDlg.FormCreate(Sender: TObject); … … 215 213 ClientWidth := 300; 216 214 ClientHeight := 288; 217 OKBtn.Visible := true;218 CancelBtn.Visible := true;215 OKBtn.Visible := True; 216 CancelBtn.Visible := True; 219 217 Left := (DpiScreen.Width - ClientWidth) div 2; // center on screen 220 218 Top := (DpiScreen.Height - ClientHeight) div 2; … … 224 222 ClientWidth := 178; 225 223 ClientHeight := 178; 226 OKBtn.Visible := false;227 CancelBtn.Visible := false;224 OKBtn.Visible := False; 225 CancelBtn.Visible := False; 228 226 end; 229 227 end; … … 231 229 procedure TBattleDlg.FormPaint(Sender: TObject); 232 230 var 233 ym, cix, p: Integer;234 s, s1: string;231 ym, cix, P: Integer; 232 S, s1: string; 235 233 begin 236 234 with Canvas do … … 240 238 Brush.Style := bsClear; 241 239 PaintBackground(self, 3 + Border, 3 + Border, 242 ClientWidth - (6 + 2 * Border), ClientHeight - (6 + 2 * Border)) 240 ClientWidth - (6 + 2 * Border), ClientHeight - (6 + 2 * Border)); 243 241 end; 244 242 Frame(Canvas, Border + 1, Border + 1, ClientWidth - (2 + Border), … … 252 250 begin 253 251 Canvas.Font.Assign(UniFont[ftCaption]); 254 s:= Phrases.Lookup('TITLE_SUICIDE');255 RisedTextOut(Canvas, (ClientWidth - BiColorTextWidth(Canvas, s)) div 2,256 7 + Border, s);252 S := Phrases.Lookup('TITLE_SUICIDE'); 253 RisedTextOut(Canvas, (ClientWidth - BiColorTextWidth(Canvas, S)) div 2, 254 7 + Border, S); 257 255 Canvas.Font.Assign(UniFont[ftNormal]); 258 s:= Phrases.Lookup('SUICIDE');259 p := pos('\', s);260 if p= 0 then261 RisedTextOut(Canvas, (ClientWidth - BiColorTextWidth(Canvas, s))262 div 2, 205, s)256 S := Phrases.Lookup('SUICIDE'); 257 P := Pos('\', S); 258 if P = 0 then 259 RisedTextOut(Canvas, (ClientWidth - BiColorTextWidth(Canvas, S)) 260 div 2, 205, S) 263 261 else 264 262 begin 265 s1 := copy(s, 1, p- 1);263 s1 := Copy(S, 1, P - 1); 266 264 RisedTextOut(Canvas, (ClientWidth - BiColorTextWidth(Canvas, s1)) div 2, 267 265 205 - MessageLineSpacing div 2, s1); 268 s1 := copy(s, p+ 1, 255);266 s1 := Copy(S, P + 1, 255); 269 267 RisedTextOut(Canvas, (ClientWidth - BiColorTextWidth(Canvas, s1)) div 2, 270 268 205 + (MessageLineSpacing - MessageLineSpacing div 2), s1); 271 269 end; 272 ym := 110 270 ym := 110; 273 271 end 274 272 else … … 297 295 begin 298 296 if not IsSuicideQuery then 299 Close 297 Close; 300 298 end; 301 299 … … 309 307 if Key <> VK_ESCAPE then 310 308 MainScreen.FormKeyDown(Sender, Key, Shift); 311 end 309 end; 312 310 end; 313 311
Note:
See TracChangeset
for help on using the changeset viewer.