Changeset 86 for oup/current/Tools
- Timestamp:
- Jan 14, 2007, 9:19:08 PM (18 years ago)
- Location:
- oup/current/Tools
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/current/Tools/Extractor.dfm
r74 r86 2 2 Caption = 'Extractor' 3 3 ClientHeight = 491 4 ExplicitWidth = 5005 4 ExplicitHeight = 518 6 5 PixelsPerInch = 96 … … 22 21 inherited filelist: TListBox 23 22 Width = 333 24 Height = 362 23 Height = 338 24 ExplicitTop = 153 25 25 ExplicitWidth = 333 26 ExplicitHeight = 3 6226 ExplicitHeight = 338 27 27 end 28 28 inherited panel_extension: TPanel -
oup/current/Tools/Extractor.pas
r74 r86 108 108 filename := GetWinFilename(filelist.Items.Strings[i]); 109 109 if check_dat.Checked then 110 ExportDatFile( fileid, path + filename);110 ExportDatFile(Connection, fileid, path + filename); 111 111 if check_raw.Checked then 112 ExportRawFiles( fileid, path + filename);112 ExportRawFiles(Connection, fileid, path + filename); 113 113 if check_convert.Checked then 114 ExportConverted( fileid, path + filename);114 ExportConverted(Connection, fileid, path + filename); 115 115 Inc(done); 116 116 end; -
oup/current/Tools/Preview.pas
r46 r86 80 80 begin 81 81 OniImage := TOniImage.Create; 82 OniImage.Load( fileid);82 OniImage.Load(Connection, fileid); 83 83 Data := OniImage.GetAsBMP; 84 84 OniImage.Free; … … 137 137 i: Byte; 138 138 begin 139 OniDataConnection.LoadDatFilePart(_fileid, $14, SizeOf(loop_speed), @loop_speed);140 OniDataConnection.LoadDatFilePart(_fileid, $1C, SizeOf(linkcount), @linkcount);139 Connection.LoadDatFilePart(_fileid, $14, SizeOf(loop_speed), @loop_speed); 140 Connection.LoadDatFilePart(_fileid, $1C, SizeOf(linkcount), @linkcount); 141 141 SetBitmapCount(linkcount); 142 142 for i := 0 to linkcount - 1 do 143 143 begin 144 OniDataConnection.LoadDatFilePart(_fileid, $20 + i * 4, SizeOf(link), @link);144 Connection.LoadDatFilePart(_fileid, $20 + i * 4, SizeOf(link), @link); 145 145 link := link div 256; 146 146 if link = 0 then … … 180 180 else 181 181 actualimg := High(bitmaps); 182 Self.Caption := 'Preview ' + OniDataConnection.GetFileInfo(_fileid).FileName +182 Self.Caption := 'Preview ' + Connection.GetFileInfo(_fileid).FileName + 183 183 ' (' + IntToStr(actualimg + 1) + '/' + IntToStr(Length(bitmaps)) + ')'; 184 184 DrawImage(actualimg); … … 192 192 else 193 193 actualimg := 0; 194 Self.Caption := 'Preview ' + OniDataConnection.GetFileInfo(_fileid).FileName +194 Self.Caption := 'Preview ' + Connection.GetFileInfo(_fileid).FileName + 195 195 ' (' + IntToStr(actualimg + 1) + '/' + IntToStr(Length(bitmaps)) + ')'; 196 196 DrawImage(actualimg); -
oup/current/Tools/Template.dfm
r58 r86 43 43 object filelist: TListBox 44 44 Left = 0 45 Top = 1 2945 Top = 153 46 46 Width = 200 47 Height = 2 9447 Height = 270 48 48 Align = alClient 49 49 ItemHeight = 13 … … 52 52 OnClick = listClick 53 53 OnMouseDown = listMouseDown 54 ExplicitTop = 129 55 ExplicitHeight = 294 54 56 end 55 57 object panel_extension: TPanel … … 57 59 Top = 0 58 60 Width = 200 59 Height = 1 2961 Height = 153 60 62 Align = alTop 61 63 BevelOuter = bvNone … … 63 65 DesignSize = ( 64 66 200 65 1 29)67 153) 66 68 object Label2: TLabel 67 69 Left = 100 68 Top = 1 0570 Top = 129 69 71 Width = 17 70 72 Height = 18 … … 80 82 object Label1: TLabel 81 83 Left = 47 82 Top = 1 0584 Top = 129 83 85 Width = 17 84 86 Height = 18 … … 94 96 object label_ext: TLabel 95 97 Left = 2 96 Top = 6298 Top = 86 97 99 Width = 100 98 100 Height = 17 … … 103 105 object btn_sort_id_asc: TSpeedButton 104 106 Left = 3 105 Top = 1 01107 Top = 125 106 108 Width = 20 107 109 Height = 22 … … 124 126 object btn_sort_id_desc: TSpeedButton 125 127 Left = 23 126 Top = 1 01128 Top = 125 127 129 Width = 20 128 130 Height = 22 … … 144 146 object btn_sort_name_asc: TSpeedButton 145 147 Left = 58 146 Top = 1 01148 Top = 125 147 149 Width = 20 148 150 Height = 22 … … 164 166 object btn_sort_name_desc: TSpeedButton 165 167 Left = 78 166 Top = 1 01168 Top = 125 167 169 Width = 20 168 170 Height = 22 … … 184 186 object btn_sort_ext_asc: TSpeedButton 185 187 Left = 108 186 Top = 1 01188 Top = 125 187 189 Width = 20 188 190 Height = 22 … … 204 206 object btn_sort_ext_desc: TSpeedButton 205 207 Left = 128 206 Top = 1 01208 Top = 125 207 209 Width = 20 208 210 Height = 22 … … 222 224 OnClick = btn_sortClick 223 225 end 226 object Label3: TLabel 227 Left = 3 228 Top = 6 229 Width = 61 230 Height = 13 231 Caption = 'Connection: ' 232 end 233 object Bevel1: TBevel 234 Left = 0 235 Top = 25 236 Width = 199 237 Height = 3 238 Anchors = [akLeft, akTop, akRight] 239 Style = bsRaised 240 end 224 241 object combo_extension: TComboBox 225 242 Left = 2 226 Top = 76227 Width = 19 2243 Top = 100 244 Width = 196 228 245 Height = 21 229 246 Style = csDropDownList … … 243 260 object check_zerobyte: TCheckBox 244 261 Left = 2 245 Top = 44262 Top = 68 246 263 Width = 130 247 264 Height = 13 … … 252 269 object edit_filtername: TEdit 253 270 Left = 2 254 Top = 20255 Width = 19 2271 Top = 44 272 Width = 196 256 273 Height = 18 257 274 Anchors = [akLeft, akTop, akRight] … … 261 278 object check_filtername: TCheckBox 262 279 Left = 2 263 Top = 5280 Top = 29 264 281 Width = 130 265 282 Height = 15 … … 267 284 TabOrder = 0 268 285 OnClick = check_filternameClick 286 end 287 object combo_connection: TComboBox 288 Left = 64 289 Top = 3 290 Width = 134 291 Height = 21 292 Style = csDropDownList 293 Anchors = [akLeft, akTop, akRight] 294 ItemHeight = 13 295 TabOrder = 4 296 OnChange = combo_connectionChange 269 297 end 270 298 end -
oup/current/Tools/Template.pas
r83 r86 10 10 type 11 11 TNewFileSelectedEvent = procedure(fileinfo: TFileInfo) of object; 12 TNewConnectionEvent = procedure(connection: TOniData) of object; 12 13 13 14 TForm_ToolTemplate = class(TForm) … … 36 37 Label1: TLabel; 37 38 Label2: TLabel; 39 Label3: TLabel; 40 combo_connection: TComboBox; 41 Bevel1: TBevel; 38 42 procedure RecreateList; 43 procedure UpdateList; 44 procedure RecreateExtList; 39 45 procedure LoadFileNames; 40 46 procedure SelectFileName(filename: String); … … 56 62 procedure btn_sortClick(Sender: TObject); 57 63 procedure FormActivate(Sender: TObject); 64 procedure combo_connectionChange(Sender: TObject); 58 65 private 59 66 FSortBy: TSortType; 60 67 FOnNewFileSelected: TNewFileSelectedEvent; 68 FOnNewConnection: TNewConnectionEvent; 61 69 FAllowedExts: String; 62 70 FAllowMultiSelect: Boolean; 63 71 FSelectedFile: TFileInfo; 72 FConnection: TOniData; 64 73 procedure SetAllowedExts(exts: String); 65 74 procedure SetMultiSelect(allow: Boolean); … … 69 78 published 70 79 property OnNewFileSelected: TNewFileSelectedEvent read FOnNewFileSelected write FOnNewFileSelected; 80 property OnNewConnection: TNewConnectionEvent read FOnNewConnection write FOnNewConnection; 71 81 property AllowedExts: String read FAllowedExts write SetAllowedExts; 72 82 property AllowMultiSelect: Boolean read FAllowMultiSelect write SetMultiSelect; 73 83 property SelectedFile: TFileInfo read FSelectedFile; 84 property Connection: TOniData read FConnection; 74 85 end; 75 86 … … 83 94 84 95 96 procedure TForm_ToolTemplate.UpdateList; 97 var 98 i: Integer; 99 fn, datatype, boxstring: String; 100 level: Integer; 101 oldcon: String; 102 begin 103 oldcon := combo_connection.Items.Strings[combo_connection.ItemIndex]; 104 combo_connection.Items.Clear; 105 for i := 0 to High(DataConnections) do 106 begin 107 level := DataConnections[i].LevelInfo.LevelNumber; 108 fn := ExtractFileName(DataConnections[i].FileName); 109 if DataConnections[i].Backend = ODB_Dat then 110 datatype := 'ONI-.dat: ' 111 else if DataConnections[i].Backend = ODB_ADB then 112 datatype := 'OUP-DB: ' 113 else 114 datatype := 'Unknown: '; 115 boxstring := datatype + fn + ' (Level: ' + IntToStr(level) + ')'; 116 combo_connection.Items.Add(boxstring); 117 if oldcon = boxstring then 118 combo_connection.ItemIndex := combo_connection.Items.Count - 1; 119 end; 120 end; 121 85 122 procedure TForm_ToolTemplate.RecreateList; 123 var 124 i: Integer; 125 fn, datatype: String; 126 level: Integer; 127 begin 128 combo_connection.Items.Clear; 129 for i := 0 to High(DataConnections) do 130 begin 131 level := DataConnections[i].LevelInfo.LevelNumber; 132 fn := ExtractFileName(DataConnections[i].FileName); 133 if DataConnections[i].Backend = ODB_Dat then 134 datatype := 'ONI-.dat: ' 135 else if DataConnections[i].Backend = ODB_ADB then 136 datatype := 'OUP-DB: ' 137 else 138 datatype := 'Unknown: '; 139 combo_connection.Items.Add(datatype + fn + ' (Level: ' + IntToStr(level) + ')'); 140 end; 141 FConnection := DataConnections[0]; 142 combo_connection.ItemIndex := 0; 143 combo_connectionChange(Self); 144 end; 145 146 procedure TForm_ToolTemplate.RecreateExtList; 86 147 var 87 148 i: LongWord; … … 90 151 combo_extension.Items.Clear; 91 152 combo_extension.Items.Add('_All files_ (' + 92 IntToStr( OniDataConnection.GetFilesCount) + ')');93 exts := OniDataConnection.GetExtensionsList;153 IntToStr(FConnection.GetFilesCount) + ')'); 154 exts := FConnection.GetExtensionsList; 94 155 for i := 0 to High(exts) do 95 156 if Length(FAllowedExts) > 0 then … … 127 188 Extension := ''; 128 189 129 files := OniDataConnection.GetFilesList(extension, pattern, no_zero_bytes, FSortBy);190 files := FConnection.GetFilesList(extension, pattern, no_zero_bytes, FSortBy); 130 191 131 192 filelist.Visible := False; … … 143 204 ext: String; 144 205 begin 145 id := OniDataConnection.ExtractFileID(filelist.Items.Strings[filelist.ItemIndex]);206 id := FConnection.ExtractFileID(filelist.Items.Strings[filelist.ItemIndex]); 146 207 ext := RightStr(filelist.Items.Strings[filelist.ItemIndex], 4); 147 208 exportd.Filter := 'Files of matching extension (*.' + ext + ')|*.' + ext + '|All files|*.*'; 148 209 exportd.DefaultExt := ext; 149 210 if exportd.Execute then 150 ExportDatFile( id, exportd.FileName);211 ExportDatFile(FConnection, id, exportd.FileName); 151 212 end; 152 213 … … 158 219 data: TData; 159 220 begin 160 id := OniDataConnection.ExtractFileID(filelist.Items.Strings[filelist.ItemIndex]);161 finfo := OniDataConnection.GetFileInfo(id);221 id := FConnection.ExtractFileID(filelist.Items.Strings[filelist.ItemIndex]); 222 finfo := FConnection.GetFileInfo(id); 162 223 163 224 importd.Filter := 'Files of matching extension (*.' + finfo.Extension + ')|*.' + … … 174 235 SetLength(data, fs.Size); 175 236 fs.Read(data[0], fs.Size); 176 OniDataConnection.UpdateDatFile(id, data);237 FConnection.UpdateDatFile(id, data); 177 238 Self.listClick(Self); 178 239 end; … … 187 248 begin 188 249 sender_name := TComponent(Sender).Name; 189 id := OniDataConnection.ExtractFileID(filelist.Items.Strings[filelist.ItemIndex]);250 id := FConnection.ExtractFileID(filelist.Items.Strings[filelist.ItemIndex]); 190 251 context := MidStr(sender_name, Pos('_', sender_name) + 1, Length(sender_name) - Pos('_', sender_name)); 191 252 Form_Main.open_child(context, id); 192 253 end; 193 254 255 procedure TForm_ToolTemplate.combo_connectionChange(Sender: TObject); 256 var 257 name: String; 258 nstart, nend: Integer; 259 i: Integer; 260 begin 261 if combo_connection.ItemIndex >= 0 then 262 begin 263 name := combo_connection.Items.Strings[combo_connection.ItemIndex]; 264 nstart := Pos(' ', name) + 1; 265 nend := Pos('(', name) - 1; 266 name := MidStr(name, nstart, nend - nstart); 267 268 for i := 0 to High(DataConnections) do 269 begin 270 if ExtractFileName(DataConnections[i].FileName) = name then 271 begin 272 FConnection := DataConnections[i]; 273 Break; 274 end; 275 end; 276 if i = Length(DataConnections) then 277 FConnection := nil; 278 279 RecreateExtList; 280 if Assigned(FOnNewConnection) then 281 FOnNewConnection(FConnection); 282 end; 283 end; 284 194 285 procedure TForm_ToolTemplate.combo_extensionClick(Sender: TObject); 195 286 begin … … 205 296 inherited; 206 297 RecreateList; 298 FConnection := nil; 207 299 FSelectedFile.ID := -1; 208 300 FSelectedFile.FileName := ''; … … 270 362 if filelist.ItemIndex > -1 then 271 363 begin 272 fileid := OniDataConnection.ExtractFileID(364 fileid := FConnection.ExtractFileID( 273 365 filelist.Items.Strings[filelist.ItemIndex]); 274 FSelectedFile := OniDataConnection.GetFileInfo(fileid);366 FSelectedFile := FConnection.GetFileInfo(fileid); 275 367 if Assigned(FOnNewFileSelected) then 276 368 FOnNewFileSelected(FSelectedFile); … … 298 390 if filelist.Items.Count > 0 then 299 391 for i := 0 to filelist.Items.Count - 1 do 300 if OniDataConnection.ExtractFileID(filelist.Items.Strings[i]) = id then392 if FConnection.ExtractFileID(filelist.Items.Strings[i]) = id then 301 393 begin 302 394 filelist.ItemIndex := i; … … 321 413 begin 322 414 FAllowedExts := exts; 323 Recreate List;415 RecreateExtList; 324 416 end; 325 417 … … 368 460 Self.Height := 300; 369 461 FOnNewFileSelected := nil; 462 FOnNewConnection := nil; 370 463 FAllowedExts := ''; 371 464 FAllowMultiSelect := False; -
oup/current/Tools/TxmpReplace.dfm
r46 r86 1 1 inherited Form_TxmpReplace: TForm_TxmpReplace 2 2 Caption = 'TxmpReplace' 3 ExplicitWidth = 320 4 ExplicitHeight = 240 3 5 PixelsPerInch = 96 4 6 TextHeight = 13 … … 12 14 object image_txmppreview: TImage [0] 13 15 Left = 0 14 Top = 28316 Top = 307 15 17 Width = 200 16 Height = 3118 Height = 7 17 19 Align = alClient 18 20 ExplicitTop = 111 … … 21 23 object splitter_txmp: TSplitter [1] 22 24 Left = 0 23 Top = 2 7525 Top = 299 24 26 Width = 200 25 27 Height = 8 … … 35 37 Height = 146 36 38 Align = alTop 39 ExplicitTop = 153 37 40 ExplicitHeight = 146 38 41 end -
oup/current/Tools/TxmpReplace.pas
r54 r86 58 58 check_transparency.Checked := (depthbyte and $04) > 0; 59 59 60 OniImage_Old.LoadFromTXMP( fileid);60 OniImage_Old.LoadFromTXMP(connection, fileid); 61 61 old_size := OniImage_Old.GetImageDataSize((fadingbyte and $01) > 0); 62 62 Data := OniImage_Old.GetAsBMP;
Note:
See TracChangeset
for help on using the changeset viewer.