Subversion Repositories spacemission

Rev

Rev 1 | Rev 4 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 2
Line 50... Line 50...
50
  end;
50
  end;
51
 
51
 
52
var
52
var
53
  SpeicherungForm: TSpeicherungForm;
53
  SpeicherungForm: TSpeicherungForm;
54
 
54
 
55
const
-
 
56
  FCompVersion = '1.0';
-
 
57
 
-
 
58
implementation
55
implementation
59
 
56
 
60
uses
57
uses
61
  LevMain;
58
  Global, LevMain;
62
 
59
 
63
{$R *.DFM}
60
{$R *.DFM}
64
 
61
 
65
procedure TSpeicherungForm.SearchLevels;
62
procedure TSpeicherungForm.SearchLevels;
66
var
63
var
Line 90... Line 87...
90
  finally
87
  finally
91
    FindClose(sr);
88
    FindClose(sr);
92
  end;}
89
  end;}
93
  for i := 1 to 9999 do
90
  for i := 1 to 9999 do
94
  begin
91
  begin
95
    if fileexists(mainform.fdirectory+'Levels\Level '+inttostr(i)+'.lev') then
92
    if fileexists(fdirectory+'Levels\Level '+inttostr(i)+'.lev') then
96
      LevelListBox.items.Add('Level ' + inttostr(i));
93
      LevelListBox.items.Add('Level ' + inttostr(i));
97
  end;
94
  end;
98
end;
95
end;
99
 
96
 
100
procedure TSpeicherungForm.LoeschenBtnClick(Sender: TObject);
97
procedure TSpeicherungForm.LoeschenBtnClick(Sender: TObject);
Line 118... Line 115...
118
    li3b.visible := false;
115
    li3b.visible := false;
119
    liu.visible := false;
116
    liu.visible := false;
120
    liw.visible := true;
117
    liw.visible := true;
121
    LadenBtn.enabled := false;
118
    LadenBtn.enabled := false;
122
    LoeschenBtn.enabled := false;
119
    LoeschenBtn.enabled := false;
123
    deletefile(mainform.FDirectory+'Levels\'+
120
    deletefile(FDirectory+'Levels\'+
124
      LevelListBox.Items.strings[LevelListBox.itemindex]+'.lev');
121
      LevelListBox.Items.strings[LevelListBox.itemindex]+'.lev');
125
    SearchLevels;
122
    SearchLevels;
126
  end;
123
  end;
127
end;
124
end;
128
 
125
 
Line 156... Line 153...
156
    exit;}
153
    exit;}
157
  // Vorbereiten
154
  // Vorbereiten
158
  MainForm.DestroyLevel;
155
  MainForm.DestroyLevel;
159
  MainForm.LevChanged := false;
156
  MainForm.LevChanged := false;
160
  // Öffnen
157
  // Öffnen
161
  AssignFile(SavGame, mainform.FDirectory+'Levels\'+
158
  AssignFile(SavGame, FDirectory+'Levels\'+
162
    LevelListBox.Items.strings[LevelListBox.itemindex]+'.lev');
159
    LevelListBox.Items.strings[LevelListBox.itemindex]+'.lev');
163
  Reset(SavGame);
160
  Reset(SavGame);
164
  // Laden
161
  // Laden
165
  ReadLN(SavGame); // --> Copyrightinfo
162
  ReadLN(SavGame); // --> Copyrightinfo
166
  ReadLN(SavGame); // --> Copyrightinfo
163
  ReadLN(SavGame); // --> Copyrightinfo
Line 284... Line 281...
284
  begin
281
  begin
285
    if MessageDlg('Level ist bereits vorhanden. Ersetzen?', mtConfirmation, [mbYes, mbNo], 0) = mrNo then
282
    if MessageDlg('Level ist bereits vorhanden. Ersetzen?', mtConfirmation, [mbYes, mbNo], 0) = mrNo then
286
      exit;
283
      exit;
287
  end;
284
  end;
288
  // Öffnen oder erstellen
285
  // Öffnen oder erstellen
289
  AssignFile(SavGame, mainform.FDirectory+'Levels\Level '+inttostr(SpinEdit.Position)+'.lev');
286
  AssignFile(SavGame, FDirectory+'Levels\Level '+inttostr(SpinEdit.Position)+'.lev');
290
  Rewrite(SavGame);
287
  Rewrite(SavGame);
291
  // Sortierung
288
  // Sortierung
292
  for j := 0 to mainform.enemys.Count - 2 do
289
  for j := 0 to mainform.enemys.Count - 2 do
293
  begin
290
  begin
294
    for i := 0 to mainform.enemys.Count - 2 do
291
    for i := 0 to mainform.enemys.Count - 2 do
Line 341... Line 338...
341
    liw.visible := true;
338
    liw.visible := true;
342
    exit;
339
    exit;
343
  end;
340
  end;
344
  temp := LevelListBox.Items.strings[LevelListBox.itemindex];
341
  temp := LevelListBox.Items.strings[LevelListBox.itemindex];
345
  SpinEdit.Position := strtoint(RightStr(temp, length(temp)-6));
342
  SpinEdit.Position := strtoint(RightStr(temp, length(temp)-6));
346
  AssignFile(SavGame, mainform.FDirectory+'Levels\'+
343
  AssignFile(SavGame, FDirectory+'Levels\'+
347
    LevelListBox.Items.strings[LevelListBox.itemindex]+'.lev');
344
    LevelListBox.Items.strings[LevelListBox.itemindex]+'.lev');
348
  Reset(SavGame);
345
  Reset(SavGame);
349
  ReadLN(SavGame, Ergebnis);
346
  ReadLN(SavGame, Ergebnis);
350
  if Ergebnis <> '; SpaceMission '+FCompVersion then
347
  if Ergebnis <> '; SpaceMission '+FCompVersion then
351
  begin
348
  begin