unit Menu;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, SRGrad;

type
  TMainMenu = class(TForm)
    lbl1: TLabel;
    lbl2: TLabel;
    img1: TImage;
    lbl4: TLabel;
    srgrdnt1: TSRGradient;
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure lbl1Click(Sender: TObject);
    procedure lbl1MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure lbl1MouseLeave(Sender: TObject);
    procedure lbl2MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure lbl2MouseLeave(Sender: TObject);
    procedure lbl4MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure lbl4MouseLeave(Sender: TObject);
    procedure lbl4Click(Sender: TObject);
    procedure lbl2Click(Sender: TObject);
    procedure img1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  MainMenu: TMainMenu;
  rgn: HRGN;
  ext: Boolean;
implementation

uses Unit1, Unit2, Unit3, Unit4, Unit5, GetResultat, settings;

{$R *.dfm}

procedure TMainMenu.FormCreate(Sender: TObject);
begin
 // rgn := CreateEllipticRgn(30,30,Width,Height);
 // SetWindowRgn(Handle,rgn,True);
 lbl1.Font.Color := $003399fe;
 lbl2.Font.Color := $003399fe;
 lbl4.Font.Color := $003399fe;
 Show;
 ext:= False;
end;

procedure TMainMenu.FormClose(Sender: TObject; var Action: TCloseAction);
begin
 if ext=False then
  begin
    shadow.Close;
    background.Close;
    Close;
  end;
end;

procedure TMainMenu.lbl1Click(Sender: TObject);
begin
  background.Close;
  shadow.Close;

  ext:=True;
  Close;
end;

procedure TMainMenu.lbl1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  lbl1.Font.Color := clRed;
  lbl1.Font.Style := [fsBold, fsItalic];
end;

procedure TMainMenu.lbl1MouseLeave(Sender: TObject);
begin
  lbl1.Font.Color := $003399fe;
  lbl1.Font.Style := [ ];
end;

procedure TMainMenu.lbl2MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  lbl2.Font.Color := clRed;
  lbl2.Font.Style := [fsBold, fsItalic, fsStrikeOut];
end;

procedure TMainMenu.lbl2MouseLeave(Sender: TObject);
begin
  lbl2.Font.Color := $003399fe;
  lbl2.Font.Style := [ ];
end;

procedure TMainMenu.lbl4MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  lbl4.Font.Color := clYellow;
  lbl4.Font.Style := [fsBold, fsItalic];
end;

procedure TMainMenu.lbl4MouseLeave(Sender: TObject);
begin
  lbl4.Font.Color := $003399fe;
  lbl4.Font.Style := [ ];
end;

procedure TMainMenu.lbl4Click(Sender: TObject);
var b: variant;
begin
  Application.CreateForm(TGG, GG);
  Application.CreateForm(TTopMenu, TopMenu);
   Application.CreateForm(TSG, SG);

  shadow.shp1.Visible := false;
  shadow.Width := 986;
  shadow.Height:= 706;
  b:= (Screen.Width/2)  - (shadow.Width/2);
    shadow.Left:=b;
  b:= (Screen.Height/2) - (shadow.Height/2);
    shadow.Top:= b;

  ext:= True;
  MainMenu.Close;
end;

procedure TMainMenu.lbl2Click(Sender: TObject);

begin
 Application.MessageBox('Во избежание ошибок, пожайлуста, воспользуйтесь настройками непосредственно в игре, спасибо за понимание',
  'I create for you smile', mb_Ok);
end;

procedure TMainMenu.img1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  ReleaseCapture;
  MainMenu.Perform(WM_SYSCOMMAND, $f012, 0);
end;

end.
