Changeset 240 for oup/current/Tools


Ignore:
Timestamp:
Jul 15, 2007, 1:12:26 AM (17 years ago)
Author:
alloc
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • oup/current/Tools/MetaEditor.pas

    r239 r240  
    138138
    139139
     140
    140141procedure TForm_Meta.VSTFocusChanged(Sender: TBaseVirtualTree;
    141142  Node: PVirtualNode; Column: TColumnIndex);
    142143var
    143144  data: PNodeData;
     145  ffile: TFile;
     146//*******************************************************************
     147  fs: TFileStream;
     148//*******************************************************************
    144149begin
    145150  data := Sender.GetNodeData(Node);
     151  ffile := nil;
    146152  if data.Field is TFile then
    147   begin
    148     TFile(data.Field).InitEditor;
    149     if Assigned(TFile(data.Field).Editor) then
     153    ffile := TFile(data.Field);
     154  if data.Field is TDatLink then
     155    if Assigned(TDatLink(data.Field).TargetFile) then
     156      ffile := TFile(TDatLink(data.Field).TargetFile);
     157  if Assigned(ffile) then
     158  begin
     159    if Assigned(ffile.Editor) then
    150160    begin
    151       TFile(data.Field).Editor.Align := alClient;
    152       tab_meta.InsertControl(TFile(data.Field).Editor);
    153       TFile(data.Field).Opened := True;
    154     end;
     161      ffile.Editor.Align := alClient;
     162      tab_meta.InsertControl(ffile.Editor);
     163      ffile.Opened := True;
     164    end;
     165//*******************************************************************
     166    fs := TFileStream.Create('C:\Spiele\Oni\GameDataFolder\tests\'+IntToStr(ffile.FileInfo.ID)+'_recreated.hex', fmCreate);
     167    ffile.ReCreateFile(fs);
     168    fs.Free;
     169//*******************************************************************
    155170  end;
    156171end;
     
    167182  if data.Field is TFile then
    168183  begin
    169     TFile(data.Field).InitEditor;
    170184    if Assigned(TFile(data.Field).Editor) then
    171185      Allowed := not TFile(data.Field).Opened
Note: See TracChangeset for help on using the changeset viewer.