unit Unit4;

interface

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

type
  TGameEnd = class(TForm)
    btn1: TButton;
    btn2: TButton;
    lbl1: TLabel;
    btn3: TButton;
    lbl2: TLabel;
    edt1: TEdit;
    btn4: TButton;
    procedure btn3Click(Sender: TObject);
    procedure btn1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure btn2Click(Sender: TObject);
    procedure btn4Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  GameEnd: TGameEnd;
  check,sett:Boolean;
implementation

uses Unit5, index;

{$R *.dfm}

procedure TGameEnd.btn3Click(Sender: TObject);
begin
Close;
start.Close;;
end;

procedure TGameEnd.btn1Click(Sender: TObject);
begin
check:=True;
sett:=True;
Close;
end;

procedure TGameEnd.FormShow(Sender: TObject);
begin
check:=False;
  if lbl1.Caption='Вы проиграли! :(' then
    ClientHeight:=67
     else
     ClientHeight:=121;
edt1.Text:=start.scr.Text;
end;

procedure TGameEnd.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  btn4.Caption:='Сохранить результат в изображение';
  if check=True then
    check:=False
  else
    start.Close;
if sett=True then
begin
sett:=False;
start.sett.Click;
end;
end;

procedure TGameEnd.btn2Click(Sender: TObject);
begin
  start.rmk.Click;
  check:=True;
  Close;
end;

procedure TGameEnd.btn4Click(Sender: TObject);
begin
btn4.Caption:='Cooming soon. xD';
end;

end.
