--- oup/current/Main.pas 2006/12/23 22:16:42 51 +++ oup/releases/0.33a/Main.pas 2007/01/11 23:38:49 76 @@ -71,6 +71,9 @@ type TBSeparatorItem1: TTBSeparatorItem; tb_db2dat: TTBItem; tb_dat2db: TTBItem; + menu_loaddb: TTBItem; + tb_opendb: TTBItem; + procedure LoadFile(typedb: Boolean); function TryCloseAll: Boolean; procedure menu_AboutClick(Sender: TObject); procedure menu_settingsClick(Sender: TObject); @@ -105,6 +108,7 @@ type procedure menu_windows_tilevertClick(Sender: TObject); procedure menu_metaClick(Sender: TObject); procedure ToolbarDockChanged(Sender: TObject); + procedure menu_loaddbClick(Sender: TObject); private public end; @@ -319,10 +323,8 @@ begin end; - {#################################} - {##### Main-Menu-Handlers #####} - {#################################} -procedure TForm_Main.menu_loadfileClick(Sender: TObject); + +procedure TForm_Main.LoadFile(typedb: Boolean); var ext: String; begin @@ -331,6 +333,10 @@ begin CloseDataConnection; opend.InitialDir := AppSettings.DatPath; opend.Filter := 'Compatible level files|*.dat;*.oldb|Oni level (*.dat)|*.dat|OUP level database (*.oldb)|*.oldb|Any (*.*)|*'; + if typedb then + opend.FilterIndex := 3 + else + opend.FilterIndex := 2; if opend.Execute then begin ext := ExtractFileExt(opend.FileName); @@ -353,6 +359,20 @@ begin end; + {#################################} + {##### Main-Menu-Handlers #####} + {#################################} +procedure TForm_Main.menu_loaddbClick(Sender: TObject); +begin + LoadFile(True); +end; + +procedure TForm_Main.menu_loadfileClick(Sender: TObject); +begin + LoadFile(False); +end; + + procedure TForm_Main.menu_settingsClick(Sender: TObject); @@ -579,31 +599,31 @@ begin begin toolform := TForm_BinEdit.Create(Self); toolform.Caption := 'Binary .dat-Editor ' + IntToStr(tag); - iconindex := 4; + iconindex := 5; end; if window_context = 'extractor' then begin toolform := TForm_Extractor.Create(Self); toolform.Caption := 'Extractor ' + IntToStr(tag); - iconindex := 7; + iconindex := 8; end; if window_context = 'preview' then begin toolform := TForm_Preview.Create(Self); toolform.Caption := 'Preview-Window ' + IntToStr(tag); - iconindex := 3; + iconindex := 4; end; if window_context = 'rawedit' then begin toolform := TForm_RawEdit.Create(Self); toolform.Caption := 'Binary .raw-Editor ' + IntToStr(tag); - iconindex := 5; + iconindex := 6; end; if window_context = 'txmpreplace' then begin toolform := TForm_TxmpReplace.Create(Application); toolform.Caption := 'TXMP Replacer ' + IntToStr(tag); - iconindex := 6; + iconindex := 7; end; if Assigned(toolform) then