This repository was archived by the owner on Jan 23, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnit3.pas
More file actions
108 lines (94 loc) · 2.7 KB
/
Copy pathUnit3.pas
File metadata and controls
108 lines (94 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons, StdCtrls, ExtCtrls, Spin, Unit1, LevelEngine;
type
TObjectForm = class(TForm)
Image1: TImage;
Panel1: TPanel;
SpeedButton1: TSpeedButton;
ComboBox1: TComboBox;
SpinEdit1: TSpinEdit;
Label1: TLabel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
procedure SpeedButton1Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormShow(Sender: TObject);
procedure SaveToObject(var Obj:TEObject);
procedure LoadFromObject(Obj:TEObject);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FormDeactivate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
ObjectForm: TObjectForm;
implementation
{$R *.dfm}
procedure TObjectForm.SpeedButton1Click(Sender: TObject);
begin
with SpeedButton1,Level do begin
if Tag<3 then Tag:=Tag+1
else Tag:=1;
case tag of
1:if QExit.Bmp<>nil then begin
QExit.Bmp.Transparent:=true;
Image1.Canvas.FillRect(Image1.Canvas.ClipRect);
Image1.Canvas.Draw(0,0,QExit.Bmp);
Caption:=MessageString[44];
end;
2:if QFood[1].Bmp<>nil then begin
QFood[1].Bmp.Transparent:=true;
Image1.Canvas.FillRect(Image1.Canvas.ClipRect);
Image1.Canvas.Draw(0,0,QFood[1].Bmp);
Caption:=MessageString[45];
end;
3:if QKiller.Bmp<>nil then begin
QKiller.Bmp.Transparent:=true;
Image1.Canvas.FillRect(Image1.Canvas.ClipRect);
Image1.Canvas.Draw(0,0,QKiller.Bmp);
Caption:=MessageString[46];
end;
end;
end;
end;
procedure TObjectForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if SpinEdit1.Value<1 then SpinEdit1.Value:=1;
if SpinEdit1.Value>9 then SpinEdit1.Value:=9;
end;
procedure TObjectForm.FormShow(Sender: TObject);
begin
SpeedButton1.Tag:=SpeedButton1.Tag-1;
if SpeedButton1.Tag=0 then SpeedButton1.Tag:=3;
SpeedButton1Click(nil);
if ComboBox1.ItemIndex<0 then ComboBox1.ItemIndex:=0;
end;
procedure TObjectForm.SaveToObject(var Obj: TEObject);
begin
Obj.typ:=SpeedButton1.Tag;
Obj.TofF:=ComboBox1.ItemIndex;
Obj.AnimNumber:=SpinEdit1.Value-1;
end;
procedure TObjectForm.LoadFromObject(Obj: TEObject);
begin
SpeedButton1.Tag:=Obj.typ;
ComboBox1.ItemIndex:=Obj.TofF;
SpinEdit1.Value:=Obj.AnimNumber+1;
end;
procedure TObjectForm.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key=VK_ESCAPE then Close;
end;
procedure TObjectForm.FormDeactivate(Sender: TObject);
begin
ModalResult:=mrCancel;
Close;
end;
end.