Changeset 717
- Timestamp:
- Jan 10, 2026, 12:15:35 PM (16 hours ago)
- Location:
- branches/zoom
- Files:
-
- 26 edited
-
. (modified) (1 prop)
-
Back.pas (modified) (1 diff)
-
Brain.pas (modified) (1 diff)
-
GameServer.pas (modified) (2 diffs)
-
LocalPlayer/Battle.lfm (modified) (1 prop) ( previous)
-
LocalPlayer/Battle.pas (modified) (8 diffs)
-
LocalPlayer/CityScreen.pas (modified) (1 diff)
-
LocalPlayer/Draft.pas (modified) (6 diffs)
-
LocalPlayer/Help.pas (modified) (1 diff)
-
LocalPlayer/IsoEngine.pas (modified) (2 diffs)
-
LocalPlayer/MessgEx.pas (modified) (1 diff)
-
LocalPlayer/NatStat.pas (modified) (1 diff)
-
LocalPlayer/Nego.lfm (modified) (1 prop) ( previous)
-
LocalPlayer/Select.pas (modified) (1 diff)
-
LocalPlayer/TechTree.pas (modified) (1 diff)
-
LocalPlayer/Term.pas (modified) (5 diffs)
-
LocalPlayer/Tribes.pas (modified) (5 diffs)
-
LocalPlayer/UnitStat.pas (modified) (1 diff)
-
Localization/ru/Language2.txt (modified) (1 prop) ( previous)
-
MiniMap.pas (modified) (6 diffs)
-
Packages/CevoComponents/Directories.pas (modified) (4 diffs)
-
Packages/CevoComponents/ScreenTools.pas (modified) (9 diffs)
-
Packages/CevoComponents/Texture.pas (modified) (1 diff)
-
Packages/DpiControls/Dpi.StdCtrls.pas (modified) (4 diffs)
-
Settings.pas (modified) (2 diffs)
-
Start.pas (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/zoom
-
branches/zoom/Back.pas
r623 r717 66 66 WindowState := TWindowState.wsFullScreen; 67 67 if not Assigned(Img) then begin 68 FileName := GetGraphicsDir + DirectorySeparator + 'Background .png';68 FileName := GetGraphicsDir + DirectorySeparator + 'Background' + PngExt; 69 69 if FileExists(FileName) then begin 70 70 Img := TBitmap.Create; -
branches/zoom/Brain.pas
r679 r717 80 80 TextSize: TSize; 81 81 begin 82 if not LoadGraphicFile(Picture, GetAiDir + DirectorySeparator + FileName + DirectorySeparator + FileName + '.png', [gfNoError]) then begin82 if not LoadGraphicFile(Picture, GetAiDir + DirectorySeparator + FileName + DirectorySeparator + FileName + PngExt, [gfNoError]) then begin 83 83 with Picture.Canvas do begin 84 84 Brush.Color := $904830; -
branches/zoom/GameServer.pas
r683 r717 606 606 end; 607 607 608 ForceDirectories(ExtractFileDir(FileName)); 608 609 if Auto and AutoSaveExists then // append to existing file 609 610 LogFile := TFileStream.Create(FileName, fmOpenReadWrite or fmShareExclusive) … … 3290 3291 Map.MaxTurn := MaxTurn; 3291 3292 Move(RealMap, Map.Tiles[0], MapSize * 4); 3293 ForceDirectories(ExtractFileDir(MapFileName)); 3292 3294 Map.SaveToFile(MapFileName); 3293 3295 FreeAndNil(Map); -
branches/zoom/LocalPlayer/Battle.lfm
- Property svn:mime-type deleted
-
branches/zoom/LocalPlayer/Battle.pas
r622 r717 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 -
branches/zoom/LocalPlayer/CityScreen.pas
r662 r717 231 231 Template := TBitmap.Create; 232 232 Template.PixelFormat := TPixelFormat.pf24bit; 233 LoadGraphicFile(Template, GetGraphicsDir + DirectorySeparator + 'City .png',233 LoadGraphicFile(Template, GetGraphicsDir + DirectorySeparator + 'City' + PngExt, 234 234 [gfNoGamma]); 235 235 CityMapTemplate := TBitmap.Create; 236 236 CityMapTemplate.PixelFormat := TPixelFormat.pf24bit; 237 LoadGraphicFile(CityMapTemplate, GetGraphicsDir + DirectorySeparator + 'BigCityMap .png',237 LoadGraphicFile(CityMapTemplate, GetGraphicsDir + DirectorySeparator + 'BigCityMap' + PngExt, 238 238 [gfNoGamma]); 239 239 SmallCityMapTemplate := TBitmap.Create; 240 240 SmallCityMapTemplate.PixelFormat := TPixelFormat.pf24bit; 241 LoadGraphicFile(SmallCityMapTemplate, GetGraphicsDir + DirectorySeparator + 'SmallCityMap .png',241 LoadGraphicFile(SmallCityMapTemplate, GetGraphicsDir + DirectorySeparator + 'SmallCityMap' + PngExt, 242 242 [gfNoGamma]); 243 243 SmallCityMap := TBitmap.Create; -
branches/zoom/LocalPlayer/Draft.pas
r684 r717 95 95 Template := TBitmap.Create; 96 96 Template.PixelFormat := TPixelFormat.pf24bit; 97 LoadGraphicFile(Template, GetGraphicsDir + DirectorySeparator + 'MiliRes .png',97 LoadGraphicFile(Template, GetGraphicsDir + DirectorySeparator + 'MiliRes' + PngExt, 98 98 [gfNoGamma]); 99 99 end; … … 415 415 procedure TDraftDlg.SetDomain(D: Integer); 416 416 417 function Prio( fix: Integer): Integer;417 function Prio(Fix: Integer): Integer; 418 418 var 419 419 FeaturePreq: Integer; 420 420 begin 421 FeaturePreq := Feature[ fix].Preq;421 FeaturePreq := Feature[Fix].Preq; 422 422 Assert(FeaturePreq <> preNA); 423 if fix < mcFirstNonCap then424 Result := 10000 + fix423 if Fix < mcFirstNonCap then 424 Result := 10000 + Fix 425 425 else if FeaturePreq = preNone then 426 426 Result := 20000 … … 429 429 else 430 430 Result := 30000 + AdvValue[FeaturePreq]; 431 if not ( fix in AutoFeature) then431 if not (Fix in AutoFeature) then 432 432 Inc(Result, 90000); 433 433 end; … … 471 471 begin 472 472 Domain := dGround; 473 while (Domain < dAir) and ( upgrade[Domain, 0].Preq <> preNone) and474 (MyRO.Tech[ upgrade[Domain, 0].Preq] < tsApplicable) do473 while (Domain < dAir) and (Upgrade[Domain, 0].Preq <> preNone) and 474 (MyRO.Tech[Upgrade[Domain, 0].Preq] < tsApplicable) do 475 475 Inc(Domain); 476 476 … … 478 478 MaxLines := 0; 479 479 for D := 0 to nDomains - 1 do 480 if ( upgrade[D, 0].Preq = preNone) or481 (MyRO.Tech[ upgrade[D, 0].Preq] >= tsApplicable) then480 if (Upgrade[D, 0].Preq = preNone) or 481 (MyRO.Tech[Upgrade[D, 0].Preq] >= tsApplicable) then 482 482 begin 483 483 Count := 0; … … 519 519 begin 520 520 for D := 0 to nDomains - 1 do 521 if (D <> Domain) and (( upgrade[D, 0].Preq = preNone) or522 (MyRO.Tech[ upgrade[D, 0].Preq] >= tsApplicable)) and521 if (D <> Domain) and ((Upgrade[D, 0].Preq = preNone) or 522 (MyRO.Tech[Upgrade[D, 0].Preq] >= tsApplicable)) and 523 523 (X >= xDomain + D * DomainPitch) and 524 524 (X < xDomain + D * DomainPitch + 36) and (Y >= yDomain) and -
branches/zoom/LocalPlayer/Help.pas
r684 r717 1071 1071 until (P > Length(S)) or (S[P] = '\'); 1072 1072 if LoadGraphicFile(ExtPic, LocalizedFilePath('Help' + 1073 DirectorySeparator + Copy(S, 2, P - 2) + '.png')) then1073 DirectorySeparator + Copy(S, 2, P - 2) + PngExt)) then 1074 1074 begin 1075 1075 MainText.AddLine('', pkExternal); -
branches/zoom/LocalPlayer/IsoEngine.pas
r608 r717 337 337 IsoMapCache[ATileSize] := TIsoMapCache.Create; 338 338 339 FileName := Format('Terrain%dx%d .png', [xxt * 2, yyt * 2]);339 FileName := Format('Terrain%dx%d' + PngExt, [xxt * 2, yyt * 2]); 340 340 IsoMapCache[ATileSize].HGrTerrain := LoadGraphicSet(FileName); 341 341 if not Assigned(IsoMapCache[ATileSize].HGrTerrain) then … … 343 343 344 344 345 FileName := Format('Cities%dx%d .png', [xxt * 2, yyt * 2]);345 FileName := Format('Cities%dx%d' + PngExt, [xxt * 2, yyt * 2]); 346 346 IsoMapCache[ATileSize].HGrCities := LoadGraphicSet(FileName); 347 347 if not Assigned(IsoMapCache[ATileSize].HGrCities) then -
branches/zoom/LocalPlayer/MessgEx.pas
r622 r717 77 77 CenterTo := 0; 78 78 OpenSound := ''; 79 EInput.AutoSelect := False; 79 80 end; 80 81 -
branches/zoom/LocalPlayer/NatStat.pas
r549 r717 93 93 Template := TBitmap.Create; 94 94 Template.PixelFormat := TPixelFormat.pf24bit; 95 LoadGraphicFile(Template, GetGraphicsDir + DirectorySeparator + 'Nation .png',95 LoadGraphicFile(Template, GetGraphicsDir + DirectorySeparator + 'Nation' + PngExt, 96 96 [gfNoGamma]); 97 97 end; -
branches/zoom/LocalPlayer/Nego.lfm
- Property svn:mime-type deleted
-
branches/zoom/LocalPlayer/Select.pas
r693 r717 1055 1055 kEnemyModels: 1056 1056 MainScreen.UnitStatDlg.ShowNewContent_EnemyModel(wmPersistent, 1057 Layers[laImprovements].Lines[ScrollBar.Position + Selected]. Code);1057 Layers[laImprovements].Lines[ScrollBar.Position + Selected].Model); 1058 1058 kAllEnemyModels, kChooseEnemyModel: 1059 1059 if lix <> mixAll then -
branches/zoom/LocalPlayer/TechTree.pas
r684 r717 178 178 Image := TBitmap.Create; 179 179 Image.PixelFormat := TPixelFormat.pf24bit; 180 LoadGraphicFile(Image, GetAppSharePath('Help' + DirectorySeparator + 'AdvTree .png'),180 LoadGraphicFile(Image, GetAppSharePath('Help' + DirectorySeparator + 'AdvTree' + PngExt), 181 181 [gfNoGamma]); 182 182 -
branches/zoom/LocalPlayer/Term.pas
r704 r717 803 803 Picture.pix := pixNoSlaves; 804 804 Picture.Hash := 0; 805 Picture.GrName := 'StdUnits .png';805 Picture.GrName := 'StdUnits'; 806 806 IsNew := True; 807 807 end … … 1407 1407 if AILogo[P] = nil then 1408 1408 AILogo[P] := TBitmap.Create; 1409 if not LoadGraphicFile(AILogo[P], GetAppSharePath(Name + '.png'), [gfNoError]) then1409 if not LoadGraphicFile(AILogo[P], GetAppSharePath(Name + PngExt), [gfNoError]) then 1410 1410 begin 1411 1411 FreeAndNil(AILogo[P]); … … 1766 1766 MainMap.SetOutput(Offscreen); 1767 1767 1768 HGrStdUnits := LoadGraphicSet('StdUnits .png');1768 HGrStdUnits := LoadGraphicSet('StdUnits' + PngExt); 1769 1769 SmallImp := TBitmap.Create; 1770 1770 SmallImp.PixelFormat := TPixelFormat.pf24bit; … … 1919 1919 pix := pixNoSlaves; 1920 1920 Hash := 0; 1921 GrName := 'StdUnits .png';1921 GrName := 'StdUnits'; 1922 1922 Tribe[p1].SetModelPicture(Picture, True); 1923 1923 end; … … 2928 2928 InitTurn(NewPlayer); 2929 2929 DipMem[Me].pContact := -1; 2930 (* if (Me =0) and (MyRO.Alive and (1 shl Me)=0)} then2930 (* if (Me = 0) and (MyRO.Alive and (1 shl Me) = 0)} then 2931 2931 begin 2932 if SimpleQuery(Phrases.Lookup('RESIGN')) =mrIgnore then2933 Server(sResign, Me,0,nil^)2934 else Server(sBreak, Me,0,nil^)2932 if SimpleQuery(Phrases.Lookup('RESIGN')) = mrIgnore then 2933 Server(sResign, Me, 0, nil^) 2934 else Server(sBreak, Me, 0, nil^) 2935 2935 end 2936 2936 else Play('TURNSTART'); *) -
branches/zoom/LocalPlayer/Tribes.pas
r661 r717 322 322 Item := Get; 323 323 sympix := GetNum; 324 symHGr := LoadGraphicSet(Item + '.png');324 symHGr := LoadGraphicSet(Item + PngExt); 325 325 end; 326 326 end; … … 442 442 end; 443 443 end; 444 cHGr := LoadGraphicSet(Item + '.png');444 cHGr := LoadGraphicSet(Item + PngExt); 445 445 for X := 0 to 3 do 446 446 with CityPicture[X] do begin … … 461 461 else 462 462 begin 463 faceHGr := LoadGraphicSet(Item + '.png');463 faceHGr := LoadGraphicSet(Item + PngExt); 464 464 facepix := GetNum; 465 465 if faceHGr.Data.Canvas.Pixels[facepix mod 10 * 65, … … 610 610 LeastUsed := MaxInt; 611 611 612 TestPic.GrName := 'StdUnits .png';612 TestPic.GrName := 'StdUnits'; 613 613 HGr := HGrStdUnits; 614 614 for I := 0 to StdUnitScript.Count - 1 do … … 625 625 begin 626 626 Ok := True; 627 TestPic.GrName := Copy(Input, 8, 255) + '.png';627 TestPic.GrName := Copy(Input, 8, 255); 628 628 HGr := GrExt.SearchByName(TestPic.GrName); 629 629 end -
branches/zoom/LocalPlayer/UnitStat.pas
r622 r717 86 86 Template := TBitmap.Create; 87 87 Template.PixelFormat := TPixelFormat.pf24bit; 88 LoadGraphicFile(Template, GetGraphicsDir + DirectorySeparator + 'Unit .png',88 LoadGraphicFile(Template, GetGraphicsDir + DirectorySeparator + 'Unit' + PngExt, 89 89 [gfNoGamma]); 90 90 end; -
branches/zoom/Localization/ru/Language2.txt
- Property svn:mime-type deleted
-
branches/zoom/MiniMap.pas
r704 r717 200 200 else CM := Colors[Tile and fTerrain, I]; 201 201 if (PByte(MiniPixel.Pixel) >= Bitmap.RawImage.Data) and 202 (PByte(MiniPixel.Pixel) < (Bitmap.RawImage.Data + YY * MiniPixel.BytesPerLine) ) then begin202 (PByte(MiniPixel.Pixel) < (Bitmap.RawImage.Data + YY * MiniPixel.BytesPerLine) - 1) then begin 203 203 MiniPixel.PixelB := (CM shr 16) and $ff; 204 204 MiniPixel.PixelG := (CM shr 8) and $ff; … … 239 239 fTerrain, I]; 240 240 if (PByte(MiniPixel.Pixel) >= Bitmap.RawImage.Data) and 241 (PByte(MiniPixel.Pixel) < (Bitmap.RawImage.Data + YY * MiniPixel.BytesPerLine) ) then begin241 (PByte(MiniPixel.Pixel) < (Bitmap.RawImage.Data + YY * MiniPixel.BytesPerLine) - 1) then begin 242 242 MiniPixel.PixelB := ((CM shr 16) and $FF) * Brightness div 3; 243 243 MiniPixel.PixelG := ((CM shr 8) and $FF) * Brightness div 3; … … 283 283 PrevMiniPixel.SetX(XM); 284 284 if (PByte(PrevMiniPixel.Pixel) >= Bitmap.RawImage.Data) and 285 (PByte(PrevMiniPixel.Pixel) < (Bitmap.RawImage.Data + YY * PrevMiniPixel.BytesPerLine) ) then begin285 (PByte(PrevMiniPixel.Pixel) < (Bitmap.RawImage.Data + YY * PrevMiniPixel.BytesPerLine) - 1) then begin 286 286 PrevMiniPixel.PixelB := CM shr 16; 287 287 PrevMiniPixel.PixelG:= CM shr 8 and $FF; … … 296 296 CM := Colors[Tile and fTerrain, I]; 297 297 if (PByte(MiniPixel.Pixel) >= Bitmap.RawImage.Data) and 298 (PByte(MiniPixel.Pixel) < (Bitmap.RawImage.Data + YY * MiniPixel.BytesPerLine) ) then begin298 (PByte(MiniPixel.Pixel) < (Bitmap.RawImage.Data + YY * MiniPixel.BytesPerLine) - 1) then begin 299 299 MiniPixel.PixelB := (CM shr 16) and $ff; 300 300 MiniPixel.PixelG := (CM shr 8) and $ff; … … 368 368 PrevMiniPixel.SetX(XM); 369 369 if (PByte(PrevMiniPixel.Pixel) >= Bitmap.RawImage.Data) and 370 (PByte(PrevMiniPixel.Pixel) < (Bitmap.RawImage.Data + YY * PrevMiniPixel.BytesPerLine) ) then begin370 (PByte(PrevMiniPixel.Pixel) < (Bitmap.RawImage.Data + YY * PrevMiniPixel.BytesPerLine) - 1) then begin 371 371 PrevMiniPixel.PixelB := (CM shr 16) and $ff; 372 372 PrevMiniPixel.PixelG := (CM shr 8) and $ff; … … 393 393 end; 394 394 if (PByte(MiniPixel.Pixel) >= Bitmap.RawImage.Data) and 395 (PByte(MiniPixel.Pixel) < (Bitmap.RawImage.Data + YY * MiniPixel.BytesPerLine) ) then begin395 (PByte(MiniPixel.Pixel) < (Bitmap.RawImage.Data + YY * MiniPixel.BytesPerLine) - 1) then begin 396 396 MiniPixel.PixelB := (CM shr 16) and $ff; 397 397 MiniPixel.PixelG := (CM shr 8) and $ff; -
branches/zoom/Packages/CevoComponents/Directories.pas
r664 r717 22 22 23 23 uses 24 FileUtil, LCLIntf, LCLType, LCLProc, LazUTF8, SysUtils, LazFileUtils, Forms; 24 FileUtil, LCLIntf, LCLType, LCLProc, LazUTF8, SysUtils, LazFileUtils, Forms, 25 Translations; 25 26 26 27 function GetAppSharePath(Path: string): string; … … 33 34 {$IFDEF UNIX} 34 35 // If installed in Linux system then try to use different installation directory 36 NewPath := ExtractFileDir(Application.ExeName) + DirectorySeparator + '..' + 37 DirectorySeparator + 'share' + DirectorySeparator + 38 ExtractFileNameOnly(Application.ExeName) + DirectorySeparator + Path; 39 35 40 if not DirectoryExists(Result) then begin 36 NewPath := ExtractFileDir(Application.ExeName) + DirectorySeparator + '..' +37 DirectorySeparator + 'share' + DirectorySeparator +38 ExtractFileNameOnly(Application.ExeName) + DirectorySeparator + Path;39 41 if DirectoryExists(NewPath) then begin 40 42 Result := NewPath; … … 42 44 end; 43 45 end; 46 44 47 if not FileExists(Result) then begin 45 NewPath := ExtractFileDir(Application.ExeName) + DirectorySeparator + '..' +46 DirectorySeparator + 'share' + DirectorySeparator +47 ExtractFileNameOnly(Application.ExeName) + DirectorySeparator + Path;48 48 if FileExists(NewPath) then begin 49 49 Result := NewPath; … … 56 56 function GetLocale: string; 57 57 var 58 Lang: string;59 58 I: Integer; 60 T: string;59 LanguageID: TLanguageID; 61 60 begin 62 61 // Win32 user may decide to override locale with LANG variable. 63 Lang:= Copy(GetEnvironmentVariableUTF8('LANG'), 1, 2);62 Result := Copy(GetEnvironmentVariableUTF8('LANG'), 1, 2); 64 63 65 if Lang= '' then begin66 for I := 1 to Param count - 1 do64 if Result = '' then begin 65 for I := 1 to ParamCount - 1 do 67 66 if (ParamStrUTF8(I) = '--LANG') or (ParamStrUTF8(I) = '-l') or 68 67 (ParamStrUTF8(I) = '--lang') then 69 Lang:= ParamStrUTF8(I + 1);68 Result := ParamStrUTF8(I + 1); 70 69 end; 71 if Lang = '' then begin 72 T := ''; 73 LazGetLanguageIDs(Lang, T); 74 Lang := Copy(Lang, 1, 2); 70 if Result = '' then begin 71 LanguageID := GetLanguageID; 72 Result := Copy(LanguageID.LanguageID, 1, 2); 75 73 end; 76 77 Result := Lang;78 74 end; 79 75 -
branches/zoom/Packages/CevoComponents/ScreenTools.pas
r684 r717 116 116 117 117 const 118 BmpExt = '.bmp'; 119 PngExt = '.png'; 120 JpgExt = '.jpg'; 121 118 122 TransparentColor1 = $FF00FF; 119 123 TransparentColor2 = $7F007F; … … 434 438 Result := False; 435 439 if ExtractFileExt(FileName) = '' then 436 FileName := FileName + '.png';440 FileName := FileName + PngExt; 437 441 438 442 if FileExists(FileName) then begin 439 if ExtractFileExt(FileName) = '.jpg'then begin443 if ExtractFileExt(FileName) = JpgExt then begin 440 444 Jpeg := TJpegImage.Create; 441 445 try … … 451 455 FreeAndNil(Jpeg); 452 456 end else 453 if ExtractFileExt(FileName) = '.png'then begin457 if ExtractFileExt(FileName) = PngExt then begin 454 458 Png := TPortableNetworkGraphic.Create; 455 459 try … … 473 477 FreeAndNil(Png); 474 478 end else 475 if ExtractFileExt(FileName) = '.bmp'then begin479 if ExtractFileExt(FileName) = BmpExt then begin 476 480 try 477 481 Bmp.LoadFromFile(FileName); … … 1799 1803 1800 1804 procedure Gtk2DisableControlStyling(WinControl: TWinControl); 1801 begin 1805 {$IFDEF LCLGTK2} 1806 var 1807 GtkWhite: string; 1808 GtkBlue: string; 1809 GtkBlack: string; 1810 GtkOrange: string; 1811 {$ENDIF} 1812 begin 1813 {$IFDEF LCLGTK2} 1802 1814 // https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/38516 1803 {$IFDEF LCLGTK2} 1815 GtkBlue := '{ 0.373, 0.467, 0.796 }'; 1816 GtkWhite := '{ 1.0, 1.0, 1.0 }'; 1817 GtkBlack := '{ 0, 0, 0 }'; 1818 GtkOrange := '{ 0.373, 0.465, 0.793 }'; 1819 1804 1820 // parse gtkrc from string 1805 1821 gtk_rc_parse_string(PChar('style "noengine" {' + LineEnding + 1806 'engine "" {}' + LineEnding + 1822 'engine "" { }' + LineEnding + 1823 1824 'base[INSENSITIVE] = ' + GtkBlack + LineEnding + 1825 'base[PRELIGHT] = ' + GtkBlack + LineEnding + 1826 'base[NORMAL] = ' + GtkBlack + LineEnding + 1827 'base[SELECTED] = ' + GtkBlue + LineEnding + 1828 'base[ACTIVE] = ' + GtkBlack + LineEnding + 1829 1830 'text[INSENSITIVE] = ' + GtkOrange + LineEnding + 1831 'text[NORMAL] = ' + GtkOrange + LineEnding + 1832 'text[PRELIGHT] = ' + GtkOrange + LineEnding + 1833 'text[SELECTED] = ' + GtkWhite + LineEnding + 1834 'text[ACTIVE] = ' + GtkOrange + LineEnding + 1835 1807 1836 '}' + LineEnding + 1808 1837 'widget "*.your-edit" style "noengine"')); … … 1857 1886 LoadPhrases; 1858 1887 LoadFonts; 1859 Templates := LoadGraphicSet('Templates .png', False);1888 Templates := LoadGraphicSet('Templates' + PngExt, False); 1860 1889 with Templates do begin 1861 1890 Logo := GetItem('Logo'); … … 1873 1902 end; 1874 1903 1875 LoadGraphicFile(Colors, GetGraphicsDir + DirectorySeparator + 'Colors .png');1876 LoadGraphicFile(Paper, GetGraphicsDir + DirectorySeparator + 'Paper .jpg');1877 LoadGraphicFile(BigImp, GetGraphicsDir + DirectorySeparator + 'Icons .png');1904 LoadGraphicFile(Colors, GetGraphicsDir + DirectorySeparator + 'Colors' + PngExt); 1905 LoadGraphicFile(Paper, GetGraphicsDir + DirectorySeparator + 'Paper' + JpgExt); 1906 LoadGraphicFile(BigImp, GetGraphicsDir + DirectorySeparator + 'Icons' + PngExt); 1878 1907 end; 1879 1908 … … 1898 1927 GrExt := TGraphicSets.Create; 1899 1928 1900 HGrSystem := LoadGraphicSet('System .png');1929 HGrSystem := LoadGraphicSet('System' + PngExt); 1901 1930 with HGrSystem do begin 1902 1931 CityMark1 := GetItem('CityMark1'); … … 1904 1933 end; 1905 1934 1906 HGrSystem2 := LoadGraphicSet('System2 .png');1935 HGrSystem2 := LoadGraphicSet('System2' + PngExt); 1907 1936 with HGrSystem2 do begin 1908 1937 Ornament := GetItem('Ornament'); -
branches/zoom/Packages/CevoComponents/Texture.pas
r471 r717 47 47 FAge := AValue; 48 48 LoadGraphicFile(Image, GetGraphicsDir + DirectorySeparator + 49 'Texture' + IntToStr(Age + 1) + '.jpg');49 'Texture' + IntToStr(Age + 1) + JpgExt); 50 50 ColorBevelLight := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelLight]; 51 51 ColorBevelShade := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelShade]; -
branches/zoom/Packages/DpiControls/Dpi.StdCtrls.pas
r673 r717 38 38 TEdit = class(TWinControl) 39 39 private 40 function GetAutoSelect: Boolean; 40 41 function GetSelLength: Integer; 41 42 function GetSelStart: Integer; 43 procedure SetAutoSelect(AValue: Boolean); 42 44 procedure SetSelLength(AValue: Integer); 43 45 procedure SetSelStart(AValue: Integer); … … 56 58 property BorderStyle default bsSingle; 57 59 property ParentFont; 60 property AutoSelect: Boolean read GetAutoSelect write SetAutoSelect default True; 58 61 end; 59 62 … … 303 306 end; 304 307 308 function TEdit.GetAutoSelect: Boolean; 309 begin 310 Result := GetNativeEdit.AutoSelect; 311 end; 312 305 313 function TEdit.GetSelLength: Integer; 306 314 begin … … 311 319 begin 312 320 Result := GetNativeEdit.SelStart; 321 end; 322 323 procedure TEdit.SetAutoSelect(AValue: Boolean); 324 begin 325 GetNativeEdit.AutoSelect := AValue; 313 326 end; 314 327 -
branches/zoom/Settings.pas
r681 r717 6 6 Classes, SysUtils, FileUtil, Dialogs, LCLProc, ScreenTools, Messg, ButtonA, 7 7 Directories, DrawDlg, ButtonC, KeyBindings, Languages, ListBoxEx, 8 {$IFDEF DPI}Dpi.Forms, Dpi.Controls, Dpi.Graphics, Dpi.StdCtrls , System.UITypes{$ELSE}8 {$IFDEF DPI}Dpi.Forms, Dpi.Controls, Dpi.Graphics, Dpi.StdCtrls{$ELSE} 9 9 Forms, Controls, Graphics, StdCtrls{$ENDIF}, Controls; 10 10 … … 56 56 LocalGamma: Integer; 57 57 LocalKeyBindings: TKeyBindings; 58 LocalMusicEnabled: Integer;59 58 LocalMusicVolume: Integer; 60 59 CurrentKeyBinding: TKeyBinding; -
branches/zoom/Start.pas
r685 r717 5 5 6 6 uses 7 GameServer, Messg, ButtonBase, ButtonA, ButtonC, ButtonB, Area, Types,8 LCLIntf, LCLType, SysUtils, Classes, BaseWin, ListBoxEx, LazFileUtils, 7 GameServer, Messg, ButtonBase, ButtonA, ButtonC, ButtonB, Area, 8 LCLIntf, LCLType, SysUtils, Classes, BaseWin, ListBoxEx, LazFileUtils, Math, 9 9 Registry, DrawDlg, Generics.Collections, Protocol, MiniMap, Brain, Translator, 10 10 {$IFDEF DPI}System.UITypes, Dpi.Graphics, Dpi.Controls, Dpi.Forms, Dpi.StdCtrls, … … 520 520 r0, r1: HRgn; 521 521 Location: TPoint; 522 Shift: TPoint; 522 523 begin 523 524 if FullScreen then begin 524 Location := Point(Screen.PrimaryMonitor.Left + (Screen.PrimaryMonitor.Width - 800) * 3 div 8, 525 Screen.PrimaryMonitor.Top + Screen.PrimaryMonitor.Height - Height - (Screen.PrimaryMonitor.Height - 600) div 3); 525 Shift := Point(((Screen.PrimaryMonitor.Width - Min(Screen.PrimaryMonitor.Width, 800)) * 3 div 8), 526 (Screen.PrimaryMonitor.Height - Min(Screen.PrimaryMonitor.Height, 600)) div 3); 527 Location := Point(Screen.PrimaryMonitor.Left + Shift.X, 528 Screen.PrimaryMonitor.Top + Screen.PrimaryMonitor.Height - Height - Shift.Y); 526 529 BoundsRect := Bounds(Location.X, Location.Y, Width, Height); 527 530
Note:
See TracChangeset
for help on using the changeset viewer.
