Changeset 45
- Timestamp:
- Dec 23, 2006, 1:03:50 AM (18 years ago)
- Location:
- oup/current
- Files:
-
- 2 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/current/Code_DataStructures.pas
r43 r45 53 53 implementation 54 54 55 uses Code_Functions, Code_OniDataClass, Forms ;55 uses Code_Functions, Code_OniDataClass, Forms, Tool_Template; 56 56 57 57 … … 438 438 RawListHandlers[High(RawListHandlers)].handler := handler; 439 439 Raws := Raws + ext; 440 AddToolListEntry('rawedit', '', ext); 440 441 end; 441 442 -
oup/current/Code_OniDataClass.pas
r43 r45 283 283 for i := 0 to Fdat_header.Files - 1 do 284 284 begin 285 Fdat_files[i].ID := i; 285 286 Fdat_files[i].Extension := Fdat_filesmap[i].Extension; 286 287 Fdat_files[i].Extension := ReverseString(Fdat_files[i].Extension); -
oup/current/Data.pas
r43 r45 94 94 end; 95 95 96 TToolList = array of record 97 context: String; 98 name: String; 99 exts: String; 100 end; 101 96 102 var 97 103 { -
oup/current/Main.pas
r43 r45 7 7 Dialogs, StdCtrls, StrUtils, Clipbrd, ExtCtrls, ComCtrls, Menus, Grids, 8 8 MPHexEditor, ToolWin, ImgList, Tabs, 9 Code_Functions, Data, Code_DataStructures,10 Helper_LevelDB, Code_Exporters, Settings,11 Tool_Preview, Tool_TxmpReplace, Tool_BinEdit, Tool_Extractor, Tool_RawEdit,12 Code_OniDataClass, MDITab, TB2Item, TB2Dock, TB2Toolbar, TB2MDI;9 MDITab, TB2Item, TB2Dock, TB2Toolbar, TB2MDI, 10 Code_Functions, Data, Code_DataStructures, Code_OniDataClass, 11 Helper_LevelDB, Code_Exporters, Settings, Tool_Template, 12 Tool_BinEdit, Tool_Extractor, Tool_Preview, Tool_RawEdit, Tool_TxmpReplace; 13 13 14 14 type … … 77 77 procedure menu_windows_nextClick(Sender: TObject); 78 78 procedure menu_windows_tileClick(Sender: TObject); 79 function open_child(window_context: String ): Boolean;79 function open_child(window_context: String; fileid: Integer): Boolean; 80 80 procedure menu_windows_closeallClick(Sender: TObject); 81 81 procedure menu_windows_cascadeClick(Sender: TObject); … … 305 305 ext := ExtractFileExt(opend.FileName); 306 306 if ext = '.dat' then 307 begin 307 308 if not CreateDataConnection(opend.FileName, ODB_Dat) then 308 309 ShowMessage('Error while loading the file:' + CrLf + opend.FileName + 309 CrLf + 'Perhaps not an Oni-.dat-file?') 310 else if ext = '.oldb' then 310 CrLf + 'Perhaps not an Oni-.dat-file?'); 311 end else if ext = '.oldb' then 312 begin 311 313 if not CreateDataConnection(opend.FileName, ODB_ADB) then 312 314 ShowMessage('Error while loading the file:' + CrLf + opend.FileName + 313 CrLf + 'Perhaps not an OniUnPacker-LevelDatabase-file?') 314 e lse315 CrLf + 'Perhaps not an OniUnPacker-LevelDatabase-file?'); 316 end else 315 317 ShowMessage('Incompatible file'); 316 318 AppSettings.DatPath := ExtractFilepath(opend.FileName); … … 394 396 procedure TForm_Main.menu_previewClick(Sender: TObject); 395 397 begin 396 open_child('preview' );398 open_child('preview', -1); 397 399 end; 398 400 … … 400 402 procedure TForm_Main.menu_txmpreplaceClick(Sender: TObject); 401 403 begin 402 open_child('txmpreplace' );404 open_child('txmpreplace', -1); 403 405 end; 404 406 … … 406 408 procedure TForm_Main.menu_bineditClick(Sender: TObject); 407 409 begin 408 open_child('binedit' );410 open_child('binedit', -1); 409 411 end; 410 412 … … 412 414 procedure TForm_Main.menu_raweditClick(Sender: TObject); 413 415 begin 414 open_child('rawedit' );416 open_child('rawedit', -1); 415 417 end; 416 418 … … 418 420 procedure TForm_Main.menu_extractorClick(Sender: TObject); 419 421 begin 420 open_child('extractor' );422 open_child('extractor', -1); 421 423 end; 422 424 … … 424 426 procedure TForm_Main.menu_filecompareClick(Sender: TObject); 425 427 begin 426 open_child('compare' );428 open_child('compare', -1); 427 429 end; 428 430 … … 515 517 516 518 517 function TForm_Main.open_child(window_context: String ): Boolean;519 function TForm_Main.open_child(window_context: String; fileid: Integer): Boolean; 518 520 var 519 form: TCustomForm;521 toolform: TForm_ToolTemplate; 520 522 i: Integer; 521 523 tag: Integer; … … 534 536 if window_context = 'binedit' then 535 537 begin 536 form := TForm_BinEdit.Create(Application); 537 TForm_BinEdit(form).Recreatelist; 538 form.Caption := 'Binary .dat-Editor ' + IntToStr(tag); 539 iconindex := 0; 538 toolform := TForm_BinEdit.Create(Self); 539 toolform.Caption := 'Binary .dat-Editor ' + IntToStr(tag); 540 iconindex := 0; 541 end; 542 if window_context = 'extractor' then 543 begin 544 toolform := TForm_Extractor.Create(Self); 545 toolform.Caption := 'Extractor ' + IntToStr(tag); 546 end; 547 if window_context = 'preview' then 548 begin 549 toolform := TForm_Preview.Create(Self); 550 toolform.Caption := 'Preview-Window ' + IntToStr(tag); 540 551 end; 541 552 if window_context = 'rawedit' then 542 553 begin 543 form := TForm_RawEdit.Create(Application); 544 TForm_RawEdit(form).Recreatelist; 545 form.Caption := 'Binary .raw-Editor ' + IntToStr(tag); 546 end; 547 if window_context = 'preview' then 548 begin 549 form := TForm_Preview.Create(Application); 550 TForm_Preview(form).Recreatelist; 551 form.Caption := 'Preview-Window ' + IntToStr(tag); 554 toolform := TForm_RawEdit.Create(Self); 555 toolform.Caption := 'Binary .raw-Editor ' + IntToStr(tag); 552 556 end; 553 557 if window_context = 'txmpreplace' then 554 558 begin 555 form := TForm_TxmpReplace.Create(Application); 556 TForm_TxmpReplace(form).Recreatelist; 557 form.Caption := 'TXMP Replacer ' + IntToStr(tag); 558 end; 559 if window_context = 'extractor' then 560 begin 561 form := TForm_Extractor.Create(Application); 562 TForm_Extractor(form).Recreatelist; 563 form.Caption := 'Extractor ' + IntToStr(tag); 564 end; 565 566 form.Name := window_context + IntToStr(tag); 567 form.Tag := tag; 568 569 MDITab.AddTab(TForm(form), iconindex); 559 toolform := TForm_TxmpReplace.Create(Application); 560 toolform.Caption := 'TXMP Replacer ' + IntToStr(tag); 561 end; 562 563 if Assigned(toolform) then 564 begin 565 toolform.Name := window_context + IntToStr(tag); 566 toolform.Tag := tag; 567 MDITab.AddTab(TForm(toolform), iconindex); 568 if fileid > -1 then 569 toolform.SelectFileID(fileid); 570 end; 570 571 end; 571 572 -
oup/current/OniUnPacker.dpr
r43 r45 7 7 Data in 'Data.pas', 8 8 Code_Exporters in 'Code_Exporters.pas', 9 Tool_Preview in 'Tool_Preview.pas' {Form_Preview},10 9 Code_OniImgClass in 'Code_OniImgClass.pas', 11 Tool_TxmpReplace in 'Tool_TxmpReplace.pas' {Form_TxmpReplace},12 Tool_BinEdit in 'Tool_BinEdit.pas' {Form_BinEdit},13 10 Code_DataStructures in 'Code_DataStructures.pas', 14 11 Helper_LevelDB in 'Helper_LevelDB.pas' {Form_LevelDB}, 15 Tool_Extractor in 'Tool_Extractor.pas' {Form_Extractor},16 12 Helper_ValueEdit in 'Helper_ValueEdit.pas' {Form_ValueEdit}, 17 Tool_RawEdit in 'Tool_RawEdit.pas' {Form_RawEdit},18 13 Settings in 'Settings.pas' {Form_Settings}, 19 14 ftypesAPI in 'TFileTypeRegistration\ftypesAPI.pas', 20 Code_OniDataClass in 'Code_OniDataClass.pas'; 15 Code_OniDataClass in 'Code_OniDataClass.pas', 16 Tool_Template in 'Tool_Template.pas' {Form_ToolTemplate}, 17 Tool_Preview in 'Tool_Preview.pas' {Form_Preview}, 18 Tool_BinEdit in 'Tool_BinEdit.pas' {Form_ToolTemplate2}, 19 Tool_Extractor in 'Tool_Extractor.pas' {Form_ToolTemplate3}, 20 Tool_RawEdit in 'Tool_RawEdit.pas' {Form_ToolTemplate4}, 21 Tool_TxmpReplace in 'Tool_TxmpReplace.pas' {Form_ToolTemplate5}; 21 22 22 23 {$R *.res} -
oup/current/Tool_BinEdit.dfm
r43 r45 1 object Form_BinEdit: TForm_BinEdit 2 Left = 0 3 Top = 0 4 BorderIcons = [biSystemMenu, biMaximize] 5 Caption = 'Binary .dat-Editor' 6 ClientHeight = 555 7 ClientWidth = 642 8 Color = clBtnFace 9 Font.Charset = DEFAULT_CHARSET 10 Font.Color = clWindowText 11 Font.Height = -11 12 Font.Name = 'Tahoma' 13 Font.Style = [] 14 FormStyle = fsMDIChild 15 KeyPreview = True 16 OldCreateOrder = False 17 Visible = True 18 WindowState = wsMaximized 19 OnClose = FormClose 1 inherited Form_BinEdit: TForm_BinEdit 2 Caption = 'BinEdit' 20 3 OnCloseQuery = FormCloseQuery 21 4 OnCreate = FormCreate 22 5 OnKeyUp = FormKeyUp 23 OnResize = FormResize24 6 PixelsPerInch = 96 25 7 TextHeight = 13 26 object Splitter1: TSplitter 27 Left = 200 28 Top = 0 29 Width = 9 30 Height = 555 31 AutoSnap = False 32 Beveled = True 33 MinSize = 150 34 ExplicitLeft = 150 35 ExplicitHeight = 423 36 end 37 object panel_data: TPanel 38 Left = 209 39 Top = 0 40 Width = 433 41 Height = 555 42 Align = alClient 43 BevelOuter = bvNone 44 TabOrder = 0 8 inherited panel_files: TPanel 9 inherited filelist: TListBox 10 ExplicitHeight = 256 11 end 12 end 13 inherited content: TPanel 45 14 object Splitter2: TSplitter 46 15 Left = 0 47 16 Top = 209 48 Width = 43317 Width = 283 49 18 Height = 9 50 19 Cursor = crVSplit … … 53 22 Beveled = True 54 23 MinSize = 40 55 ExplicitWidth = 4 8324 ExplicitWidth = 425 56 25 end 57 26 object Splitter3: TSplitter 58 27 Left = 0 59 Top = 45060 Width = 43328 Top = 318 29 Width = 283 61 30 Height = 8 62 31 Cursor = crVSplit … … 65 34 Beveled = True 66 35 MinSize = 40 67 ExplicitTop = 375 68 ExplicitWidth = 483 36 ExplicitLeft = -9 37 ExplicitTop = 430 38 ExplicitWidth = 425 69 39 end 70 40 object hex: TMPHexEditor 71 41 Left = 0 72 42 Top = 0 73 Width = 43343 Width = 283 74 44 Height = 209 75 45 Cursor = crIBeam … … 111 81 Left = 0 112 82 Top = 218 113 Width = 433114 Height = 23283 Width = 283 84 Height = 100 115 85 Align = alClient 116 86 ColCount = 1 … … 128 98 object VST: TVirtualStringTree 129 99 Left = 0 130 Top = 458131 Width = 433100 Top = 326 101 Width = 283 132 102 Height = 97 133 103 Align = alBottom … … 221 191 end 222 192 end 223 object panel_files: TPanel 224 Left = 0 225 Top = 0 226 Width = 200 227 Height = 555 228 Align = alLeft 229 BevelOuter = bvNone 230 TabOrder = 1 231 object Bevel1: TBevel 232 Left = 0 233 Top = 491 234 Width = 200 235 Height = 6 236 Align = alBottom 237 Style = bsRaised 238 ExplicitTop = 359 239 ExplicitWidth = 150 240 end 241 object list: TListBox 242 Left = 0 243 Top = 0 244 Width = 200 245 Height = 388 246 Align = alClient 247 ItemHeight = 13 248 TabOrder = 0 249 OnClick = listClick 250 OnMouseDown = listMouseDown 251 end 252 object panel_extension: TPanel 253 Left = 0 254 Top = 388 255 Width = 200 256 Height = 103 257 Align = alBottom 258 BevelOuter = bvNone 259 TabOrder = 1 260 OnResize = panel_extensionResize 261 object lbl_filter: TLabel 262 Left = 2 263 Top = 62 264 Width = 100 265 Height = 17 266 AutoSize = False 267 Caption = 'Filter by &extension:' 268 FocusControl = combo_extension 269 end 270 object combo_extension: TComboBox 271 Left = 2 272 Top = 76 273 Width = 145 274 Height = 21 275 Style = csDropDownList 276 DropDownCount = 12 277 Font.Charset = DEFAULT_CHARSET 278 Font.Color = clWindowText 279 Font.Height = -11 280 Font.Name = 'Tahoma' 281 Font.Style = [] 282 ItemHeight = 13 283 ParentFont = False 284 Sorted = True 285 TabOrder = 3 286 OnClick = combo_extensionClick 287 end 288 object check_zerobyte: TCheckBox 289 Left = 2 290 Top = 44 291 Width = 130 292 Height = 13 293 Caption = 'Show &zero-byte files' 294 TabOrder = 2 295 OnClick = check_zerobyteClick 296 end 297 object edit_filtername: TEdit 298 Left = 2 299 Top = 20 300 Width = 145 301 Height = 18 302 AutoSize = False 303 TabOrder = 1 304 end 305 object check_filtername: TCheckBox 306 Left = 2 307 Top = 5 308 Width = 130 309 Height = 15 310 Caption = 'Filter by file&name:' 311 TabOrder = 0 312 OnClick = check_filternameClick 313 end 314 end 315 object panel_imexport: TPanel 316 Left = 0 317 Top = 497 318 Width = 200 319 Height = 58 320 Align = alBottom 321 BevelOuter = bvNone 322 TabOrder = 2 323 OnResize = panel_imexportResize 324 object btn_export: TButton 325 Left = 4 326 Top = 4 327 Width = 142 328 Height = 25 329 Caption = 'Export to file...' 330 TabOrder = 0 331 OnClick = btn_exportClick 332 end 333 object btn_import: TButton 334 Left = 4 335 Top = 32 336 Width = 142 337 Height = 25 338 Caption = 'Import from file...' 339 TabOrder = 1 340 OnClick = btn_importClick 341 end 342 end 343 end 344 object opend: TOpenDialog 345 Options = [ofPathMustExist, ofFileMustExist, ofEnableSizing] 346 Left = 120 347 Top = 392 348 end 349 object saved: TSaveDialog 350 Options = [ofOverwritePrompt, ofPathMustExist, ofEnableSizing] 351 Left = 120 352 Top = 368 353 end 354 object value_viewer_context: TPopupMenu 193 object value_viewer_context: TPopupMenu [3] 355 194 AutoHotkeys = maManual 356 195 OnPopup = value_viewer_contextPopup 357 Left = 2 40358 Top = 2 48196 Left = 280 197 Top = 232 359 198 object value_viewer_context_copy: TMenuItem 360 199 Caption = 'Copy to &clipboard' … … 382 221 end 383 222 end 384 object VTHPopup: TVTHeaderPopupMenu 223 object VTHPopup: TVTHeaderPopupMenu [4] 385 224 OnColumnChange = VTHPopupColumnChange 386 Left = 2 00387 Top = 496225 Left = 272 226 Top = 376 388 227 end 389 228 end -
oup/current/Tool_BinEdit.pas
r43 r45 1 1 unit Tool_BinEdit; 2 3 2 interface 4 5 3 uses 6 4 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 7 Dialogs, Wrapgrid, StdCtrls, Grids, StrUtils, MPHexEditor, ExtCtrls, Clipbrd,8 Data, Code_Functions, Code_DataStructures, Code_Exporters, Code_OniDataClass,9 Menus, Math, VirtualTrees, VTHeaderPopup;5 Dialogs, Tool_Template, StdCtrls, ExtCtrls, VirtualTrees, Grids, Wrapgrid, 6 MPHexEditor, VTHeaderPopup, Menus, StrUtils, Clipbrd, 7 Data, Code_OniDataClass, Code_Functions, Code_DataStructures, Code_Exporters; 10 8 11 9 type 12 TForm_BinEdit = class(TForm) 13 Splitter1: TSplitter; 14 panel_data: TPanel; 15 hex: TMPHexEditor; 10 TForm_BinEdit = class(TForm_ToolTemplate) 11 hex: TMPHexEditor; 16 12 Splitter2: TSplitter; 17 panel_files: TPanel;18 list: TListBox;19 panel_extension: TPanel;20 lbl_filter: TLabel;21 combo_extension: TComboBox;22 Bevel1: TBevel;23 panel_imexport: TPanel;24 btn_export: TButton;25 btn_import: TButton;26 opend: TOpenDialog;27 saved: TSaveDialog;28 13 value_viewer: TWrapGrid; 14 VST: TVirtualStringTree; 29 15 Splitter3: TSplitter; 30 16 value_viewer_context: TPopupMenu; 31 17 value_viewer_context_copy: TMenuItem; 32 value_viewer_context_copyashex: TMenuItem;33 18 value_viewer_context_copyasdec: TMenuItem; 34 19 value_viewer_context_copyasfloat: TMenuItem; 35 20 value_viewer_context_copyasbitset: TMenuItem; 36 21 value_viewer_context_copyasstring: TMenuItem; 37 check_zerobyte: TCheckBox; 38 edit_filtername: TEdit; 39 check_filtername: TCheckBox; 40 VST: TVirtualStringTree; 22 value_viewer_context_copyashex: TMenuItem; 41 23 VTHPopup: TVTHeaderPopupMenu; 24 procedure FormCreate(Sender: TObject); 25 procedure NewFile(fileinfo: TFileInfo); 26 27 procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); 28 procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); 29 30 procedure hexKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); 31 procedure hexSelectionChanged(Sender: TObject); 32 procedure hexChange(Sender: TObject); 33 34 procedure LoadDat(_fileid: LongWord); 35 function Save: Boolean; 36 function GetValue(datatype: Word; offset: LongWord): String; 37 procedure SetNewValue(datatype: Word; offset: LongWord; Value: String); 38 39 procedure WriteStructureInfos; 40 procedure ClearStructViewer; 41 procedure VSTDblClick(Sender: TObject); 42 42 procedure VSTFocusChanged(Sender: TBaseVirtualTree; Node: PVirtualNode; 43 43 Column: TColumnIndex); 44 procedure VSTDblClick(Sender: TObject);45 44 procedure VTHPopupColumnChange(const Sender: TBaseVirtualTree; 46 45 const Column: TColumnIndex; Visible: Boolean); … … 49 48 procedure VSTGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; 50 49 Column: TColumnIndex; TextType: TVSTTextType; var CellText: WideString); 51 procedure hexKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); 52 procedure LoadDat(_fileid: LongWord); 53 procedure LoadFileNames; 54 procedure check_filternameClick(Sender: TObject); 55 procedure check_zerobyteClick(Sender: TObject); 56 procedure combo_extensionClick(Sender: TObject); 57 procedure panel_extensionResize(Sender: TObject); 58 procedure listClick(Sender: TObject); 59 procedure Recreatelist; 60 61 procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); 50 51 procedure ClearValues; 52 procedure WriteValues; 62 53 procedure value_viewerDblClick(Sender: TObject); 63 54 procedure value_viewer_context_copyClick(Sender: TObject); … … 65 56 Shift: TShiftState; X, Y: Integer); 66 57 procedure value_viewer_contextPopup(Sender: TObject); 67 procedure btn_importClick(Sender: TObject);68 procedure btn_exportClick(Sender: TObject);69 procedure panel_imexportResize(Sender: TObject);70 function Save: Boolean;71 procedure FormClose(Sender: TObject; var Action: TCloseAction);72 function GetValue(datatype: Word; offset: LongWord): String;73 procedure WriteStructureInfos; //(structinfoid:Integer);74 procedure hexSelectionChanged(Sender: TObject);75 procedure hexChange(Sender: TObject);76 procedure FormResize(Sender: TObject);77 procedure ClearStructViewer;78 procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);79 procedure FormCreate(Sender: TObject);80 procedure ClearValues;81 procedure WriteValues;82 procedure SetNewValue(datatype: Word; offset: LongWord; Value: String);83 procedure listMouseDown(Sender: TObject; Button: TMouseButton;84 Shift: TShiftState; X, Y: Integer);85 58 private 86 59 fileid: LongWord; … … 93 66 implementation 94 67 68 uses Helper_ValueEdit, Main, Tool_RawEdit; 95 69 {$R *.dfm} 96 97 uses Main, Helper_ValueEdit, Tool_Rawedit;98 70 99 71 type … … 110 82 111 83 84 procedure TForm_BinEdit.FormCreate(Sender: TObject); 85 begin 86 inherited; 87 Self.OnNewFileSelected := NewFile; 88 89 Self.Caption := ''; 90 fileid := 0; 91 VST.NodeDataSize := SizeOf(TNodeData); 92 value_viewer.ColCount := 2; 93 value_viewer.RowCount := 8; 94 value_viewer.FixedRows := 1; 95 value_viewer.Cells[0, 0] := 'Type'; 96 value_viewer.Cells[1, 0] := 'Value'; 97 value_viewer.Cells[0, 1] := '1 byte, unsigned'; 98 value_viewer.Cells[0, 2] := '2 bytes, unsigned'; 99 value_viewer.Cells[0, 3] := '4 bytes, unsigned'; 100 value_viewer.Cells[0, 4] := 'Bitset'; 101 value_viewer.Cells[0, 5] := 'Float'; 102 value_viewer.Cells[0, 6] := 'String'; 103 value_viewer.Cells[0, 7] := 'Selected length'; 104 // value_viewer.ColWidths[0] := 100; 105 // value_viewer.ColWidths[1] := value_viewer.Width - 150; 106 // hex.Height := content.Height - 215; 107 // 108 value_viewer.Font.Charset := AppSettings.CharSet; 109 VST.Font.Charset := AppSettings.CharSet; 110 hex.Translation := tkAsIs; 111 hex.Font.Charset := AppSettings.CharSet; 112 // 113 end; 114 115 procedure TForm_BinEdit.NewFile(fileinfo: TFileInfo); 116 begin 117 LoadDat(fileinfo.ID); 118 end; 119 120 121 112 122 113 123 function AddVSTEntry(AVST: TCustomVirtualStringTree; ANode: PVirtualNode; … … 127 137 procedure TForm_BinEdit.LoadDat(_fileid: LongWord); 128 138 var 129 i: LongWord;130 139 mem: TMemoryStream; 131 140 Data: Tdata; … … 135 144 if not Save then 136 145 begin 137 for i := 0 to list.Count - 1 do 138 begin 139 if OniDataConnection.ExtractFileID(list.Items.Strings[i]) = fileid then 140 begin 141 list.ItemIndex := i; 142 Exit; 143 end; 144 end; 146 Self.SelectFileID(fileid); 147 Exit; 145 148 end; 146 149 end; 147 150 fileid := _fileid; 148 for i := 0 to list.Count - 1 do 149 if OniDataConnection.ExtractFileID(list.Items.Strings[i]) = fileid then 150 begin 151 list.ItemIndex := i; 152 Break; 153 end; 151 if OniDataConnection.ExtractFileID( 152 filelist.Items.Strings[filelist.ItemIndex]) <> fileid then 153 Self.SelectFileID(fileid); 154 154 Self.ClearStructViewer; 155 155 Data := OniDataConnection.LoadDatFile(fileid); … … 172 172 173 173 174 175 procedure TForm_BinEdit.Recreatelist;176 var177 i: LongWord;178 exts: TStringArray;179 begin180 combo_extension.Items.Clear;181 combo_extension.Items.Add('_All files_ (' + IntToStr(182 OniDataConnection.GetFilesCount) + ')');183 exts := OniDataConnection.GetExtensionsList;184 for i := 0 to High(exts) do185 combo_extension.Items.Add(exts[i]);186 combo_extension.ItemIndex := 0;187 combo_extensionClick(Self);188 end;189 190 191 192 193 procedure TForm_BinEdit.LoadFileNames;194 var195 Extension: String[4];196 no_zero_bytes: Boolean;197 pattern: String;198 files: TStringArray;199 i: LongWord;200 begin201 Extension := MidStr(combo_extension.Items.Strings[combo_extension.ItemIndex], 1, 4);202 no_zero_bytes := not check_zerobyte.Checked;203 pattern := '';204 if check_filtername.Checked then205 pattern := edit_filtername.Text;206 if Extension = '_All' then207 Extension := '';208 209 files := OniDataConnection.GetFilesList(extension, pattern, no_zero_bytes);210 list.Items.Clear;211 if Length(files) > 0 then212 for i := 0 to High(files) do213 list.Items.Add(files[i]);214 end;215 216 217 218 219 procedure TForm_BinEdit.panel_extensionResize(Sender: TObject);220 begin221 combo_extension.Width := panel_extension.Width - 5;222 edit_filtername.Width := panel_extension.Width - 5;223 end;224 225 226 227 228 procedure TForm_BinEdit.combo_extensionClick(Sender: TObject);229 begin230 LoadFileNames;231 end;232 233 234 235 236 procedure TForm_BinEdit.check_zerobyteClick(Sender: TObject);237 begin238 LoadFileNames;239 end;240 241 242 243 244 procedure TForm_BinEdit.check_filternameClick(Sender: TObject);245 begin246 edit_filtername.Enabled := not check_filtername.Checked;247 LoadFileNames;248 end;249 250 251 252 253 procedure TForm_BinEdit.listClick(Sender: TObject);254 begin255 LoadDat(OniDataConnection.ExtractFileID(list.Items.Strings[list.ItemIndex]));256 end;257 258 259 260 261 procedure TForm_BinEdit.listMouseDown(Sender: TObject; Button: TMouseButton;262 Shift: TShiftState; X, Y: Integer);263 var264 pt: TPoint;265 begin266 pt.X := x;267 pt.Y := y;268 list.ItemIndex := list.ItemAtPos(pt, true);269 if list.ItemIndex > -1 then270 Self.listClick(Self);271 end;272 174 273 175 function IntToBin(Value: Byte): String; … … 588 490 589 491 590 procedure TForm_BinEdit.FormCreate(Sender: TObject);591 begin592 Self.Caption := '';593 fileid := 0;594 VST.NodeDataSize := SizeOf(TNodeData);595 value_viewer.ColCount := 2;596 value_viewer.RowCount := 8;597 value_viewer.FixedRows := 1;598 value_viewer.Cells[0, 0] := 'Type';599 value_viewer.Cells[1, 0] := 'Value';600 value_viewer.Cells[0, 1] := '1 byte, unsigned';601 value_viewer.Cells[0, 2] := '2 bytes, unsigned';602 value_viewer.Cells[0, 3] := '4 bytes, unsigned';603 value_viewer.Cells[0, 4] := 'Bitset';604 value_viewer.Cells[0, 5] := 'Float';605 value_viewer.Cells[0, 6] := 'String';606 value_viewer.Cells[0, 7] := 'Selected length';607 value_viewer.ColWidths[0] := 100;608 value_viewer.ColWidths[1] := value_viewer.Width - 150;609 hex.Height := panel_data.Height - 215;610 //611 value_viewer.Font.Charset := AppSettings.CharSet;612 VST.Font.Charset := AppSettings.CharSet;613 hex.Translation := tkAsIs;614 hex.Font.Charset := AppSettings.CharSet;615 //616 end;617 618 619 620 621 492 function TForm_BinEdit.Save: Boolean; 622 493 var … … 672 543 673 544 674 675 676 procedure TForm_BinEdit.FormResize(Sender: TObject);677 begin678 if Self.Width >= 650 then679 begin680 end681 else682 Self.Width := 650;683 if Self.Height >= 450 then684 begin685 end686 else687 Self.Height := 450;688 end;689 545 690 546 … … 767 623 768 624 769 procedure TForm_BinEdit.FormClose(Sender: TObject; var Action: TCloseAction);770 begin771 Action := caFree;772 end;773 774 775 776 777 procedure TForm_BinEdit.panel_imexportResize(Sender: TObject);778 begin779 btn_import.Width := panel_imexport.Width - 8;780 btn_export.Width := panel_imexport.Width - 8;781 end;782 783 784 785 786 procedure TForm_BinEdit.btn_exportClick(Sender: TObject);787 begin788 saved.Filter := 'Files of matching extension (*.' + OniDataConnection.GetFileInfo(789 fileid).Extension + ')|*.' + OniDataConnection.GetFileInfo(fileid).Extension +790 '|All files|*.*';791 saved.DefaultExt := OniDataConnection.GetFileInfo(fileid).Extension;792 if saved.Execute then793 begin794 ExportDatFile(fileid, saved.FileName);795 end;796 end;797 798 799 800 801 procedure TForm_BinEdit.btn_importClick(Sender: TObject);802 var803 fs: TFileStream;804 begin805 opend.Filter := 'Files of matching extension (*.' + OniDataConnection.GetFileInfo(806 fileid).Extension + ')|*.' + OniDataConnection.GetFileInfo(fileid).Extension +807 '|All files|*.*';808 if opend.Execute then809 begin810 fs := TFileStream.Create(opend.FileName, fmOpenRead);811 if fs.Size <> hex.DataSize then812 begin813 ShowMessage('Can''t import ' + ExtractFilename(opend.FileName) +814 ', file has to have same size as file in .dat.' + CrLf +815 'Size of file in .dat: ' + FormatFileSize(hex.datasize) + CrLf +816 'Size of chosen file: ' + FormatFileSize(fs.Size));817 end818 else819 begin820 hex.LoadFromStream(fs);821 hex.Modified := True;822 end;823 fs.Free;824 end;825 end;826 827 828 829 830 625 procedure TForm_BinEdit.value_viewer_contextPopup(Sender: TObject); 831 626 var … … 964 759 begin 965 760 if OniDataConnection.GetRawInfo(fileid, nodedata.offset).raw_size > 0 then 966 begin 967 if Form_Main.open_child('rawedit') then 968 begin 969 TForm_RawEdit(Form_Main.ActiveMDIChild).LoadRaw( 970 OniDataConnection.GetRawInfo(fileid, nodedata.offset)); 971 end; 972 end; 761 Form_Main.open_child('rawedit', fileid); 973 762 end; 974 763 if nodedata.DataType = 12 then … … 979 768 begin 980 769 if OniDataConnection.GetFileInfo(StrToInt(nodedata.Value)).Size > 0 then 981 begin 982 if Form_Main.open_child('binedit') then 983 begin 984 TForm_BinEdit(Form_Main.ActiveMDIChild).LoadDat(StrToInt(nodedata.Value)); 985 end; 986 end 770 Form_Main.open_child('binedit', StrToInt(nodedata.Value)) 987 771 else 988 begin989 772 ShowMessage('Linked filed is a zero-byte-file'); 990 end;991 773 end; 992 774 end; 993 775 if (nodedata.DataType >= 100) and (nodedata.DataType <= 300) then 994 776 begin 995 if Form_Main.open_child('binedit' ) then777 if Form_Main.open_child('binedit', -1) then 996 778 begin 997 779 TForm_BinEdit(Form_Main.ActiveMDIChild).edit_filtername.Text := nodedata.Value; … … 1196 978 1197 979 980 begin 981 AddToolListEntry('binedit', 'Binary .dat-Editor', ''); 1198 982 end. -
oup/current/Tool_Extractor.dfm
r43 r45 1 object Form_Extractor: TForm_Extractor 2 Left = 0 3 Top = 0 1 inherited Form_Extractor: TForm_Extractor 4 2 Caption = 'Extractor' 5 ClientHeight = 3986 ClientWidth = 5267 Color = clBtnFace8 Font.Charset = DEFAULT_CHARSET9 Font.Color = clWindowText10 Font.Height = -1111 Font.Name = 'Tahoma'12 Font.Style = []13 FormStyle = fsMDIChild14 OldCreateOrder = False15 Visible = True16 WindowState = wsMaximized17 OnClose = FormClose18 3 OnCreate = FormCreate 19 OnResize = FormResize 4 ExplicitWidth = 320 5 ExplicitHeight = 240 20 6 PixelsPerInch = 96 21 7 TextHeight = 13 22 object group_select: TGroupBox 23 Left = 0 24 Top = 0 25 Width = 230 26 Height = 398 8 inherited Splitter1: TSplitter 9 Left = 483 10 Align = alRight 11 Visible = False 12 ExplicitLeft = 172 13 ExplicitTop = -8 14 ExplicitHeight = 423 15 end 16 inherited panel_files: TPanel 17 Width = 184 27 18 Align = alClient 28 Caption = '1. Select file(s)' 29 TabOrder = 0 30 ExplicitWidth = 191 31 object panel_extension: TPanel 32 Left = 2 33 Top = 293 34 Width = 226 35 Height = 103 36 Align = alBottom 37 BevelOuter = bvNone 19 ExplicitWidth = 184 20 inherited filelist: TListBox 21 Width = 184 22 ExplicitWidth = 184 23 end 24 inherited panel_extension: TPanel 25 Width = 184 26 ExplicitWidth = 184 27 inherited combo_extension: TComboBox 28 Width = 176 29 ExplicitWidth = 176 30 end 31 inherited edit_filtername: TEdit 32 Width = 176 33 ExplicitWidth = 176 34 end 35 end 36 end 37 inherited content: TPanel 38 Left = 184 39 Width = 299 40 Align = alRight 41 ExplicitLeft = 184 42 ExplicitWidth = 299 43 object group_extract: TGroupBox 44 Left = 3 45 Top = 0 46 Width = 296 47 Height = 423 48 Align = alRight 49 Caption = '2. Select extract-method' 38 50 TabOrder = 0 39 OnResize = panel_extensionResize 40 ExplicitWidth = 187 41 object lbl_filter: TLabel 42 Left = 2 43 Top = 62 44 Width = 100 45 Height = 17 46 AutoSize = False 47 Caption = 'Filter by &extension:' 48 FocusControl = combo_extension 49 end 50 object combo_extension: TComboBox 51 Left = 2 52 Top = 76 53 Width = 145 54 Height = 21 55 Style = csDropDownList 56 DropDownCount = 12 57 Font.Charset = DEFAULT_CHARSET 58 Font.Color = clWindowText 59 Font.Height = -11 60 Font.Name = 'Tahoma' 61 Font.Style = [] 62 ItemHeight = 13 63 ParentFont = False 64 Sorted = True 65 TabOrder = 3 66 OnClick = combo_extensionClick 67 end 68 object check_zerobyte: TCheckBox 69 Left = 2 70 Top = 44 71 Width = 130 72 Height = 13 73 Caption = 'Show &zero-byte files' 74 TabOrder = 2 75 OnClick = check_zerobyteClick 76 end 77 object edit_filtername: TEdit 78 Left = 2 79 Top = 20 80 Width = 145 81 Height = 18 82 AutoSize = False 83 TabOrder = 1 84 end 85 object check_filtername: TCheckBox 86 Left = 2 87 Top = 5 88 Width = 130 89 Height = 15 90 Caption = 'Filter by file&name:' 91 TabOrder = 0 92 OnClick = check_filternameClick 93 end 94 end 95 object list: TListBox 96 Left = 2 97 Top = 15 98 Width = 226 99 Height = 278 100 Align = alClient 101 ItemHeight = 13 102 MultiSelect = True 103 TabOrder = 1 104 ExplicitWidth = 187 105 end 106 end 107 object group_extract: TGroupBox 108 Left = 230 109 Top = 0 110 Width = 296 111 Height = 398 112 Align = alRight 113 Caption = '2. Select extract-method' 114 TabOrder = 1 115 ExplicitLeft = 191 116 object group_singlefiles: TGroupBox 117 Left = 8 118 Top = 16 119 Width = 281 120 Height = 185 121 Caption = 'Write data into single files' 122 TabOrder = 0 123 object btn_sel_dat: TButton 51 object group_singlefiles: TGroupBox 52 AlignWithMargins = True 124 53 Left = 8 125 54 Top = 16 126 Width = 129 127 Height = 49 128 Caption = 'Selected files (dat contents only)' 55 Width = 280 56 Height = 185 57 Margins.Left = 6 58 Margins.Top = 1 59 Margins.Right = 6 60 Align = alTop 61 Caption = 'Write data into single files' 129 62 TabOrder = 0 130 WordWrap = True 131 OnClick = Extract 132 end 133 object btn_sel_datraw: TButton 63 object btn_sel_dat: TButton 64 Left = 8 65 Top = 16 66 Width = 129 67 Height = 49 68 Caption = 'Selected files (dat contents only)' 69 TabOrder = 0 70 WordWrap = True 71 OnClick = Extract 72 end 73 object btn_sel_datraw: TButton 74 Left = 8 75 Top = 72 76 Width = 129 77 Height = 49 78 Caption = 'Selected files (dat+raw)' 79 TabOrder = 1 80 WordWrap = True 81 OnClick = Extract 82 end 83 object btn_sel_datraw_convert: TButton 84 Left = 8 85 Top = 128 86 Width = 129 87 Height = 49 88 Caption = 'Selected files (dat+raw) (with convert if possible)' 89 TabOrder = 2 90 WordWrap = True 91 OnClick = Extract 92 end 93 object btn_all_dat: TButton 94 Left = 144 95 Top = 16 96 Width = 129 97 Height = 49 98 Caption = 'All files in list (dat contents only)' 99 TabOrder = 3 100 WordWrap = True 101 OnClick = Extract 102 end 103 object btn_all_datraw: TButton 104 Left = 144 105 Top = 72 106 Width = 129 107 Height = 49 108 Caption = 'All files in list (dat+raw)' 109 TabOrder = 4 110 WordWrap = True 111 OnClick = Extract 112 end 113 object btn_all_datraw_convert: TButton 114 Left = 144 115 Top = 128 116 Width = 129 117 Height = 49 118 BiDiMode = bdLeftToRight 119 Caption = 'All files in list (dat+raw) (with convert if possible)' 120 ParentBiDiMode = False 121 TabOrder = 5 122 WordWrap = True 123 OnClick = Extract 124 end 125 end 126 object group_onefile: TGroupBox 127 AlignWithMargins = True 134 128 Left = 8 135 Top = 72 136 Width = 129 137 Height = 49 138 Caption = 'Selected files (dat+raw)' 129 Top = 205 130 Width = 280 131 Height = 73 132 Margins.Left = 6 133 Margins.Top = 1 134 Margins.Right = 6 135 Align = alTop 136 Caption = 'Write data into one file' 139 137 TabOrder = 1 140 WordWrap = True 141 OnClick = Extract 142 end 143 object btn_sel_datraw_convert: TButton 138 object btn_sel_files_toone: TButton 139 Left = 8 140 Top = 16 141 Width = 129 142 Height = 49 143 Caption = 'Selected files (dat contents only)' 144 TabOrder = 0 145 WordWrap = True 146 OnClick = Extract 147 end 148 object btn_all_files_toone: TButton 149 Left = 144 150 Top = 16 151 Width = 129 152 Height = 49 153 Caption = 'All files in list (dat contents only)' 154 TabOrder = 1 155 WordWrap = True 156 OnClick = Extract 157 end 158 end 159 object group_progress: TGroupBox 160 AlignWithMargins = True 144 161 Left = 8 145 Top = 128 146 Width = 129 147 Height = 49 148 Caption = 'Selected files (dat+raw) (with convert if possible)' 162 Top = 282 163 Width = 280 164 Height = 132 165 Margins.Left = 6 166 Margins.Top = 1 167 Margins.Right = 6 168 Margins.Bottom = 7 169 Align = alClient 170 Caption = 'Progress ...' 149 171 TabOrder = 2 150 WordWrap = True 151 OnClick = Extract 152 end 153 object btn_all_dat: TButton 154 Left = 144 155 Top = 16 156 Width = 129 157 Height = 49 158 Caption = 'All files in list (dat contents only)' 159 TabOrder = 3 160 WordWrap = True 161 OnClick = Extract 162 end 163 object btn_all_datraw: TButton 164 Left = 144 165 Top = 72 166 Width = 129 167 Height = 49 168 Caption = 'All files in list (dat+raw)' 169 TabOrder = 4 170 WordWrap = True 171 OnClick = Extract 172 end 173 object btn_all_datraw_convert: TButton 174 Left = 144 175 Top = 128 176 Width = 129 177 Height = 49 178 BiDiMode = bdLeftToRight 179 Caption = 'All files in list (dat+raw) (with convert if possible)' 180 ParentBiDiMode = False 181 TabOrder = 5 182 WordWrap = True 183 OnClick = Extract 172 Visible = False 173 object lbl_progress: TLabel 174 Left = 8 175 Top = 40 176 Width = 265 177 Height = 17 178 AutoSize = False 179 Caption = 'Files done: 0/0' 180 end 181 object lbl_estimated: TLabel 182 Left = 8 183 Top = 56 184 Width = 265 185 Height = 17 186 AutoSize = False 187 Caption = 'Estimated finishing time: 00:00:00' 188 end 189 object progress: TProgressBar 190 Left = 8 191 Top = 16 192 Width = 265 193 Height = 17 194 Smooth = True 195 TabOrder = 0 196 end 197 object btn_abort: TButton 198 Left = 8 199 Top = 72 200 Width = 97 201 Height = 23 202 Caption = 'Abort' 203 Enabled = False 204 TabOrder = 1 205 OnClick = btn_abortClick 206 end 184 207 end 185 208 end 186 object group_onefile: TGroupBox 187 Left = 8 188 Top = 208 189 Width = 281 190 Height = 73 191 Caption = 'Write data into one file' 192 TabOrder = 1 193 object btn_sel_files_toone: TButton 194 Left = 8 195 Top = 16 196 Width = 129 197 Height = 49 198 Caption = 'Selected files (dat contents only)' 199 TabOrder = 0 200 WordWrap = True 201 OnClick = Extract 202 end 203 object btn_all_files_toone: TButton 204 Left = 144 205 Top = 16 206 Width = 129 207 Height = 49 208 Caption = 'All files in list (dat contents only)' 209 TabOrder = 1 210 WordWrap = True 211 OnClick = Extract 212 end 213 end 214 object group_progress: TGroupBox 215 Left = 8 216 Top = 288 217 Width = 281 218 Height = 105 219 Caption = 'Progress ...' 220 TabOrder = 2 221 Visible = False 222 object lbl_progress: TLabel 223 Left = 8 224 Top = 40 225 Width = 265 226 Height = 17 227 AutoSize = False 228 Caption = 'Files done: 0/0' 229 end 230 object lbl_estimated: TLabel 231 Left = 8 232 Top = 56 233 Width = 265 234 Height = 17 235 AutoSize = False 236 Caption = 'Estimated finishing time: 00:00:00' 237 end 238 object progress: TProgressBar 239 Left = 8 240 Top = 16 241 Width = 265 242 Height = 17 243 Smooth = True 244 TabOrder = 0 245 end 246 object btn_abort: TButton 247 Left = 8 248 Top = 72 249 Width = 97 250 Height = 23 251 Caption = 'Abort' 252 Enabled = False 253 TabOrder = 1 254 end 255 end 256 end 257 object saved: TSaveDialog 209 end 210 object saved: TSaveDialog [3] 258 211 Left = 448 259 212 Top = 328 -
oup/current/Tool_Extractor.pas
r43 r45 1 1 unit Tool_Extractor; 2 3 2 interface 4 5 3 uses 6 4 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 7 Dialogs, StdCtrls, ExtCtrls, StrUtils, ComCtrls;5 Dialogs, Tool_Template, StdCtrls, ExtCtrls, ComCtrls, Menus; 8 6 9 7 type 10 TForm_Extractor = class(TForm) 11 group_select: TGroupBox; 8 TForm_Extractor = class(TForm_ToolTemplate) 12 9 group_extract: TGroupBox; 13 10 group_singlefiles: TGroupBox; … … 18 15 btn_all_datraw: TButton; 19 16 btn_all_datraw_convert: TButton; 20 group_onefile: TGroupBox;21 17 btn_sel_files_toone: TButton; 22 18 btn_all_files_toone: TButton; 19 group_onefile: TGroupBox; 23 20 group_progress: TGroupBox; 24 progress: TProgressBar;25 21 lbl_progress: TLabel; 26 22 lbl_estimated: TLabel; 23 progress: TProgressBar; 27 24 btn_abort: TButton; 28 25 saved: TSaveDialog; 29 panel_extension: TPanel;30 lbl_filter: TLabel;31 combo_extension: TComboBox;32 check_zerobyte: TCheckBox;33 edit_filtername: TEdit;34 check_filtername: TCheckBox;35 list: TListBox;36 procedure LoadFileNames;37 procedure check_filternameClick(Sender: TObject);38 procedure check_zerobyteClick(Sender: TObject);39 procedure combo_extensionClick(Sender: TObject);40 procedure panel_extensionResize(Sender: TObject);41 procedure Recreatelist;42 43 26 procedure FormCreate(Sender: TObject); 44 procedure FormClose(Sender: TObject; var Action: TCloseAction);45 procedure FormResize(Sender: TObject);46 27 procedure Extract(Sender: TObject); 28 procedure btn_abortClick(Sender: TObject); 47 29 private 48 30 public … … 53 35 54 36 implementation 55 56 37 {$R *.dfm} 57 58 38 uses Main, Code_Functions, Data, Code_OniDataClass; 59 60 61 62 63 procedure TForm_Extractor.Recreatelist;64 var65 i: LongWord;66 exts: TStringArray;67 begin68 combo_extension.Items.Clear;69 combo_extension.Items.Add('_All files_ (' + IntToStr(70 OniDataConnection.GetFilesCount) + ')');71 exts := OniDataConnection.GetExtensionsList;72 for i := 0 to High(exts) do73 combo_extension.Items.Add(exts[i]);74 combo_extension.ItemIndex := 0;75 combo_extensionClick(Self);76 end;77 78 79 80 81 procedure TForm_Extractor.LoadFileNames;82 var83 Extension: String[4];84 no_zero_bytes: Boolean;85 pattern: String;86 files: TStringArray;87 i: LongWord;88 begin89 Extension := MidStr(combo_extension.Items.Strings[combo_extension.ItemIndex], 1, 4);90 no_zero_bytes := not check_zerobyte.Checked;91 pattern := '';92 if check_filtername.Checked then93 pattern := edit_filtername.Text;94 if Extension = '_All' then95 Extension := '';96 97 files := OniDataConnection.GetFilesList(extension, pattern, no_zero_bytes);98 list.Items.Clear;99 if Length(files) > 0 then100 for i := 0 to High(files) do101 list.Items.Add(files[i]);102 end;103 104 105 106 107 procedure TForm_Extractor.panel_extensionResize(Sender: TObject);108 begin109 combo_extension.Width := panel_extension.Width - 5;110 edit_filtername.Width := panel_extension.Width - 5;111 end;112 113 114 115 116 procedure TForm_Extractor.combo_extensionClick(Sender: TObject);117 begin118 LoadFileNames;119 end;120 121 122 123 124 procedure TForm_Extractor.check_zerobyteClick(Sender: TObject);125 var126 i: Byte;127 begin128 LoadFileNames;129 end;130 131 132 133 134 procedure TForm_Extractor.check_filternameClick(Sender: TObject);135 begin136 edit_filtername.Enabled := not check_filtername.Checked;137 LoadFileNames;138 end;139 140 141 142 143 procedure TForm_Extractor.FormResize(Sender: TObject);144 begin145 if Self.Width >= 450 then146 begin147 end148 else149 Self.Width := 450;150 if Self.Height >= 400 then151 begin152 group_progress.Height := group_extract.Height - 293;153 end154 else155 Self.Height := 400;156 end;157 158 159 160 161 procedure TForm_Extractor.FormClose(Sender: TObject; var Action: TCloseAction);162 begin163 Action := caFree;164 end;165 166 167 168 39 169 40 procedure TForm_Extractor.FormCreate(Sender: TObject); 170 41 begin 42 inherited; 43 Self.AllowMultiSelect := True; 44 171 45 btn_sel_dat.Caption := 'Selected files' + CrLf + '(dat contents only)'; 172 46 btn_sel_datraw.Caption := 'Selected files' + CrLf + '(dat+raw contents)'; … … 181 55 end; 182 56 183 184 57 procedure TForm_Extractor.btn_abortClick(Sender: TObject); 58 begin 59 ShowMessage('X'); 60 end; 185 61 186 62 procedure TForm_Extractor.Extract(Sender: TObject); … … 213 89 begintime := Time; 214 90 group_progress.Visible := True; 215 group_select.Enabled := False;91 panel_files.Enabled := False; 216 92 group_singlefiles.Enabled := False; 217 93 group_onefile.Enabled := False; … … 230 106 begin 231 107 group_progress.Visible := False; 232 group_select.Enabled := True;108 panel_files.Enabled := True; 233 109 group_singlefiles.Enabled := True; 234 110 group_onefile.Enabled := True; … … 242 118 if sel_only then 243 119 begin 244 files := list.SelCount;120 files := filelist.SelCount; 245 121 lbl_progress.Caption := 'Files done: 0/' + IntToStr(files); 246 122 progress.Max := files; 247 123 done := 0; 248 for i := 0 to list.Count - 1 do124 for i := 0 to filelist.Count - 1 do 249 125 begin 250 if list.Selected[i] then126 if filelist.Selected[i] then 251 127 begin 252 128 if one_file then 253 129 begin 254 130 ExportFile(OniDataConnection.ExtractFileID( 255 list.Items.Strings[list.ItemIndex]), ExtractFileName(saved.FileName),131 filelist.Items.Strings[filelist.ItemIndex]), ExtractFileName(saved.FileName), 256 132 settings, ExtractFileDir(saved.FileName)); 257 133 end … … 259 135 begin 260 136 ExportFile(OniDataConnection.ExtractFileID( 261 list.Items.Strings[list.ItemIndex]),list.Items.Strings[i], settings, 'D:');137 filelist.Items.Strings[filelist.ItemIndex]), filelist.Items.Strings[i], settings, 'D:'); 262 138 end; 263 139 Inc(done); … … 276 152 else 277 153 begin 278 files := list.Count;154 files := filelist.Count; 279 155 lbl_progress.Caption := 'Files done: 0/' + IntToStr(files); 280 156 progress.Max := files; 281 for i := 0 to list.Count - 1 do157 for i := 0 to filelist.Count - 1 do 282 158 begin 283 159 if one_file then 284 160 begin 285 161 ExportFile(OniDataConnection.ExtractFileID( 286 list.Items.Strings[list.ItemIndex]), ExtractFileName(saved.FileName),162 filelist.Items.Strings[filelist.ItemIndex]), ExtractFileName(saved.FileName), 287 163 settings, ExtractFileDir(saved.FileName)); 288 164 end … … 290 166 begin 291 167 ExportFile(OniDataConnection.ExtractFileID( 292 list.Items.Strings[list.ItemIndex]),list.Items.Strings[i], settings, 'D:');168 filelist.Items.Strings[filelist.ItemIndex]), filelist.Items.Strings[i], settings, 'D:'); 293 169 end; 294 170 if ((i mod 10) = 0) and (i >= 50) then … … 304 180 end; 305 181 group_progress.Visible := False; 306 group_select.Enabled := True;182 panel_files.Enabled := True; 307 183 group_singlefiles.Enabled := True; 308 184 group_onefile.Enabled := True; … … 310 186 end; 311 187 188 begin 189 AddToolListEntry('extractor', 'Extractor', ''); 312 190 end. -
oup/current/Tool_Preview.dfm
r43 r45 1 object Form_Preview: TForm_Preview 2 Left = 0 3 Top = 0 1 inherited Form_Preview: TForm_Preview 4 2 Caption = 'Preview' 5 ClientHeight = 4736 ClientWidth = 4727 Color = clBtnFace8 Font.Charset = DEFAULT_CHARSET9 Font.Color = clWindowText10 Font.Height = -1111 Font.Name = 'Tahoma'12 Font.Style = []13 FormStyle = fsMDIChild14 OldCreateOrder = False15 Visible = True16 WindowState = wsMaximized17 OnClose = FormClose18 3 OnCreate = FormCreate 19 OnResize = FormResize 4 ExplicitWidth = 320 5 ExplicitHeight = 240 20 6 PixelsPerInch = 96 21 7 TextHeight = 13 22 object Splitter1: TSplitter 23 Left = 200 24 Top = 0 25 Width = 9 26 Height = 473 27 AutoSnap = False 28 Beveled = True 29 MinSize = 150 30 end 31 object panel_preview: TPanel 32 Left = 209 33 Top = 0 34 Width = 263 35 Height = 473 36 Align = alClient 37 BevelOuter = bvNone 38 TabOrder = 0 39 object img: TImage 40 Left = 0 41 Top = 20 42 Width = 263 43 Height = 453 44 Align = alClient 45 ExplicitWidth = 313 46 end 8 inherited content: TPanel 47 9 object lbl_notpossible: TLabel 48 10 Left = 16 … … 61 23 WordWrap = True 62 24 end 25 object img: TImage 26 Left = 0 27 Top = 20 28 Width = 283 29 Height = 403 30 Align = alClient 31 ExplicitWidth = 313 32 ExplicitHeight = 453 33 end 63 34 object panel_buttons: TPanel 64 35 Left = 0 65 36 Top = 0 66 Width = 2 6337 Width = 283 67 38 Height = 20 68 39 Align = alTop … … 102 73 end 103 74 end 104 object panel_files: TPanel 105 Left = 0 106 Top = 0 107 Width = 200 108 Height = 473 109 Align = alLeft 110 BevelOuter = bvNone 111 TabOrder = 1 112 object list: TListBox 113 Left = 0 114 Top = 0 115 Width = 200 116 Height = 370 117 Align = alClient 118 ItemHeight = 13 119 TabOrder = 0 120 OnClick = listClick 121 OnMouseDown = listMouseDown 122 end 123 object panel_extension: TPanel 124 Left = 0 125 Top = 370 126 Width = 200 127 Height = 103 128 Align = alBottom 129 BevelOuter = bvNone 130 TabOrder = 1 131 OnResize = panel_extensionResize 132 object lbl_filter: TLabel 133 Left = 2 134 Top = 62 135 Width = 100 136 Height = 17 137 AutoSize = False 138 Caption = 'Filter by &extension:' 139 FocusControl = combo_extension 140 end 141 object combo_extension: TComboBox 142 Left = 2 143 Top = 76 144 Width = 145 145 Height = 21 146 Style = csDropDownList 147 DropDownCount = 12 148 Font.Charset = DEFAULT_CHARSET 149 Font.Color = clWindowText 150 Font.Height = -11 151 Font.Name = 'Tahoma' 152 Font.Style = [] 153 ItemHeight = 13 154 ParentFont = False 155 Sorted = True 156 TabOrder = 3 157 OnClick = combo_extensionClick 158 end 159 object check_zerobyte: TCheckBox 160 Left = 2 161 Top = 44 162 Width = 130 163 Height = 13 164 Caption = 'Show &zero-byte files' 165 TabOrder = 2 166 OnClick = check_zerobyteClick 167 end 168 object edit_filtername: TEdit 169 Left = 2 170 Top = 20 171 Width = 145 172 Height = 18 173 AutoSize = False 174 TabOrder = 1 175 end 176 object check_filtername: TCheckBox 177 Left = 2 178 Top = 5 179 Width = 130 180 Height = 15 181 Caption = 'Filter by file&name:' 182 TabOrder = 0 183 OnClick = check_filternameClick 184 end 185 end 186 end 187 object timer: TTimer 75 object timer: TTimer [3] 188 76 Enabled = False 189 77 OnTimer = timerTimer 190 Left = 144191 Top = 2478 Left = 400 79 Top = 120 192 80 end 193 81 end -
oup/current/Tool_Preview.pas
r43 r45 1 1 unit Tool_Preview; 2 3 2 interface 4 5 3 uses 6 4 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 7 Dialogs, Math, ExtCtrls, StdCtrls, StrUtils, Menus,8 Code_ Functions, Data, Code_Exporters, Code_OniImgClass, Code_OniDataClass;5 Dialogs, StdCtrls, Tool_Template, ExtCtrls, Math, StrUtils, 6 Code_OniDataClass, Code_OniImgClass, Data, Menus; 9 7 10 8 type 11 TForm_Preview = class(TForm) 12 timer: TTimer; 13 panel_preview: TPanel; 14 img: TImage; 9 TForm_Preview = class(TForm_ToolTemplate) 10 lbl_notpossible: TLabel; 15 11 panel_buttons: TPanel; 16 12 btn_dec: TButton; 17 13 btn_startstop: TButton; 18 14 btn_inc: TButton; 19 Splitter1: TSplitter; 20 lbl_notpossible: TLabel; 21 panel_files: TPanel; 22 list: TListBox; 23 panel_extension: TPanel; 24 lbl_filter: TLabel; 25 combo_extension: TComboBox; 26 check_zerobyte: TCheckBox; 27 edit_filtername: TEdit; 28 check_filtername: TCheckBox; 29 procedure LoadFileNames; 30 procedure check_filternameClick(Sender: TObject); 31 procedure check_zerobyteClick(Sender: TObject); 32 procedure combo_extensionClick(Sender: TObject); 33 procedure panel_extensionResize(Sender: TObject); 34 procedure listClick(Sender: TObject); 35 procedure Recreatelist; 15 img: TImage; 16 timer: TTimer; 17 procedure FormCreate(Sender: TObject); 18 procedure NewFile(fileinfo: TFileInfo); 36 19 37 20 procedure PreviewImage; … … 39 22 procedure btn_incClick(Sender: TObject); 40 23 procedure btn_decClick(Sender: TObject); 41 procedure FormResize(Sender: TObject);42 24 procedure btn_startstopClick(Sender: TObject); 25 procedure timerTimer(Sender: TObject); 43 26 procedure panel_buttonsResize(Sender: TObject); 44 procedure timerTimer(Sender: TObject);45 procedure FormCreate(Sender: TObject);46 procedure FormClose(Sender: TObject; var Action: TCloseAction);47 27 48 28 procedure DrawImage(index: Integer); 49 29 procedure SetBitmapCount(Count: Integer); 50 30 procedure LoadImage(fileid, index: Integer); 51 procedure listMouseDown(Sender: TObject; Button: TMouseButton;52 Shift: TShiftState; X, Y: Integer);53 31 private 54 32 bitmaps: array of TBitmap; … … 62 40 63 41 implementation 64 65 42 {$R *.dfm} 66 43 67 uses Main; 68 69 70 71 72 procedure TForm_Preview.Recreatelist; 73 var 74 i: LongWord; 75 exts: TStringArray; 76 begin 77 combo_extension.Items.Clear; 78 combo_extension.Items.Add('_All files_ (' + 79 IntToStr(OniDataConnection.GetFilesCount) + ')'); 80 exts := OniDataConnection.GetExtensionsList; 81 for i := 0 to High(exts) do 82 combo_extension.Items.Add(exts[i]); 83 combo_extension.ItemIndex := 0; 84 combo_extensionClick(Self); 85 end; 86 87 88 89 90 procedure TForm_Preview.LoadFileNames; 91 var 92 Extension: String[4]; 93 no_zero_bytes: Boolean; 94 pattern: String; 95 files: TStringArray; 96 i: LongWord; 97 begin 98 Extension := MidStr(combo_extension.Items.Strings[combo_extension.ItemIndex], 1, 4); 99 no_zero_bytes := not check_zerobyte.Checked; 100 pattern := ''; 101 if check_filtername.Checked then 102 pattern := edit_filtername.Text; 103 if Extension = '_All' then 104 Extension := ''; 105 106 files := OniDataConnection.GetFilesList(extension, pattern, no_zero_bytes); 107 list.Items.Clear; 108 if Length(files) > 0 then 109 for i := 0 to High(files) do 110 list.Items.Add(files[i]); 111 end; 112 113 44 45 procedure TForm_Preview.FormCreate(Sender: TObject); 46 begin 47 inherited; 48 Self.OnNewFileSelected := NewFile; 49 end; 50 51 52 procedure TForm_Preview.NewFile(fileinfo: TFileInfo); 53 var 54 ext: String; 55 begin 56 _fileid := fileinfo.ID; 57 lbl_notpossible.Visible := False; 58 Self.img.Visible := True; 59 Self.timer.Enabled := False; 60 Self.panel_buttons.Visible := False; 61 ext := fileinfo.Extension; 62 if (ext = 'PSpc') or (ext = 'TXMB') or (ext = 'TXMP') then 63 PreviewImage 64 else if ext = 'TXAN' then 65 PreviewTXAN 66 else 67 begin 68 Self.lbl_notpossible.Visible := True; 69 Self.img.Visible := False; 70 end; 71 end; 114 72 115 73 … … 134 92 135 93 136 137 138 procedure TForm_Preview.combo_extensionClick(Sender: TObject);139 begin140 LoadFileNames;141 end;142 143 144 145 94 procedure TForm_Preview.DrawImage(index: Integer); 146 95 begin … … 153 102 154 103 155 156 157 104 procedure TForm_Preview.SetBitmapCount(Count: Integer); 158 105 var … … 175 122 176 123 177 178 179 procedure TForm_Preview.check_zerobyteClick(Sender: TObject);180 begin181 LoadFileNames;182 end;183 184 185 186 187 procedure TForm_Preview.check_filternameClick(Sender: TObject);188 begin189 edit_filtername.Enabled := not check_filtername.Checked;190 LoadFileNames;191 end;192 193 194 195 196 procedure TForm_Preview.listClick(Sender: TObject);197 var198 ext: String;199 begin200 _fileid := OniDataConnection.ExtractFileID(list.Items.Strings[list.ItemIndex]);201 lbl_notpossible.Visible := False;202 Self.img.Visible := True;203 Self.timer.Enabled := False;204 Self.panel_buttons.Visible := False;205 ext := RightStr(list.Items.Strings[list.ItemIndex], 4);206 if (ext = 'PSpc') or (ext = 'TXMB') or (ext = 'TXMP') then207 PreviewImage208 else if ext = 'TXAN' then209 PreviewTXAN210 else211 begin212 Self.lbl_notpossible.Visible := True;213 Self.img.Visible := False;214 end;215 end;216 217 218 219 220 procedure TForm_Preview.listMouseDown(Sender: TObject; Button: TMouseButton;221 Shift: TShiftState; X, Y: Integer);222 var223 pt: TPoint;224 begin225 pt.X := x;226 pt.Y := y;227 list.ItemIndex := list.ItemAtPos(pt, true);228 if list.ItemIndex > -1 then229 Self.listClick(Self);230 end;231 232 124 procedure TForm_Preview.PreviewImage; 233 125 begin … … 236 128 DrawImage(0); 237 129 end; 238 239 240 130 241 131 … … 266 156 267 157 268 269 270 158 procedure TForm_Preview.timerTimer(Sender: TObject); 271 159 begin 272 160 btn_incClick(Self); 273 161 end; 274 275 276 162 277 163 … … 288 174 289 175 290 291 292 176 procedure TForm_Preview.btn_decClick(Sender: TObject); 293 177 begin … … 302 186 303 187 304 305 306 188 procedure TForm_Preview.btn_incClick(Sender: TObject); 307 189 begin … … 316 198 317 199 318 319 320 200 procedure TForm_Preview.panel_buttonsResize(Sender: TObject); 321 201 begin … … 325 205 326 206 327 328 329 procedure TForm_Preview.panel_extensionResize(Sender: TObject); 330 begin 331 combo_extension.Width := panel_extension.Width - 5; 332 edit_filtername.Width := panel_extension.Width - 5; 333 end; 334 335 336 337 338 procedure TForm_Preview.FormResize(Sender: TObject); 339 begin 340 if Self.Width < 300 then 341 Self.Width := 300; 342 if Self.Height < 200 then 343 Self.Height := 200; 344 end; 345 346 347 348 349 procedure TForm_Preview.FormCreate(Sender: TObject); 350 begin 351 SetLength(bitmaps, 0); 352 Self.Width := 260; 353 Self.Height := 300; 354 end; 355 356 357 358 359 procedure TForm_Preview.FormClose(Sender: TObject; var Action: TCloseAction); 360 begin 361 Action := caFree; 362 end; 363 207 begin 208 AddToolListEntry('preview', 'Preview-Window', ''); 364 209 end. -
oup/current/Tool_RawEdit.dfm
r43 r45 1 object Form_RawEdit: TForm_RawEdit 2 Left = 0 3 Top = 0 4 BorderIcons = [biSystemMenu, biMaximize] 5 Caption = 'Binary .raw-Editor' 6 ClientHeight = 640 7 ClientWidth = 642 8 Color = clBtnFace 9 Font.Charset = DEFAULT_CHARSET 10 Font.Color = clWindowText 11 Font.Height = -11 12 Font.Name = 'Tahoma' 13 Font.Style = [] 14 FormStyle = fsMDIChild 15 KeyPreview = True 16 OldCreateOrder = False 17 Visible = True 18 WindowState = wsMaximized 19 OnClose = FormClose 1 inherited Form_RawEdit: TForm_RawEdit 2 Caption = 'RawEdit' 20 3 OnCloseQuery = FormCloseQuery 21 4 OnCreate = FormCreate 22 5 OnKeyUp = FormKeyUp 23 OnResize = FormResize 6 ExplicitWidth = 320 7 ExplicitHeight = 240 24 8 PixelsPerInch = 96 25 9 TextHeight = 13 26 object Splitter1: TSplitter 27 Left = 200 28 Top = 0 29 Width = 9 30 Height = 640 31 AutoSnap = False 32 Beveled = True 33 MinSize = 150 34 ExplicitLeft = 150 10 inherited panel_files: TPanel 11 object Splitter4: TSplitter [0] 12 Left = 0 13 Top = 205 14 Width = 200 15 Height = 8 16 Cursor = crVSplit 17 Align = alBottom 18 AutoSnap = False 19 Beveled = True 20 MinSize = 150 21 ExplicitLeft = 3 22 ExplicitTop = 89 23 end 24 inherited filelist: TListBox 25 Height = 102 26 ExplicitHeight = 102 27 end 28 object panel_imexport: TPanel 29 Left = 0 30 Top = 363 31 Width = 200 32 Height = 60 33 Align = alBottom 34 BevelOuter = bvNone 35 TabOrder = 3 36 DesignSize = ( 37 200 38 60) 39 object btn_export: TButton 40 Left = 4 41 Top = 4 42 Width = 190 43 Height = 25 44 Anchors = [akLeft, akTop, akRight] 45 Caption = 'Export to file...' 46 TabOrder = 0 47 OnClick = btn_exportClick 48 end 49 object btn_import: TButton 50 Left = 4 51 Top = 32 52 Width = 190 53 Height = 25 54 Anchors = [akLeft, akTop, akRight] 55 Caption = 'Import from file...' 56 TabOrder = 1 57 OnClick = btn_importClick 58 end 59 end 60 object GroupBox1: TGroupBox 61 Left = 0 62 Top = 213 63 Width = 200 64 Height = 150 65 Align = alBottom 66 Caption = '2. Select .dat-link-offset' 67 TabOrder = 2 68 object list_offset: TListBox 69 Left = 2 70 Top = 15 71 Width = 196 72 Height = 133 73 Align = alClient 74 ItemHeight = 13 75 TabOrder = 0 76 OnClick = list_offsetClick 77 end 78 end 35 79 end 36 object panel_data: TPanel 37 Left = 209 38 Top = 0 39 Width = 433 40 Height = 640 41 Align = alClient 42 BevelOuter = bvNone 43 TabOrder = 0 44 OnResize = panel_dataResize 80 inherited content: TPanel 81 OnResize = panel_contentResize 45 82 object Splitter2: TSplitter 46 83 Left = 0 47 Top = 45048 Width = 43384 Top = 300 85 Width = 283 49 86 Height = 9 50 87 Cursor = crVSplit … … 53 90 Beveled = True 54 91 MinSize = 40 55 ExplicitTop = 209 56 ExplicitWidth = 483 92 ExplicitTop = 414 57 93 end 58 94 object hex: TMPHexEditor 59 95 Left = 0 60 96 Top = 0 61 Width = 43362 Height = 45097 Width = 283 98 Height = 300 63 99 Cursor = crIBeam 64 100 Align = alTop … … 98 134 object value_viewer: TWrapGrid 99 135 Left = 0 100 Top = 459101 Width = 433102 Height = 1 81136 Top = 309 137 Width = 283 138 Height = 114 103 139 Align = alClient 104 140 ColCount = 1 … … 121 157 end 122 158 end 123 object panel_files: TPanel 124 Left = 0 125 Top = 0 126 Width = 200 127 Height = 640 128 Align = alLeft 129 BevelOuter = bvNone 130 TabOrder = 1 131 object Splitter4: TSplitter 132 Left = 0 133 Top = 442 134 Width = 200 135 Height = 9 136 Cursor = crVSplit 137 Align = alBottom 138 AutoSnap = False 139 Beveled = True 140 MinSize = 150 141 ExplicitWidth = 150 142 end 143 object panel_imexport: TPanel 144 Left = 0 145 Top = 580 146 Width = 200 147 Height = 60 148 Align = alBottom 149 BevelOuter = bvNone 150 TabOrder = 0 151 OnResize = panel_imexportResize 152 object btn_export: TButton 153 Left = 4 154 Top = 4 155 Width = 142 156 Height = 25 157 Caption = 'Export to file...' 158 TabOrder = 0 159 OnClick = btn_exportClick 160 end 161 object btn_import: TButton 162 Left = 4 163 Top = 32 164 Width = 142 165 Height = 25 166 Caption = 'Import from file...' 167 TabOrder = 1 168 OnClick = btn_importClick 169 end 170 end 171 object group_file: TGroupBox 172 Left = 0 173 Top = 0 174 Width = 200 175 Height = 442 176 Align = alClient 177 Caption = '1. Select file' 178 TabOrder = 1 179 object list: TListBox 180 Left = 2 181 Top = 15 182 Width = 196 183 Height = 337 184 Align = alClient 185 ItemHeight = 13 186 TabOrder = 0 187 OnClick = listClick 188 OnMouseDown = listMouseDown 189 end 190 object panel_extension: TPanel 191 Left = 2 192 Top = 352 193 Width = 196 194 Height = 88 195 Align = alBottom 196 BevelOuter = bvNone 197 TabOrder = 1 198 OnResize = panel_extensionResize 199 object lbl_filter: TLabel 200 Left = 2 201 Top = 46 202 Width = 100 203 Height = 17 204 AutoSize = False 205 Caption = 'Filter by &extension:' 206 FocusControl = combo_extension 207 end 208 object combo_extension: TComboBox 209 Left = 2 210 Top = 60 211 Width = 145 212 Height = 21 213 Style = csDropDownList 214 DropDownCount = 12 215 Font.Charset = DEFAULT_CHARSET 216 Font.Color = clWindowText 217 Font.Height = -11 218 Font.Name = 'Tahoma' 219 Font.Style = [] 220 ItemHeight = 13 221 ParentFont = False 222 Sorted = True 223 TabOrder = 2 224 OnClick = combo_extensionClick 225 end 226 object edit_filtername: TEdit 227 Left = 2 228 Top = 20 229 Width = 145 230 Height = 18 231 AutoSize = False 232 TabOrder = 1 233 end 234 object check_filtername: TCheckBox 235 Left = 2 236 Top = 5 237 Width = 130 238 Height = 15 239 Caption = 'Filter by file&name:' 240 TabOrder = 0 241 OnClick = check_filternameClick 242 end 243 end 244 end 245 object GroupBox1: TGroupBox 246 Left = 0 247 Top = 451 248 Width = 200 249 Height = 129 250 Align = alBottom 251 Caption = '2. Select .dat-link-offset' 252 TabOrder = 2 253 object list_offset: TListBox 254 Left = 2 255 Top = 15 256 Width = 196 257 Height = 112 258 Align = alClient 259 ItemHeight = 13 260 TabOrder = 0 261 OnClick = list_offsetClick 262 end 263 end 264 end 265 object value_viewer_context: TPopupMenu 159 object value_viewer_context: TPopupMenu [3] 266 160 AutoHotkeys = maManual 267 161 OnPopup = value_viewer_contextPopup … … 293 187 end 294 188 end 295 object opend: TOpenDialog 189 object opend: TOpenDialog [4] 296 190 Options = [ofPathMustExist, ofFileMustExist, ofEnableSizing] 297 Left = 12 0298 Top = 584191 Left = 128 192 Top = 256 299 193 end 300 object saved: TSaveDialog 194 object saved: TSaveDialog [5] 301 195 Options = [ofOverwritePrompt, ofPathMustExist, ofEnableSizing] 302 Left = 12 0303 Top = 608196 Left = 128 197 Top = 280 304 198 end 305 199 end -
oup/current/Tool_RawEdit.pas
r43 r45 1 1 unit Tool_RawEdit; 2 3 2 interface 4 5 3 uses 6 4 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 7 Dialogs, Wrapgrid, StdCtrls, Grids, StrUtils, MPHexEditor, ExtCtrls, Clipbrd,8 Data, Code_Functions, Code_DataStructures, Code_Exporters, Code_OniDataClass,9 Menus, Math;5 Dialogs, Tool_Template, StdCtrls, ExtCtrls, Menus, Grids, Wrapgrid, 6 MPHexEditor, Clipbrd, StrUtils, 7 Data, Code_Functions, Code_DataStructures, Code_Exporters, Code_OniDataClass; 10 8 11 9 type 12 TForm_RawEdit = class(TForm) 13 Splitter1: TSplitter; 14 panel_data: TPanel; 15 hex: TMPHexEditor; 10 TForm_RawEdit = class(TForm_ToolTemplate) 11 Splitter4: TSplitter; 12 panel_imexport: TPanel; 13 btn_export: TButton; 14 btn_import: TButton; 15 GroupBox1: TGroupBox; 16 list_offset: TListBox; 17 hex: TMPHexEditor; 16 18 Splitter2: TSplitter; 17 19 value_viewer: TWrapGrid; 18 20 value_viewer_context: TPopupMenu; 19 21 value_viewer_context_copy: TMenuItem; 20 value_viewer_context_copyashex: TMenuItem;21 22 value_viewer_context_copyasdec: TMenuItem; 22 23 value_viewer_context_copyasfloat: TMenuItem; 23 24 value_viewer_context_copyasbitset: TMenuItem; 24 25 value_viewer_context_copyasstring: TMenuItem; 25 panel_files: TPanel;26 value_viewer_context_copyashex: TMenuItem; 26 27 opend: TOpenDialog; 27 28 saved: TSaveDialog; 28 panel_imexport: TPanel;29 btn_export: TButton;30 btn_import: TButton;31 group_file: TGroupBox;32 list: TListBox;33 panel_extension: TPanel;34 lbl_filter: TLabel;35 combo_extension: TComboBox;36 edit_filtername: TEdit;37 check_filtername: TCheckBox;38 GroupBox1: TGroupBox;39 list_offset: TListBox;40 Splitter4: TSplitter;41 procedure hexKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);42 29 procedure list_offsetClick(Sender: TObject); 30 procedure NewFile(fileinfo: TFileInfo); 43 31 procedure LoadRaw(raw_info: TRawInfo); 44 procedure LoadFileNames;45 procedure check_filternameClick(Sender: TObject); 46 procedure combo_extensionClick(Sender: TObject);47 procedure panel_extensionResize(Sender: TObject);48 procedure listClick(Sender: TObject); 49 procedure Recreatelist;50 32 function Save: Boolean; 33 34 procedure btn_importClick(Sender: TObject); 35 procedure btn_exportClick(Sender: TObject); 36 37 procedure FormCreate(Sender: TObject); 38 procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); 51 39 procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); 40 41 procedure panel_contentResize(Sender: TObject); 42 43 function GetValue(datatype: Word; offset: LongWord): String; 44 procedure ClearValues; 45 procedure WriteValues; 46 procedure SetNewValue(datatype: Word; offset: LongWord; Value: String); 47 52 48 procedure value_viewerDblClick(Sender: TObject); 53 49 procedure value_viewer_context_copyClick(Sender: TObject); … … 55 51 Shift: TShiftState; X, Y: Integer); 56 52 procedure value_viewer_contextPopup(Sender: TObject); 57 procedure btn_importClick(Sender: TObject); 58 procedure btn_exportClick(Sender: TObject); 59 procedure panel_imexportResize(Sender: TObject); 60 function Save: Boolean; 61 procedure FormClose(Sender: TObject; var Action: TCloseAction); 62 function GetValue(datatype: Word; offset: LongWord): String; 53 54 procedure hexKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); 63 55 procedure hexSelectionChanged(Sender: TObject); 64 56 procedure hexChange(Sender: TObject); 65 procedure panel_dataResize(Sender: TObject);66 procedure FormResize(Sender: TObject);67 procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);68 procedure FormCreate(Sender: TObject);69 procedure ClearValues;70 procedure WriteValues;71 procedure SetNewValue(datatype: Word; offset: LongWord; Value: String);72 procedure listMouseDown(Sender: TObject; Button: TMouseButton;73 Shift: TShiftState; X, Y: Integer);74 57 private 75 58 fileid: LongWord; … … 83 66 84 67 implementation 85 86 68 {$R *.dfm} 87 88 69 uses Main, Helper_ValueEdit; 89 70 90 91 71 procedure TForm_RawEdit.NewFile(fileinfo: TFileInfo); 72 var 73 offsets: TRawList; 74 i: Integer; 75 begin 76 if hex.Modified then 77 if not Save then 78 Exit; 79 ClearValues; 80 hex.DataSize := 0; 81 fileid := fileinfo.ID; 82 list_offset.Enabled := False; 83 if fileinfo.size > 0 then 84 begin 85 offsets := OniDataConnection.GetRawList(fileid); 86 list_offset.Items.Clear; 87 if Length(offsets) > 0 then 88 for i := 0 to High(offsets) do 89 list_offset.Items.Add('0x' + IntToHex(offsets[i].src_offset, 8) + 90 ', ' + IntToStr(offsets[i].raw_size) + ' bytes'); 91 list_offset.Enabled := True; 92 end; 93 end; 92 94 93 95 procedure TForm_RawEdit.LoadRaw(raw_info: TRawInfo); … … 95 97 i: LongWord; 96 98 Data: Tdata; 97 mem: TMemoryStream;98 99 begin 99 100 if hex.Modified then … … 106 107 if list_offset.Count = 0 then 107 108 begin 108 for i := 0 to list.Count - 1 do109 begin 110 if OniDataConnection.ExtractFileID( list.Items.Strings[i]) = raw_info.src_id then111 begin 112 list.ItemIndex := i;109 for i := 0 to filelist.Count - 1 do 110 begin 111 if OniDataConnection.ExtractFileID(filelist.Items.Strings[i]) = raw_info.src_id then 112 begin 113 filelist.ItemIndex := i; 113 114 listClick(Self); 114 115 Break; … … 150 151 151 152 152 procedure TForm_RawEdit.Recreatelist; 153 var 154 i: LongWord; 155 exts: TStringArray; 156 Count: LongWord; 157 begin 158 combo_extension.Items.Clear; 159 combo_extension.Items.Add('_All files_ ('{+IntToStr(dat_header.Files)} + ')'); 160 exts := OniDataConnection.GetExtensionsList; 161 for i := 0 to High(RawListHandlers) do 162 begin 163 Count := Length(OniDataConnection.GetFilesList(RawListHandlers[i].Ext, '', True)); 164 combo_extension.Items.Add(RawListHandlers[i].ext + ' (' + IntToStr(Count) + ')'); 165 end; 166 // FOR i:=0 TO High(exts) DO 167 // combo_extension.Items.Add(exts[i]); 168 combo_extension.ItemIndex := 0; 169 combo_extensionClick(Self); 170 end; 171 172 173 174 175 procedure TForm_RawEdit.LoadFileNames; 176 var 177 Extension: String; 178 no_zero_bytes: Boolean; 179 pattern: String; 180 files: TStringArray; 181 i: LongWord; 182 begin 183 Extension := MidStr(combo_extension.Items.Strings[combo_extension.ItemIndex], 1, 4); 184 pattern := ''; 185 if check_filtername.Checked then 186 pattern := edit_filtername.Text; 187 if Extension = '_All' then 188 begin 189 Extension := ''; 190 for i := 0 to High(RawListHandlers) do 191 begin 192 if Length(Extension) > 0 then 193 Extension := Extension + ','; 194 Extension := Extension + RawListHandlers[i].Ext; 195 end; 196 end; 197 198 files := OniDataConnection.GetFilesList(extension, pattern, True); 199 list.Items.Clear; 200 if Length(files) > 0 then 201 for i := 0 to High(files) do 202 list.Items.Add(files[i]); 203 list_offset.Items.Clear; 204 end; 205 206 207 208 209 procedure TForm_RawEdit.panel_extensionResize(Sender: TObject); 210 begin 211 combo_extension.Width := panel_extension.Width - 5; 212 edit_filtername.Width := panel_extension.Width - 5; 213 end; 214 215 216 217 218 procedure TForm_RawEdit.combo_extensionClick(Sender: TObject); 219 begin 220 LoadFileNames; 221 end; 222 223 224 225 226 procedure TForm_RawEdit.check_filternameClick(Sender: TObject); 227 begin 228 edit_filtername.Enabled := not check_filtername.Checked; 229 LoadFileNames; 230 end; 231 232 233 234 235 procedure TForm_RawEdit.listClick(Sender: TObject); 236 var 237 mem: TMemoryStream; 238 Data: Tdata; 239 i: LongWord; 240 offsets: TRawList; 241 begin 242 if hex.Modified then 243 begin 244 if not Save then 245 begin 246 Exit; 247 end; 248 end; 249 ClearValues; 250 hex.DataSize := 0; 251 fileid := OniDataConnection.ExtractFileID(list.Items.Strings[list.ItemIndex]); 252 list_offset.Enabled := True; 253 if OniDataConnection.GetFileInfo(fileid).size > 0 then 254 begin 255 offsets := OniDataConnection.GetRawList(fileid); 256 list_offset.Items.Clear; 257 if Length(offsets) > 0 then 258 begin 259 for i := 0 to High(offsets) do 260 begin 261 list_offset.Items.Add('0x' + IntToHex(offsets[i].src_offset, 8) + 262 ', ' + IntToStr(offsets[i].raw_size) + ' bytes'); 263 end; 264 end 265 else 266 begin 267 list_offset.Enabled := False; 268 end; 269 end 270 else 271 begin 272 list_offset.Enabled := False; 273 end; 274 end; 275 276 277 278 279 procedure TForm_RawEdit.listMouseDown(Sender: TObject; Button: TMouseButton; 280 Shift: TShiftState; X, Y: Integer); 281 var 282 pt: TPoint; 283 begin 284 pt.X := x; 285 pt.Y := y; 286 list.ItemIndex := list.ItemAtPos(pt, true); 287 if list.ItemIndex > -1 then 288 Self.listClick(Self); 289 end; 153 290 154 291 155 procedure TForm_RawEdit.list_offsetClick(Sender: TObject); … … 500 364 501 365 procedure TForm_RawEdit.FormCreate(Sender: TObject); 502 begin 366 var 367 i: LongWord; 368 exts: String; 369 begin 370 inherited; 371 Self.OnNewFileSelected := Self.NewFile; 372 373 exts := ''; 374 if Length(RawListHandlers) > 0 then 375 begin 376 for i := 0 to High(RawListHandlers) do 377 if Length(exts) > 0 then 378 exts := exts + ',' + RawListHandlers[i].Ext 379 else 380 exts := RawListHandlers[i].Ext; 381 end; 382 Self.AllowedExts := exts; 383 503 384 Self.Caption := ''; 504 385 fileid := 0; … … 516 397 value_viewer.Cells[0, 7] := 'Selected length'; 517 398 value_viewer.ColWidths[0] := 100; 518 hex.Height := panel_data.Height - 190;519 Self.panel_dataResize(Self);520 399 // 521 400 value_viewer.Font.Charset := AppSettings.CharSet; … … 574 453 575 454 576 procedure TForm_RawEdit.FormResize(Sender: TObject); 577 begin 578 if Self.Width >= 650 then 579 begin 580 end 581 else 582 Self.Width := 650; 583 if Self.Height >= 450 then 584 begin 585 end 586 else 587 Self.Height := 450; 588 end; 589 590 591 592 593 procedure TForm_RawEdit.panel_dataResize(Sender: TObject); 455 procedure TForm_RawEdit.panel_contentResize(Sender: TObject); 594 456 begin 595 457 value_viewer.ColWidths[1] := value_viewer.Width - value_viewer.ColWidths[0] - 28; … … 674 536 675 537 676 procedure TForm_RawEdit.FormClose(Sender: TObject; var Action: TCloseAction);677 begin678 Action := caFree;679 end;680 681 682 683 684 procedure TForm_RawEdit.panel_imexportResize(Sender: TObject);685 begin686 btn_import.Width := panel_imexport.Width - 8;687 btn_export.Width := panel_imexport.Width - 8;688 end;689 690 691 692 538 693 539 procedure TForm_RawEdit.btn_exportClick(Sender: TObject); … … 966 812 end; 967 813 814 begin 815 AddToolListEntry('rawedit', 'Binary .raw-Editor', ''); 968 816 end. -
oup/current/Tool_TxmpReplace.dfm
r43 r45 1 object Form_TxmpReplace: TForm_TxmpReplace 2 Left = 0 3 Top = 0 4 BorderStyle = bsSingle 5 Caption = 'TXMP Replacer' 6 ClientHeight = 428 7 ClientWidth = 394 8 Color = clBtnFace 9 Font.Charset = DEFAULT_CHARSET 10 Font.Color = clWindowText 11 Font.Height = -11 12 Font.Name = 'Tahoma' 13 Font.Style = [] 14 FormStyle = fsMDIChild 15 OldCreateOrder = False 16 Visible = True 17 WindowState = wsMaximized 1 inherited Form_TxmpReplace: TForm_TxmpReplace 2 Caption = 'TxmpReplace' 18 3 OnClose = FormClose 19 4 OnCreate = FormCreate 5 ExplicitWidth = 320 6 ExplicitHeight = 240 20 7 PixelsPerInch = 96 21 8 TextHeight = 13 22 object panel_12: TPanel 23 Left = 0 24 Top = 0 25 Width = 394 26 Height = 349 27 Align = alClient 28 BevelOuter = bvNone 29 TabOrder = 0 30 object Splitter1: TSplitter 31 Left = 280 32 Top = 0 33 Width = 8 34 Height = 349 9 inherited Splitter1: TSplitter 10 Height = 344 11 ExplicitHeight = 344 12 end 13 inherited panel_files: TPanel 14 Height = 344 15 ExplicitHeight = 344 16 object image_txmppreview: TImage [0] 17 Left = 0 18 Top = 257 19 Width = 200 20 Height = 57 21 Align = alClient 22 ExplicitTop = 111 23 ExplicitHeight = 211 24 end 25 object splitter_txmp: TSplitter [1] 26 Left = 0 27 Top = 249 28 Width = 200 29 Height = 8 30 Cursor = crVSplit 31 Align = alTop 35 32 AutoSnap = False 36 33 Beveled = True 37 MinSize = 150 38 ExplicitLeft = 200 34 MinSize = 60 35 ExplicitLeft = -6 36 ExplicitTop = 314 39 37 end 40 object group_txmpselect: TGroupBox 38 inherited filelist: TListBox 39 Height = 146 40 Align = alTop 41 ExplicitHeight = 146 42 end 43 inherited panel_extension: TPanel 44 Visible = False 45 end 46 object panel_txmppreview: TPanel 47 Left = 0 48 Top = 314 49 Width = 200 50 Height = 30 51 Align = alBottom 52 BevelOuter = bvNone 53 TabOrder = 2 54 object btn_save: TButton 55 Left = 2 56 Top = 2 57 Width = 111 58 Height = 25 59 Caption = 'Save TXMP-Picture' 60 TabOrder = 0 61 OnClick = btn_saveClick 62 end 63 end 64 end 65 inherited content: TPanel 66 Height = 344 67 ExplicitHeight = 344 68 object group_bmpselect: TGroupBox 41 69 Left = 0 42 70 Top = 0 43 Width = 280 44 Height = 349 45 Align = alLeft 46 Caption = '1. Select TXMP to replace' 47 TabOrder = 0 48 object splitter_txmp: TSplitter 49 Left = 2 50 Top = 190 51 Width = 276 52 Height = 8 53 Cursor = crVSplit 54 Align = alTop 55 AutoSnap = False 56 Beveled = True 57 MinSize = 60 58 ExplicitWidth = 196 59 end 60 object image_txmppreview: TImage 61 Left = 2 62 Top = 198 63 Width = 276 64 Height = 119 65 Align = alClient 66 ExplicitWidth = 196 67 end 68 object list_txmp: TListBox 69 Left = 2 70 Top = 15 71 Width = 276 72 Height = 175 73 Align = alTop 74 ItemHeight = 13 75 TabOrder = 0 76 OnClick = list_txmpClick 77 OnMouseDown = list_txmpMouseDown 78 end 79 object panel_txmppreview: TPanel 80 Left = 2 81 Top = 317 82 Width = 276 83 Height = 30 84 Align = alBottom 85 BevelOuter = bvNone 86 TabOrder = 1 87 object btn_save: TButton 88 Left = 2 89 Top = 2 90 Width = 111 91 Height = 25 92 Caption = 'Save TXMP-Picture' 93 TabOrder = 0 94 OnClick = btn_saveClick 95 end 96 end 97 end 98 object group_bmpselect: TGroupBox 99 Left = 288 100 Top = 0 101 Width = 106 102 Height = 349 71 Width = 283 72 Height = 344 103 73 Align = alClient 104 74 Caption = '2. Open BMP to replace with' 105 75 Enabled = False 106 TabOrder = 176 TabOrder = 0 107 77 object image_bmppreview: TImage 108 78 Left = 2 109 79 Top = 45 110 Width = 102111 Height = 30280 Width = 279 81 Height = 297 112 82 Align = alClient 113 83 ExplicitWidth = 182 84 ExplicitHeight = 302 114 85 end 115 86 object panel_load: TPanel 116 87 Left = 2 117 88 Top = 15 118 Width = 10289 Width = 279 119 90 Height = 30 120 91 Align = alTop … … 133 104 end 134 105 end 135 object group_options: TGroupBox 106 object group_options: TGroupBox [3] 136 107 Left = 0 137 Top = 34 9138 Width = 394108 Top = 344 109 Width = 492 139 110 Height = 79 140 111 Align = alBottom 141 112 Caption = '3. Options && Replace' 142 113 Enabled = False 143 TabOrder = 1114 TabOrder = 2 144 115 object btn_replace: TButton 145 116 Left = 4 … … 168 139 end 169 140 end 170 object opend: TOpenDialog 141 object opend: TOpenDialog [4] 171 142 Filter = '24bit Bitmap (*.bmp)|*.bmp' 172 143 Options = [ofPathMustExist, ofFileMustExist, ofEnableSizing] … … 174 145 Top = 16 175 146 end 176 object saved: TSaveDialog 147 object saved: TSaveDialog [5] 177 148 DefaultExt = 'bmp' 178 149 Filter = 'Windows Bitmap (*.bmp)|*.bmp' -
oup/current/Tool_TxmpReplace.pas
r43 r45 1 1 unit Tool_TxmpReplace; 2 3 2 interface 4 5 3 uses 6 4 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 7 Dialogs, ExtCtrls, StdCtrls, StrUtils, Code_Functions, Data, Code_OniImgClass; 5 Dialogs, Tool_Template, StdCtrls, ExtCtrls, 6 Code_Functions, Data, Code_OniImgClass, Menus; 8 7 9 8 type 10 TForm_TxmpReplace = class(TForm) 11 panel_12: TPanel; 12 group_txmpselect: TGroupBox; 13 splitter_txmp: TSplitter; 14 list_txmp: TListBox; 15 Splitter1: TSplitter; 16 group_bmpselect: TGroupBox; 17 panel_load: TPanel; 18 btn_load: TButton; 19 image_bmppreview: TImage; 20 opend: TOpenDialog; 9 TForm_TxmpReplace = class(TForm_ToolTemplate) 21 10 group_options: TGroupBox; 22 11 btn_replace: TButton; … … 26 15 btn_save: TButton; 27 16 image_txmppreview: TImage; 28 saved: TSaveDialog; 17 splitter_txmp: TSplitter; 18 group_bmpselect: TGroupBox; 19 image_bmppreview: TImage; 20 panel_load: TPanel; 21 btn_load: TButton; 22 opend: TOpenDialog; 23 saved: TSaveDialog; 24 procedure SelectFile(fileinfo: TFileInfo); 29 25 procedure FormCreate(Sender: TObject); 26 procedure FormClose(Sender: TObject; var Action: TCloseAction); 30 27 procedure btn_saveClick(Sender: TObject); 31 procedure FormClose(Sender: TObject; var Action: TCloseAction);28 procedure btn_loadClick(Sender: TObject); 32 29 procedure btn_replaceClick(Sender: TObject); 33 procedure btn_loadClick(Sender: TObject);34 procedure list_txmpClick(Sender: TObject);35 procedure Recreatelist;36 procedure list_txmpMouseDown(Sender: TObject; Button: TMouseButton;37 Shift: TShiftState; X, Y: Integer);38 30 private 39 31 OniImage_Old: TOniImage; 40 32 OniImage_New: TOniImage; 33 fileid: Integer; 41 34 public 42 35 end; … … 46 39 47 40 implementation 48 41 {$R *.dfm} 49 42 uses Main, Code_OniDataClass; 50 43 51 {$R *.dfm} 52 53 54 55 procedure TForm_TxmpReplace.Recreatelist; 56 var 57 files: TStringArray; 58 i: LongWord; 59 begin 60 list_txmp.Items.Clear; 61 files := OniDataConnection.GetFilesList('TXMP', '', True); 62 if Length(files) > 0 then 63 for i := 0 to High(files) do 64 list_txmp.Items.Add(files[i]); 65 group_bmpselect.Enabled := False; 66 check_transparency.Checked := False; 67 check_fading.Checked := False; 68 end; 69 70 71 72 73 procedure TForm_TxmpReplace.list_txmpClick(Sender: TObject); 74 var 75 id: LongWord; 44 45 46 procedure TForm_TxmpReplace.SelectFile(fileinfo: TFileInfo); 47 var 76 48 Data: Tdata; 77 49 mem: TMemoryStream; 78 50 fadingbyte, depthbyte, storebyte: Byte; 79 51 begin 80 id := OniDataConnection.ExtractFileID(list_txmp.Items.Strings[list_txmp.ItemIndex]);81 OniDataConnection.LoadDatFilePart( id, $88, SizeOf(fadingbyte), @fadingbyte);82 OniDataConnection.LoadDatFilePart( id, $89, SizeOf(depthbyte), @depthbyte);83 OniDataConnection.LoadDatFilePart( id, $90, SizeOf(storebyte), @storebyte);52 fileid := fileinfo.ID; 53 OniDataConnection.LoadDatFilePart(fileid, $88, SizeOf(fadingbyte), @fadingbyte); 54 OniDataConnection.LoadDatFilePart(fileid, $89, SizeOf(depthbyte), @depthbyte); 55 OniDataConnection.LoadDatFilePart(fileid, $90, SizeOf(storebyte), @storebyte); 84 56 check_fading.Checked := (fadingbyte and $01) > 0; 85 57 check_transparency.Checked := (depthbyte and $04) > 0; 86 58 87 OniImage_Old.LoadFromTXMP( id);59 OniImage_Old.LoadFromTXMP(fileid); 88 60 Data := OniImage_Old.GetAsBMP; 89 61 mem := TMemoryStream.Create; … … 96 68 end; 97 69 98 99 100 101 procedure TForm_TxmpReplace.list_txmpMouseDown(Sender: TObject;102 Button: TMouseButton; Shift: TShiftState; X, Y: Integer);103 var104 pt: TPoint;105 begin106 pt.X := x;107 pt.Y := y;108 list_txmp.ItemIndex := list_txmp.ItemAtPos(pt, true);109 if list_txmp.ItemIndex > -1 then110 Self.list_txmpClick(Self);111 end;112 70 113 71 procedure TForm_TxmpReplace.btn_loadClick(Sender: TObject); … … 134 92 procedure TForm_TxmpReplace.btn_replaceClick(Sender: TObject); 135 93 var 136 id: LongWord;137 138 94 oldsize, newsize: LongWord; 139 95 old_rawaddr, new_rawaddr: LongWord; … … 143 99 datbyte: Word; 144 100 begin 145 if list_txmp.ItemIndex >= 0 then101 if filelist.ItemIndex >= 0 then 146 102 begin 147 id := OniDataConnection.ExtractFileID(list_txmp.Items.Strings[list_txmp.ItemIndex]); 148 OniDataConnection.LoadDatFilePart(id, $88, 1, @oldfading); 103 OniDataConnection.LoadDatFilePart(fileid, $88, 1, @oldfading); 149 104 if OniDataConnection.OSisMac then 150 OniDataConnection.UpdateDatFilePart( id, $A0, 4, @old_rawaddr)105 OniDataConnection.UpdateDatFilePart(fileid, $A0, 4, @old_rawaddr) 151 106 else 152 OniDataConnection.LoadDatFilePart( id, $9C, 4, @old_rawaddr);107 OniDataConnection.LoadDatFilePart(fileid, $9C, 4, @old_rawaddr); 153 108 154 109 if (OniImage_Old.Width <> OniImage_New.Width) or … … 161 116 IntToStr(OniImage_New.Width) + 'x' + IntToStr(OniImage_New.Height) + ')' + CrLf + 162 117 'Replace anyways?'), 163 PChar( list_txmp.Items.Strings[list_txmp.ItemIndex]),118 PChar(filelist.Items.Strings[filelist.ItemIndex]), 164 119 MB_YESNO) = idNo then 165 120 Exit; … … 190 145 begin 191 146 new_rawaddr := old_rawaddr; 192 OniDataConnection.UpdateRawFile( id, $9C, Length(tempd), tempd);147 OniDataConnection.UpdateRawFile(fileid, $9C, Length(tempd), tempd); 193 148 end; 194 149 … … 196 151 if check_fading.Checked then 197 152 datbyte := datbyte or $01; 198 OniDataConnection.UpdateDatFilePart( id, $88, 1, @datbyte);153 OniDataConnection.UpdateDatFilePart(fileid, $88, 1, @datbyte); 199 154 datbyte := $10; 200 155 if check_transparency.Checked then 201 156 datbyte := datbyte or $04; 202 OniDataConnection.UpdateDatFilePart( id, $89, 1, @datbyte);203 OniDataConnection.UpdateDatFilePart( id, $8C, 2, @OniImage_New.Width);204 OniDataConnection.UpdateDatFilePart( id, $8E, 2, @OniImage_New.Height);157 OniDataConnection.UpdateDatFilePart(fileid, $89, 1, @datbyte); 158 OniDataConnection.UpdateDatFilePart(fileid, $8C, 2, @OniImage_New.Width); 159 OniDataConnection.UpdateDatFilePart(fileid, $8E, 2, @OniImage_New.Height); 205 160 datbyte := $08; 206 OniDataConnection.UpdateDatFilePart( id, $90, 1, @datbyte);161 OniDataConnection.UpdateDatFilePart(fileid, $90, 1, @datbyte); 207 162 if OniDataConnection.OSisMac then 208 OniDataConnection.UpdateDatFilePart( id, $A0, 4, @new_rawaddr)163 OniDataConnection.UpdateDatFilePart(fileid, $A0, 4, @new_rawaddr) 209 164 else 210 OniDataConnection.UpdateDatFilePart( id, $9C, 4, @new_rawaddr);165 OniDataConnection.UpdateDatFilePart(fileid, $9C, 4, @new_rawaddr); 211 166 212 167 ShowMessage('TXMP-image replaced'); … … 221 176 OniImage_Old.Free; 222 177 OniImage_New.Free; 223 Action := caFree;178 inherited; 224 179 end; 225 180 … … 229 184 procedure TForm_TxmpReplace.FormCreate(Sender: TObject); 230 185 begin 186 inherited; 231 187 OniImage_Old := TOniImage.Create; 232 188 OniImage_New := TOniImage.Create; 189 Self.AllowedExts := 'TXMP'; 190 Self.OnNewFileSelected := SelectFile; 233 191 end; 234 192 … … 242 200 end; 243 201 202 begin 203 AddToolListEntry('txmpreplace', 'TXMP Replacer', 'TXMP'); 244 204 end. -
oup/current/todo.txt
r10 r45 1 -Types+Idents nicht in DB sondern Hardcoded, mit IDs für StructViewer2 -StructViewer: statt 12 für dat-links, neuer bereich für typed-dat-links3 4 5 -DB mit MAC-Files (andre offsets in dat für raw-links ...)6 -Faded repacking TXMP (???)7 1 -DatLinks patchen 8 2 -Non32bit MipMapping (???) … … 22 16 -Links: Wenn level0 dann OUP mit level0 laden? 23 17 18 -History:Geyser:14.04.06 15:11:45, 16.04.06 15:21:29 24 19 -Patching: History Geyser 2006-04-30 - 04:07:00 25 20 26 21 -Exports: FileExists => Abfrage 22 -Export etc: If dest-file exists zZt anhängen, stattdessen neuschreiben?! 23 -Export: dat+raw eines Files in eine datei 27 24 28 25 -TOniImage: Statt Floor (bei farben) Round … … 32 29 -DatEdit: Komplette .dat im Hex + Treeview der verschiedenen Parts etc 33 30 34 -FileLists: Sort By ID, Name, Extension ...35 36 -Class für TForm mit FileList etc? (Form1_CreateContext mit dieser baseclass?)37 38 -FileNames: Form_***, Unit_***39 40 31 -Signed vs Unsigned 41 32 42 33 -PNG statt/zusätzlich zu BMP 43 34 44 -Noob-protection in Settings (Hex-Editing deaktiviert)45 35 -AppSettings: Erst initialisieren mit defaults, dann .ini lesen 46 36 47 37 -Exporters (-> TOniImage etc) 48 49 -Option: show files without first 8 bytes. special-struct-def-loading (substract 8 from every entry's offset)50 51 -Open über ein Menüpunkt: Decide upon Extension52 38 53 39 -Wiki etc: Links für benutzte Componenten … … 55 41 -ProgHelp 56 42 -Localization (eg: http://dybdahl.dk/dxgettext/) 57 58 -Close File/DB: Menu geht nach rechts 43 -About 59 44 60 45 -StructViewer: Strings bis 0x00, BitSets besser darstellen? (SSG: 18.04.06/10:52:58), … … 70 55 -Dateityp-Name anzeigen (SUBT -> Subtitles etc) 71 56 72 -DatOpen: Erst Childs schließen, dann OpenDialog, dnan alte .dat schließen?73 74 57 -IGSt: Bei DEAD: OUP hangs (ValueViewer:String?) 75 76 -History:Geyser:14.04.06 15:11:45, 16.04.06 15:21:2977 58 78 59 -Bug bei SetNewValue mit String … … 80 61 -Preview PSpc (!!!) 81 62 -Preview: Models? 3D-Data? 82 83 -Export etc: If dest-file exists zZt anhängen, stattdessen neuschreiben?!84 -Export: dat+raw eines Files in eine datei85 63 86 64 -Get files die bestimmten content haben (string etc) … … 92 70 93 71 -Exporter: Checkboxes für was man im einzelnen will (zb Checkbox "in eine Datei ja/nein") 94 95 - HELP72 -Extrahier-Ordner-Option (mit Platzhalter für .dat-Name) 73 -Extractor: Wohin? 96 74 97 75 -Hex: Paste 98 99 -Datei von einem Tool in andrem Tool öffnen100 101 76 102 77 -Persist.dat editor 103 78 104 79 80 105 81 -SELECT [src_id],MIN(datfiles.[name]),SUM(rawmap.[size]) FROM rawmap INNER JOIN datfiles ON datfiles.[id]=[src_id] GROUP BY [src_id] ORDER BY [src_id] ASC 106 82 107 -Extrahier-Ordner-Option (mit Platzhalter für .dat-Name)108 109 -About110 83 111 84 -BinEdit: Zusatzfunktionen wie: Suche, 112 -BinEdit: Bild/Menu/Button irgendwas zum speichern113 114 -Extractor: Wohin?115 85 116 86 -FileCompare: Ergebnis=Tabelle, jede Zeile eine differenz-addresse, spalten = werte an addr. für compared files … … 122 92 -Löschen einer Datei auf die gelinkt wird: Liste der Links und sicherheitsfrage 123 93 124 -Filebox-Context: Extract etc125 126 94 -STRG+C auf Dateilisten etc für kopieren des Namens 127 95
Note:
See TracChangeset
for help on using the changeset viewer.