Rev 1 | Rev 3 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1 | Rev 2 | ||
---|---|---|---|
1 | program LevEdit; |
1 | program LevEdit; |
2 | 2 | ||
3 | {$Description 'SpaceMission Leveleditor 1.1'} |
3 | {$Description 'SpaceMission Leveleditor 1.1'} |
4 | 4 | ||
5 | {%ToDo 'LevEdit.todo'} |
5 | {%ToDo 'LevEdit.todo'} |
6 | 6 | ||
7 | uses |
7 | uses |
8 | Windows, |
8 | Windows, |
9 | Forms, |
9 | Forms, |
10 | Dialogs, |
10 | Dialogs, |
11 | SysUtils, |
11 | SysUtils, |
12 | MMSystem, |
12 | MMSystem, |
13 | LevMain in 'LevMain.pas' {MainForm}, |
13 | LevMain in 'LevMain.pas' {MainForm}, |
14 | LevText in 'LevText.pas' {TextForm}, |
14 | LevText in 'LevText.pas' {TextForm}, |
15 | LevSplash in 'LevSplash.pas' {SplashForm}, |
15 | LevSplash in 'LevSplash.pas' {SplashForm}, |
16 | LevSpeicherung in 'LevSpeicherung.pas' {SpeicherungForm}, |
16 | LevSpeicherung in 'LevSpeicherung.pas' {SpeicherungForm}, |
17 | LevInfo in 'LevInfo.pas' {InfoForm}, |
17 | SplInfo in 'SplInfo.pas' {InfoForm}, |
18 | LevSource in 'LevSource.pas' {SourceForm}, |
18 | LevSource in 'LevSource.pas' {SourceForm}, |
19 | LevOptions in 'LevOptions.pas' {LevelForm}; |
19 | LevOptions in 'LevOptions.pas' {LevelForm}, |
- | 20 | Global in 'Global.pas'; |
|
20 | 21 | ||
21 | {$R *.RES} |
22 | {$R *.RES} |
22 | 23 | ||
23 | var |
24 | var |
24 | Fehler: boolean; |
25 | Fehler: boolean; |
25 | Sem: THandle; |
26 | Sem: THandle; |
26 | directory: string; |
27 | directory: string; |
27 | 28 | ||
28 | begin |
29 | begin |
29 | { Programm schon gestartet? } |
30 | { Programm schon gestartet? } |
30 | Sem := CreateSemaphore(nil, 0, 1, 'SpaceMission Leveleditor'); |
31 | Sem := CreateSemaphore(nil, 0, 1, 'SpaceMission Leveleditor'); |
31 | if (Sem <> 0) and (GetLastError = ERROR_ALREADY_EXISTS) then |
32 | if (Sem <> 0) and (GetLastError = ERROR_ALREADY_EXISTS) then |
32 | begin |
33 | begin |
33 | CloseHandle(Sem); |
34 | CloseHandle(Sem); |
34 | MessageDlg('Der Editor wurde bereits gestartet.', mtInformation, [mbOK], 0); |
35 | MessageDlg('Der Editor wurde bereits gestartet.', mtInformation, [mbOK], 0); |
35 | exit; |
36 | exit; |
36 | end; |
37 | end; |
37 | SplashForm := TSplashForm.Create(Application); |
38 | SplashForm := TSplashForm.Create(Application); |
38 | SplashForm.Show; |
39 | SplashForm.Show; |
39 | SplashForm.Update; |
40 | SplashForm.Update; |
40 | Application.Initialize; |
41 | Application.Initialize; |
41 | Application.showmainform := False; |
42 | Application.showmainform := False; |
42 | Application.Title := 'SpaceMission 1.1 - Leveleditor'; |
43 | Application.Title := 'SpaceMission 1.1 - Leveleditor'; |
43 | Fehler := false; |
44 | Fehler := false; |
44 | directory := extractfilepath(paramstr(0)); |
45 | directory := extractfilepath(paramstr(0)); |
45 | // if not fileexists(directory+'Bilder\Auswahl.bmp') then Fehler := true; |
46 | // if not fileexists(directory+'Bilder\Auswahl.bmp') then Fehler := true; |
46 | if not fileexists(directory+'DirectX\Graphic.dxg') then Fehler := true; |
47 | if not fileexists(directory+'DirectX\Graphic.dxg') then Fehler := true; |
47 | // if not fileexists(directory+'Texte\Mitwirkende.txt') then Fehler := true; |
48 | // if not fileexists(directory+'Texte\Mitwirkende.txt') then Fehler := true; |
48 | // if not fileexists(directory+'Dateien.doc') then Fehler := true; |
49 | // if not fileexists(directory+'Dateien.doc') then Fehler := true; |
49 | if Fehler then |
50 | if Fehler then |
50 | begin |
51 | begin |
51 | MessageDLG('Dateien, die die Programmstabilität gewährleisten, sind ' + |
52 | MessageDLG('Dateien, die die Programmstabilität gewährleisten, sind ' + |
52 | 'nicht mehr vorhanden!'+#13#10+'Bitte installieren Sie SpaceMission erneut...', |
53 | 'nicht mehr vorhanden!'+#13#10+'Bitte installieren Sie SpaceMission erneut...', |
53 | mtWarning, [mbOK], 0); |
54 | mtWarning, [mbOK], 0); |
54 | exit; |
55 | exit; |
55 | end; |
56 | end; |
56 | Application.CreateForm(TMainForm, MainForm); |
57 | Application.CreateForm(TMainForm, MainForm); |
57 | Application.CreateForm(TTextForm, TextForm); |
58 | Application.CreateForm(TTextForm, TextForm); |
58 | Application.CreateForm(TSpeicherungForm, SpeicherungForm); |
59 | Application.CreateForm(TSpeicherungForm, SpeicherungForm); |
59 | Application.CreateForm(TInfoForm, InfoForm); |
60 | Application.CreateForm(TInfoForm, InfoForm); |
60 | Application.CreateForm(TSourceForm, SourceForm); |
61 | Application.CreateForm(TSourceForm, SourceForm); |
61 | Application.CreateForm(TLevelForm, LevelForm); |
62 | Application.CreateForm(TLevelForm, LevelForm); |
62 | Application.Run; |
63 | Application.Run; |
63 | end. |
64 | end. |
64 | 65 | ||
65 | 66 |