ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/oup/current/Main.pas
(Generate patch)

Comparing:
oup/rewrite/Main.pas (file contents), Revision 97 by alloc, Mon Jan 22 23:05:45 2007 UTC vs.
oup/current/Main.pas (file contents), Revision 113 by alloc, Sun Feb 25 17:20:22 2007 UTC

# Line 10 | Line 10 | uses
10    Functions,
11    Settings, {Helper_LevelDB, }
12    Template,
13 <  Preview;
14 < //  BinEdit, Extractor, RawEdit, TxmpReplace;
13 >  RawEdit, BinEdit, Extractor, Preview, TxmpReplace;
14  
15   type
16    TForm_Main = class(TForm)
# Line 161 | Line 160 | begin
160    if RepMsg = SM_OK then
161    begin
162      UpdateStatBar;
163 +    UpdateConLists;
164    end;
165   end;
166  
# Line 169 | Line 169 | var
169    i: Integer;
170    toolform: TForm_ToolTemplate;
171   begin
172 +  Result := True;
173    if MDITab.MDIChildCount > 0 then
174    begin
175      for i := 0 to MDITab.MDIChildCount - 1 do
# Line 179 | Line 180 | begin
180          if toolform.ConnectionID = ConManager.ConnectionByIndex[index].ConnectionID then
181          begin
182            if not toolform.Closeable then
183 <            ShowMessage('Can not close toolwindow: ' + toolform.Caption);
183 >          begin
184 >            ShowMessage('Can not close toolwindow: ' + toolform.Caption);
185 >            Result := False;
186 >          end;
187          end;
188        end;
189      end;
# Line 234 | Line 238 | end;
238  
239  
240   procedure TForm_Main.FormCreate(Sender: TObject);
237 var
238  RepMsg: TStatusMessages;
241   begin
242    Self.Caption := 'Oni Un/Packer ' + version;
243    Self.FormResize(Self);
# Line 254 | Line 256 | begin
256    begin
257      AppSettings.DatPath        := ExtractFilepath(Application.EXEname);
258      AppSettings.ExtractPath    := ExtractFilepath(Application.EXEname) + '\extract';
257    AppSettings.FilenumbersAsHex := False;
259      AppSettings.CharSet        := DEFAULT_CHARSET;
260      AppSettings.HideUnusedData := False;
261    end;
# Line 441 | Line 442 | var
442    position: TTBDockPosition;
443    mode: TTBItemDisplayMode;
444    i: Integer;
444  isEnabled: Boolean;
445   begin
446    toolbar := TTBToolbar(Sender);
447    if toolbar.Floating then
# Line 496 | Line 496 | end;
496  
497   procedure TForm_Main.LoadFile(typedb: Boolean);
498   var
499 <  ext: String;
499 >  i: Integer;
500   begin
501    opend.InitialDir := AppSettings.DatPath;
502    opend.Filter     := 'Compatible level files|*.dat;*.oldb|Oni level (*.dat)|*.dat|OUP level database (*.oldb)|*.oldb|Any (*.*)|*';
# Line 506 | Line 506 | begin
506      opend.FilterIndex := 2;
507    if opend.Execute then
508    begin
509 <    ext := ExtractFileExt(opend.FileName);
510 <    if ext = '.dat' then
511 <    begin
512 <      CreateConnection(opend.FileName);
513 <    end else if ext = '.oldb' then
514 <    begin
515 <      CreateConnection(opend.FileName);
516 <    end else
517 <      ShowMessage('Incompatible file');
509 >    if opend.Files.Count > 0 then
510 >      for i := 0 to opend.Files.Count - 1 do
511 >        CreateConnection(opend.Files.Strings[i]);
512      AppSettings.DatPath := ExtractFilepath(opend.FileName);
513    end;
514    UpdateStatBar;
# Line 680 | Line 674 | end;
674   procedure TForm_Main.menu_conns_itemClick(Sender: TObject);
675   var
676    name: String;
683  i: Integer;
677    index: Integer;
678    RepMsg: TStatusMessages;
679   begin
# Line 692 | Line 685 | begin
685    begin
686      CheckConnectionCloseable(index);
687      ConManager.CloseConnectionByIndex(index, RepMsg);
688 +    ShowOpenMsg(RepMsg);
689 +    UpdateConLists;
690    end;
691    UpdateStatBar;
692   end;
# Line 748 | Line 743 | begin
743    iconindex := -1;
744    caption_end := IntToStr(tag) + '       ';
745  
746 +  toolform := nil;
747 +
748    if window_context = 'binedit' then
749    begin
750 < //    toolform         := TForm_BinEdit.Create(Self);
750 >    toolform         := TForm_BinEdit.Create(Self);
751      toolform.Caption := 'Binary .dat-Editor ' + caption_end;
752      iconindex        := 5;
753    end;
754    if window_context = 'extractor' then
755    begin
756 < //    toolform         := TForm_Extractor.Create(Self);
756 >    toolform         := TForm_Extractor.Create(Self);
757      toolform.Caption := 'Extractor ' + caption_end;
758      iconindex        := 8;
759    end;
# Line 768 | Line 765 | begin
765    end;
766    if window_context = 'rawedit' then
767    begin
768 < //    toolform         := TForm_RawEdit.Create(Self);
768 >    toolform         := TForm_RawEdit.Create(Self);
769      toolform.Caption := 'Binary .raw-Editor ' + caption_end;
770      iconindex        := 6;
771    end;
772    if window_context = 'txmpreplace' then
773    begin
774 < //    toolform         := TForm_TxmpReplace.Create(Application);
774 >    toolform         := TForm_TxmpReplace.Create(Self);
775      toolform.Caption := 'TXMP Replacer ' + caption_end;
776      iconindex        := 7;
777    end;

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)