Subversion Repositories spacemission

Compare Revisions

Regard whitespace Rev 1 → Rev HEAD

/LevEdit.dpr
1,37 → 1,43
program LevEdit;
 
{$Description 'SpaceMission Leveleditor 1.1'}
 
{%ToDo 'LevEdit.todo'}
 
uses
Windows,
{$IF CompilerVersion >= 23.0}
System.UITypes,
{$IFEND }
Forms,
Dialogs,
SysUtils,
MMSystem,
LevMain in 'LevMain.pas' {MainForm},
LevText in 'LevText.pas' {TextForm},
LevSplash in 'LevSplash.pas' {SplashForm},
LevSpeicherung in 'LevSpeicherung.pas' {SpeicherungForm},
LevInfo in 'LevInfo.pas' {InfoForm},
LevSource in 'LevSource.pas' {SourceForm},
LevOptions in 'LevOptions.pas' {LevelForm};
ComInfo in 'ComInfo.pas' {InfoForm},
LevOptions in 'LevOptions.pas' {LevelForm},
ComLevelReader in 'ComLevelReader.pas',
Global in 'Global.pas',
ComHilfe in 'ComHilfe.pas' {HilfeForm};
 
{$R *.RES}
 
var
Fehler: boolean;
Sem: THandle;
directory: string;
 
resourcestring
SAlreadyStarted = 'Der Editor wurde bereits gestartet.';
STitel = 'SpaceMission Level-Editor';
SFileMissing = '%s fehlt. Bitte installieren Sie SpaceMission erneut.';
 
const
SemaphoreName = 'SpaceMission Level Editor';
 
begin
SpaceMission_SwitchLanguage;
{ Programm schon gestartet? }
Sem := CreateSemaphore(nil, 0, 1, 'SpaceMission Leveleditor');
Sem := CreateSemaphore(nil, 0, 1, SemaphoreName);
if (Sem <> 0) and (GetLastError = ERROR_ALREADY_EXISTS) then
begin
CloseHandle(Sem);
MessageDlg('Der Editor wurde bereits gestartet.', mtInformation, [mbOK], 0);
MessageDlg(SAlreadyStarted, mtInformation, [mbOK], 0);
exit;
end;
SplashForm := TSplashForm.Create(Application);
38,27 → 44,19
SplashForm.Show;
SplashForm.Update;
Application.Initialize;
Application.showmainform := False;
Application.Title := 'SpaceMission 1.1 - Leveleditor';
Fehler := false;
directory := extractfilepath(paramstr(0));
// if not fileexists(directory+'Bilder\Auswahl.bmp') then Fehler := true;
if not fileexists(directory+'DirectX\Graphic.dxg') then Fehler := true;
// if not fileexists(directory+'Texte\Mitwirkende.txt') then Fehler := true;
// if not fileexists(directory+'Dateien.doc') then Fehler := true;
if Fehler then
Application.ShowMainform := False;
Application.MainFormOnTaskBar := true;
Application.Title := STitel;
if not fileexists(OwnDirectory+DxgFile) then
begin
MessageDLG('Dateien, die die Programmstabilität gewährleisten, sind ' +
'nicht mehr vorhanden!'+#13#10+'Bitte installieren Sie SpaceMission erneut...',
mtWarning, [mbOK], 0);
MessageDLG(Format(SFilemissing, [DxgFile]), mtError, [mbOK], 0);
exit;
end;
Application.CreateForm(TMainForm, MainForm);
Application.CreateForm(TTextForm, TextForm);
Application.CreateForm(TSpeicherungForm, SpeicherungForm);
Application.CreateForm(TInfoForm, InfoForm);
Application.CreateForm(TSourceForm, SourceForm);
Application.CreateForm(TLevelForm, LevelForm);
Application.CreateForm(THilfeForm, HilfeForm);
Application.Run;
end.