forked from ericlangedijk/Lemmix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProg.Types.pas
147 lines (121 loc) · 3.27 KB
/
Prog.Types.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
unit Prog.Types;
{$include lem_directives.inc}
// some shared types
interface
uses
Types, SysUtils,
Forms,
Base.Utils;
type
TStyleFamily = (
DOS,
Lemmini
);
TStyleDef = (
Orig, Ohno, H93, H94, X91, X92, User
);
TStyleDefs = set of TStyleDef;
TStyleDefHelper = record helper for TStyleDef
public
function Name: string; inline;
class function IsDefaultName(const aName: string): Boolean; static;
end;
const
DefaultStyles = [TStyleDef.Orig, TStyleDef.Ohno, TStyleDef.H93, TStyleDef.H94, TStyleDef.X91, TStyleDef.X92];
AllStyles = [Low(TStyleDef)..High(TStyleDef)];
NAME_ORIG = 'Orig';
NAME_OHNO = 'Ohno';
NAME_H93 = 'H93';
NAME_H94 = 'H94';
NAME_X91 = 'X91';
NAME_X92 = 'X92';
NAME_USER = 'User';
STYLE_NAMES: array[TStyleDef] of string = (NAME_ORIG, NAME_OHNO, NAME_H93, NAME_H94, NAME_X91, NAME_X92, NAME_USER);
type
TGameResultsRec = record
Success : Boolean; // level played successfully?
Cheated : Boolean; // level cheated?
LemmingCount : Integer; // number
ToRescue : Integer;
Rescued : Integer;
Target : Integer;
Done : Integer;
TimeIsUp : Boolean;
end;
TGameScreenType = (
Unknown = 1000,
Menu = 1001,
Preview = 1002,
Play = 1003,
Postview = 1004,
LevelCode = 1005,
Options = 1006,
Finder = 1007,
Config = 1008,
Interrupted = 1009, // pseudo
ExitProgram = 1010 // pseudo
);
TMusicStreamType = (
None,
&MOD,
MP3
);
TSoundOption = (
Sound,
Music
);
TSoundOptions = set of TSoundOption;
TMiscOption = (
GradientBridges,
UseFastForward, // not implemented yet
UseSaveStates, // not implemented yet
UseHyperJumps, // not implemented yet
UseCheatCodes,
ShowParticles,
UseFadeOut,
UseCheatScrollingInPreviewScreen,
UseCheatKeyToSolveLevel,
UseFinder,
ShowReplayTextInSkillPanel,
ShowReplayMessages,
ShowFeedbackMessages,
ShowDefaultCursor,
ShowReplayCursor,
EnableSkillButtonsWhenPaused,
RepairCustomLevelErrors,
UseShuffledMusic,
UsePhotoFlashReplayEffect
);
TMiscOptions = set of TMiscOption;
TMiscOptionsHelper = record helper for TMiscOptions
public
function Contains(opt: TMiscOption): Boolean; inline;
end;
// this one is for optional mechanics, which are inserted into the mechanics if set
TOptionalMechanic = (
NukeGlitch,
PauseGlitch,
RighClickGlitch
);
TOptionalMechanics = set of TOptionalMechanic;
implementation
{ TStyleDefHelper }
function TStyleDefHelper.Name: string;
begin
Result := STYLE_NAMES[Self];
end;
class function TStyleDefHelper.IsDefaultName(const aName: string): Boolean;
var
style: TStyleDef;
begin
for style in DefaultStyles do
if SameText(style.Name, aName) then
Exit(True);
Result := False;
end;
{ TMiscOptionsHelper }
function TMiscOptionsHelper.Contains(opt: TMiscOption): Boolean;
begin
Result := opt in Self;
end;
end.