-
Notifications
You must be signed in to change notification settings - Fork 2
/
FBaseDosForm.pas
93 lines (76 loc) · 1.93 KB
/
FBaseDosForm.pas
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
unit FBaseDosForm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Gr32,
GameControl,
SharedGlobals;
type
{-------------------------------------------------------------------------------
abstract black, fullscreen, ancestor form
-------------------------------------------------------------------------------}
TBaseDosForm = class(TForm)
protected
procedure CreateParams(var Params: TCreateParams); override;
procedure BuildScreen; virtual;
procedure PrepareGameParams; virtual; // Always call inherited
function IsGameplayScreen: Boolean; virtual;
public
constructor Create(aOwner: TComponent); override;
procedure ShowScreen; virtual;
end;
implementation
uses
FMain;
{$R *.dfm}
{ TBaseDosForm }
procedure TBaseDosForm.BuildScreen;
begin
//
end;
constructor TBaseDosForm.Create(aOwner: TComponent);
begin
inherited Create(aOwner);
Caption := 'SuperLemmix';
Color := clBlack;
BorderStyle := bsNone;
BorderIcons := [];
WindowState := wsNormal;
Cursor := crNone;
HorzScrollBar.Visible := False;
VertScrollBar.Visible := False;
end;
procedure TBaseDosForm.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
with Params.WindowClass do
begin
Style := Style or CS_OWNDC; // Maybe faster screen output
end;
end;
procedure TBaseDosForm.PrepareGameParams;
begin
Parent := GameParams.MainForm;
ClientWidth := GameParams.MainForm.ClientWidth;
ClientHeight := GameParams.MainForm.ClientHeight;
Left := 0;
Top := 0;
end;
procedure TBaseDosForm.ShowScreen;
begin
try
PrepareGameParams;
BuildScreen;
except
on E : EAbort do Exit; // Should only happen if some level piece is missing
end;
TMainForm(GameParams.MainForm).ChildForm := Self;
Cursor := crNone;
Screen.Cursor := crNone;
Show;
end;
function TBaseDosForm.IsGameplayScreen: Boolean;
begin
Result := False;
end;
end.