Changeset 709 for trunk/LocalPlayer/Battle.pas
- Timestamp:
- Aug 21, 2025, 11:37:30 PM (5 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Battle.pas
r622 r709 66 66 MaxBar := 65; 67 67 68 // TerrType :=MyMap[ToLoc] and fTerrain;68 // TerrType := MyMap[ToLoc] and fTerrain; 69 69 GetUnitInfo(ToLoc, euix, UnitInfo); 70 70 … … 171 171 UnshareBitmap(Buffer); 172 172 BitBltCanvas(Buffer.Canvas, 0, 0, 66, 48, ca, xm + 8 + 4, ym - 8 - 12 - 48); 173 { if TerrType <fForest then174 Sprite(Buffer, HGrTerrain,0,16,66,32,1+TerrType*(xxt*2+1),1+yyt)173 { if TerrType < fForest then 174 Sprite(Buffer, HGrTerrain, 0, 16, 66, 32, 1 + TerrType * (xxt * 2 + 1), 1 + yyt) 175 175 else 176 176 begin 177 Sprite(Buffer,HGrTerrain,0,16,66,32,1+2*(xxt*2+1),1+yyt+2*(yyt*3+1));178 if (TerrType=fForest) and IsJungle(ToLoc div G.lx) then179 Sprite(Buffer,HGrTerrain,0,16,66,32,1+7*(xxt*2+1),1+yyt+19*(yyt*3+1))180 else Sprite(Buffer,HGrTerrain,0,16,66,32,1+7*(xxt*2+1),1+yyt+2*(2+TerrType-fForest)*(yyt*3+1));177 Sprite(Buffer, HGrTerrain, 0, 16, 66, 32, 1 + 2 * (xxt * 2 + 1), 1 + yyt + 2 * (yyt * 3 + 1)); 178 if (TerrType = fForest) and IsJungle(ToLoc div G.lx) then 179 Sprite(Buffer, HGrTerrain, 0, 16, 66, 32, 1 + 7 * (xxt * 2 + 1), 1+ yyt + 19 * (yyt * 3 + 1)) 180 else Sprite(Buffer, HGrTerrain, 0, 16, 66, 32, 1 + 7 * (xxt * 2 + 1), 1 + yyt + 2 * (2 + TerrType - fForest) * (yyt * 3 + 1)); 181 181 end; } 182 182 IsoMap.PaintUnit(1, 0, UnitInfo, 0); … … 201 201 procedure TBattleDlg.FormShow(Sender: TObject); 202 202 begin 203 if IsSuicideQuery then 204 begin 205 ClientWidth := 300; 206 ClientHeight := 288; 203 if IsSuicideQuery then begin 204 BoundsRect := Bounds(0, 0, 300, 288); 207 205 OKBtn.Visible := True; 208 206 CancelBtn.Visible := True; 209 207 CenterToScreen; 210 end 211 else 212 begin 213 ClientWidth := 178; 214 ClientHeight := 178; 208 end else begin 209 BoundsRect := Bounds(0, 0, 178, 178); 215 210 OKBtn.Visible := False; 216 211 CancelBtn.Visible := False; … … 226 221 begin 227 222 Brush.Color := 0; 228 FillRect(Rect(0, 0, ClientWidth, ClientHeight));223 FillRect(Rect(0, 0, Width, Height)); 229 224 Brush.Style := TBrushStyle.bsClear; 230 225 PaintBackground(Canvas, 3 + Border, 3 + Border, 231 ClientWidth - (6 + 2 * Border), ClientHeight - (6 + 2 * Border),232 ClientWidth, ClientHeight);233 end; 234 Frame(Canvas, Border + 1, Border + 1, ClientWidth - (2 + Border),235 ClientHeight - (2 + Border), MainTexture.ColorBevelLight,226 Width - (6 + 2 * Border), Height - (6 + 2 * Border), 227 Width, Height); 228 end; 229 Frame(Canvas, Border + 1, Border + 1, Width - (2 + Border), 230 Height - (2 + Border), MainTexture.ColorBevelLight, 236 231 MainTexture.ColorBevelShade); 237 Frame(Canvas, 2 + Border, 2 + Border, ClientWidth - (3 + Border),238 ClientHeight - (3 + Border), MainTexture.ColorBevelLight,232 Frame(Canvas, 2 + Border, 2 + Border, Width - (3 + Border), 233 Height - (3 + Border), MainTexture.ColorBevelLight, 239 234 MainTexture.ColorBevelShade); 240 235 … … 243 238 Canvas.Font.Assign(UniFont[ftCaption]); 244 239 S := Phrases.Lookup('TITLE_SUICIDE'); 245 RisedTextOut(Canvas, ( ClientWidth - BiColorTextWidth(Canvas, S)) div 2,240 RisedTextOut(Canvas, (Width - BiColorTextWidth(Canvas, S)) div 2, 246 241 7 + Border, S); 247 242 Canvas.Font.Assign(UniFont[ftNormal]); … … 249 244 P := Pos('\', S); 250 245 if P = 0 then 251 RisedTextOut(Canvas, (ClientWidth - BiColorTextWidth(Canvas, S)) 252 div 2, 205, S) 246 RisedTextOut(Canvas, (Width - BiColorTextWidth(Canvas, S)) div 2, 205, S) 253 247 else 254 248 begin 255 249 s1 := Copy(S, 1, P - 1); 256 RisedTextOut(Canvas, ( ClientWidth - BiColorTextWidth(Canvas, s1)) div 2,250 RisedTextOut(Canvas, (Width - BiColorTextWidth(Canvas, s1)) div 2, 257 251 205 - MessageLineSpacing div 2, s1); 258 252 s1 := Copy(S, P + 1, 255); 259 RisedTextOut(Canvas, ( ClientWidth - BiColorTextWidth(Canvas, s1)) div 2,253 RisedTextOut(Canvas, (Width - BiColorTextWidth(Canvas, s1)) div 2, 260 254 205 + (MessageLineSpacing - MessageLineSpacing div 2), s1); 261 255 end; … … 263 257 end 264 258 else 265 ym := ClientHeight div 2;259 ym := Height div 2; 266 260 Canvas.Font.Assign(UniFont[ftSmall]); 267 PaintBattleOutcome(Canvas, ClientWidth div 2, ym, uix, ToLoc, Forecast);261 PaintBattleOutcome(Canvas, Width div 2, ym, uix, ToLoc, Forecast); 268 262 269 263 for cix := 0 to ControlCount - 1 do … … 293 287 Shift: TShiftState); 294 288 begin 289 if Key = VK_RETURN then OKBtnClick(Self) 290 else 295 291 if not IsSuicideQuery and (Key <> VK_SHIFT) then 296 292 begin
Note:
See TracChangeset
for help on using the changeset viewer.