Subversion Repositories spacemission

Rev

Rev 1 | Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. unit LevSource;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls, ShellAPI;
  8.  
  9. type
  10.   TSourceForm = class(TForm)        
  11.     ElLabel1: TLabel;
  12.     ElLabel2: TLabel;
  13.     ElPopupButton1: TButton;
  14.     ListBox1: TListBox;
  15.     Memo1: TMemo;
  16.     Label1: TLabel;
  17.     Label2: TLabel;
  18.     procedure ElPopupButton1Click(Sender: TObject);
  19.     procedure FormHide(Sender: TObject);
  20.     procedure FormShow(Sender: TObject);
  21.     procedure Label1Click(Sender: TObject);
  22.   public
  23.     procedure Aktualisieren;
  24.   end;
  25.  
  26. var
  27.   SourceForm: TSourceForm;
  28.  
  29. implementation
  30.  
  31. uses
  32.   Global, LevMain, LevSpeicherung;
  33.  
  34. {$R *.DFM}
  35.  
  36. procedure TSourceForm.ElPopupButton1Click(Sender: TObject);
  37. begin
  38.   close;
  39. end;
  40.  
  41. procedure TSourceForm.Aktualisieren;
  42. var
  43.   i, j: integer;
  44.   puffer: string;
  45. begin
  46.   ListBox1.Items := MainForm.Enemys;
  47.   Memo1.lines.clear;
  48.   for j := 0 to mainform.enemys.Count - 2 do
  49.   begin
  50.     for i := 0 to mainform.enemys.Count - 2 do
  51.     begin
  52.       if strtoint(speicherungform.filter(1, mainform.enemys.Strings[i])) > strtoint(speicherungform.filter(1, mainform.enemys.Strings[i + 1])) then
  53.       begin
  54.         puffer := mainform.enemys.Strings[i];
  55.         mainform.enemys.Strings[i] := mainform.enemys.Strings[i + 1];
  56.         mainform.enemys.Strings[i + 1] := puffer;
  57.       end;
  58.     end;
  59.   end;
  60.   Memo1.lines.add('; SpaceMission ' + FCompVersion);
  61.   Memo1.lines.add('; LEV-File');
  62.   Memo1.lines.add(inttostr(MainForm.ScrollBar.Max)); // --> Länge der Karte
  63.   for i := 0 to mainform.enemys.count-1 do
  64.   begin
  65.     Memo1.lines.add(speicherungform.filter(3, mainform.enemys.Strings[i]));
  66.     Memo1.lines.add(speicherungform.filter(1, mainform.enemys.Strings[i]));
  67.     Memo1.lines.add(speicherungform.filter(2, mainform.enemys.Strings[i]));
  68.     Memo1.lines.add(speicherungform.filter(4, mainform.enemys.Strings[i]));
  69.   end;
  70. end;
  71.  
  72. procedure TSourceForm.FormHide(Sender: TObject);
  73. begin
  74.   mainform.dxtimer.enabled := true;
  75. end;
  76.  
  77. procedure TSourceForm.FormShow(Sender: TObject);
  78. begin
  79.   mainform.dxtimer.enabled := false;
  80. end;
  81.  
  82. procedure TSourceForm.Label1Click(Sender: TObject);
  83. begin
  84.   if not fileexists(Fdirectory+'Dokumentation.pdf') then
  85.   begin
  86.     MessageDLG('Die Datei "Dokumentation.pdf" ist nicht mehr vorhanden. Die Aktion wird abgebrochen!',
  87.       mtWarning, [mbOK], 0);
  88.   end
  89.   else
  90.     shellexecute(handle, 'open', pchar(fdirectory+'Dokumentation.pdf'), '', '', 1);
  91. end;
  92.  
  93. end.
  94.  
  95.