Changeset 194
- Timestamp:
- May 7, 2020, 8:39:24 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Back.pas
r189 r194 19 19 private 20 20 Img: TBitmap; 21 public 22 procedure UpdateInterface; 21 23 end; 22 24 … … 37 39 38 40 procedure TBackground.FormShow(Sender: TObject); 39 var40 FileName: string;41 41 begin 42 if FullScreen then begin 43 if not Assigned(Img) then begin 44 FileName := GetGraphicsDir + DirectorySeparator + 'Background.png'; 45 if FileExists(FileName) then begin 46 Img := TBitmap.Create; 47 LoadGraphicFile(img, FileName); 48 end; 49 end; 50 end else begin 51 WindowState := wsNormal; 52 Width := StartDlg.Width + 16; 53 Height := StartDlg.Height + 16; 54 Left := StartDlg.Left - 8; 55 Top := StartDlg.Top - 8; 56 end; 42 UpdateInterface; 57 43 end; 58 44 … … 74 60 end; 75 61 62 procedure TBackground.UpdateInterface; 63 var 64 FileName: string; 65 begin 66 if FullScreen then begin 67 WindowState := wsMaximized; 68 if not Assigned(Img) then begin 69 FileName := GetGraphicsDir + DirectorySeparator + 'Background.png'; 70 if FileExists(FileName) then begin 71 Img := TBitmap.Create; 72 LoadGraphicFile(img, FileName); 73 end; 74 end; 75 end else begin 76 WindowState := wsNormal; 77 Width := StartDlg.Width + 16; 78 Height := StartDlg.Height + 16; 79 Left := StartDlg.Left - 8; 80 Top := StartDlg.Top - 8; 81 end; 82 end; 83 76 84 end. -
trunk/Locale.pas
r167 r194 111 111 procedure TLocaleDlg.CancelBtnClick(Sender: TObject); 112 112 begin 113 ModalResult := mr Ok;113 ModalResult := mrCancel; 114 114 end; 115 115 … … 161 161 begin 162 162 LocaleCode := Languages[List.ItemIndex].ShortName; 163 ModalResult := mr Cancel;163 ModalResult := mrOk; 164 164 end; 165 165 -
trunk/Packages/CevoComponents/ScreenTools.pas
r192 r194 199 199 Gamma: Integer; // global gamma correction (cent) 200 200 201 procedure LoadAssets; 201 202 procedure UnitInit; 202 203 procedure UnitDone; … … 1486 1487 P: integer; 1487 1488 begin 1488 for Section := Low(TFontType) to High(TFontType) do1489 UniFont[Section] := TFont.Create;1490 1491 1489 Section := ftNormal; 1492 1490 AssignFile(FontScript, LocalizedFilePath('Fonts.txt')); 1493 1491 try 1494 Reset( fontscript);1495 while not E OF(FontScript) do begin1492 Reset(FontScript); 1493 while not Eof(FontScript) do begin 1496 1494 ReadLn(FontScript, s); 1497 1495 if s <> '' then … … 1549 1547 end; 1550 1548 1549 procedure LoadAssets; 1550 begin 1551 LoadPhrases; 1552 LoadFonts; 1553 LoadGraphicFile(Templates, GetGraphicsDir + DirectorySeparator + 1554 'Templates.png', gfNoGamma); 1555 LoadGraphicFile(Colors, GetGraphicsDir + DirectorySeparator + 'Colors.png'); 1556 LoadGraphicFile(Paper, GetGraphicsDir + DirectorySeparator + 'Paper.jpg'); 1557 LoadGraphicFile(BigImp, GetGraphicsDir + DirectorySeparator + 'Icons.png'); 1558 end; 1559 1551 1560 procedure UnitInit; 1561 var 1562 Section: TFontType; 1552 1563 begin 1553 1564 Gamma := 100; … … 1559 1570 {$ENDIF} 1560 1571 1561 LoadPhrases;1562 1563 1572 LogoBuffer := TBitmap.Create; 1564 1573 LogoBuffer.PixelFormat := pf24bit; 1565 1574 LogoBuffer.SetSize(wBBook, hBBook); 1566 1575 1567 LoadFonts; 1576 for Section := Low(TFontType) to High(TFontType) do 1577 UniFont[Section] := TFont.Create; 1568 1578 1569 1579 nGrExt := 0; … … 1572 1582 Templates := TBitmap.Create; 1573 1583 Templates.PixelFormat := pf24bit; 1574 LoadGraphicFile(Templates, GetGraphicsDir + DirectorySeparator +1575 'Templates.png', gfNoGamma);1576 1584 Colors := TBitmap.Create; 1577 1585 Colors.PixelFormat := pf24bit; 1578 LoadGraphicFile(Colors, GetGraphicsDir + DirectorySeparator + 'Colors.png');1579 1586 Paper := TBitmap.Create; 1580 1587 Paper.PixelFormat := pf24bit; 1581 LoadGraphicFile(Paper, GetGraphicsDir + DirectorySeparator + 'Paper.jpg');1582 1588 BigImp := TBitmap.Create; 1583 1589 BigImp.PixelFormat := pf24bit; 1584 LoadGraphicFile(BigImp, GetGraphicsDir + DirectorySeparator + 'Icons.png');1585 1590 MainTexture.Image := TBitmap.Create; 1586 1591 MainTextureAge := -2; … … 1588 1593 InitOrnamentDone := False; 1589 1594 GenerateNames := True; 1595 1596 LoadAssets; 1590 1597 end; 1591 1598 -
trunk/Start.pas
r192 r194 155 155 procedure SaveConfig; 156 156 procedure LoadAiBrainsPictures; 157 procedure UpdateInterface; 157 158 end; 158 159 … … 432 433 var 433 434 x, i: Integer; 434 r0, r1: HRgn;435 Location: TPoint;436 435 PlayerSlot: TPlayerSlot; 437 436 AIBrains: TBrains; … … 445 444 end; 446 445 LoadConfig; 446 LoadAssets; 447 447 448 448 ActionsOffered := [maConfig, maManual, maCredits, maWeb]; … … 467 467 DirectDlg.Top := (Screen.Height - DirectDlg.Height) div 2; 468 468 469 if FullScreen then begin 470 Location := Point((Screen.Width - 800) * 3 div 8, 471 Screen.Height - Height - (Screen.Height - 600) div 3); 472 Left := Location.X; 473 Top := Location.Y; 474 475 r0 := CreateRectRgn(0, 0, Width, Height); 476 r1 := CreateRectRgn(TabOffset + 4 * TabSize + 2, 0, Width, TabHeight); 477 CombineRgn(r0, r0, r1, RGN_DIFF); 478 DeleteObject(r1); 479 r1 := CreateRectRgn(QuitBtn.Left, QuitBtn.Top, QuitBtn.Left + QuitBtn.Width, 480 QuitBtn.top + QuitBtn.Height); 481 CombineRgn(r0, r0, r1, RGN_OR); 482 DeleteObject(r1); 483 SetWindowRgn(Handle, r0, False); 484 DeleteObject(r0); // causes crash with Windows 95 485 end else begin 486 Left := (Screen.Width - Width) div 2; 487 Top := (Screen.Height - Height) div 2; 488 end; 469 UpdateInterface; 489 470 490 471 Canvas.Font.Assign(UniFont[ftNormal]); … … 703 684 end; 704 685 AIBrains.Free; 686 end; 687 688 procedure TStartDlg.UpdateInterface; 689 var 690 r0, r1: HRgn; 691 Location: TPoint; 692 begin 693 if FullScreen then begin 694 Location := Point((Screen.Width - 800) * 3 div 8, 695 Screen.Height - Height - (Screen.Height - 600) div 3); 696 Left := Location.X; 697 Top := Location.Y; 698 699 r0 := CreateRectRgn(0, 0, Width, Height); 700 r1 := CreateRectRgn(TabOffset + 4 * TabSize + 2, 0, Width, TabHeight); 701 CombineRgn(r0, r0, r1, RGN_DIFF); 702 DeleteObject(r1); 703 r1 := CreateRectRgn(QuitBtn.Left, QuitBtn.Top, QuitBtn.Left + QuitBtn.Width, 704 QuitBtn.top + QuitBtn.Height); 705 CombineRgn(r0, r0, r1, RGN_OR); 706 DeleteObject(r1); 707 SetWindowRgn(Handle, r0, False); 708 DeleteObject(r0); // causes crash with Windows 95 709 end else begin 710 Left := (Screen.Width - Width) div 2; 711 Top := (Screen.Height - Height) div 2; 712 end; 705 713 end; 706 714 … … 1636 1644 LocaleDlg := TLocaleDlg.Create(nil); 1637 1645 if LocaleDlg.ShowModal = mrOk then begin 1638 Load Phrases;1646 LoadAssets; 1639 1647 Invalidate; 1648 UpdateInterface; 1649 Background.UpdateInterface; 1640 1650 end; 1641 1651 FreeAndNil(LocaleDlg);
Note:
See TracChangeset
for help on using the changeset viewer.