Changeset 233 for oup


Ignore:
Timestamp:
Jun 29, 2007, 2:38:24 PM (17 years ago)
Author:
alloc
Message:
 
Location:
oup/current
Files:
1 added
124 edited

Legend:

Unmodified
Added
Removed
  • oup/current/FileClasses/ABNA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/AGDB.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/AGQC.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/AGQG.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/AGQM.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/AGQR.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/AISA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/AITR.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/AIWA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/AKAA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/AKBA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/AKBP.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/AKDA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/AKEV.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/AKOT.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/AKVA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/BINA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/CBPI.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/CBPM.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/CONS.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/CRSA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/DOOR.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/DPge.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/EDIA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/ENVP.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/FILM.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/FXLR.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/GMAN.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/HPge.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/IDXA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/IGHH.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/IGPA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/IGPG.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/IGSA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/IGSt.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/IPge.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/Impt.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/KeyI.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/M3GA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/M3GM.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/M3TA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/Mtrl.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/NMSA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/OBAN.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/OBDC.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/OBLS.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/OBOA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/OFGA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/ONCC.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/ONCP.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/ONCV.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/ONFA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/ONGS.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/ONIA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/ONLD.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/ONLV.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/ONMA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/ONOA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/ONSA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/ONSK.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/ONTA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/ONVL.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/ONWC.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/OPge.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/OSBD.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/OTIT.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/OTLF.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/PLEA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/PNTA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/PSUI.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/PSpL.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/PSpc.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/QTNA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/QUDA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/SNDD.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/SUBT.pas

    r215 r233  
    1616
    1717uses
    18   ConnectionManager, Math, Classes, TypeDefs, _DataTypes, Forms, StdCtrls;
     18  ConnectionManager, Math, Classes, TypeDefs, _DataTypes, Forms, StdCtrls, Grids;
    1919
    2020procedure TFile_SUBT.InitDataFields;
     
    4242    end;
    4343  end;
     44  FFileStream.Free;
     45  FFileStream := nil;
    4446end;
    4547
     
    4749procedure TFile_SUBT.InitEditor;
    4850var
    49   lab: TLabel;
     51  grid: TStringGrid;
    5052begin
    5153  FEditor := TFrame.Create(nil);
    52   lab := TLabel.Create(FEditor);
    53   lab.Left := 0;
    54   lab.Top := 0;
    55   lab.Caption := 'Hello World';
    56   FEditor.InsertControl(lab);
     54  grid := TStringGrid.Create(FEditor);
     55  grid.Parent := FEditor;
    5756end;
    5857
    5958end.
    60 
  • oup/current/FileClasses/StNA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TMFA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TMRA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TRAC.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TRAM.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TRAS.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TRBS.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TRCM.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TRFT.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TRGA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TRGE.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TRIA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TRIG.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TRMA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TRSC.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TRTA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TSFF.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TSFL.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TSFT.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TSGA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TStr.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TURR.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TXAN.pas

    r215 r233  
    2020var
    2121  tempi: Integer;
     22  arrargs: TArrayArgs;
    2223begin
    2324  inherited;
     
    4445    AddField(TUnused, $1A, 'Unused', '', @tempi);
    4546
    46     tempi := 2;
    47     with AddField(TArray, $1C, 'AnimTextures array', '', @tempi) do
     47    arrargs.CounterSize := 2;
     48    arrargs.BlockLength := 4;
     49    with AddField(TArray, $1C, 'AnimTextures array', '', @arrargs) do
    4850    begin
    4951      AddField(TLinkByID, $00, 'Texture', '', nil);
    5052    end;
    5153  end;
     54  FFileStream.Free;
     55  FFileStream := nil;
    5256end;
    5357
    5458
    5559end.
    56 
  • oup/current/FileClasses/TXCA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TXMA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TXMB.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TXMP.pas

    r232 r233  
    1616
    1717uses
    18   ConnectionManager, Math, Classes, TypeDefs, _DataTypes, ExtCtrls, StdCtrls, 
     18  ConnectionManager, Math, Classes, TypeDefs, _DataTypes, ExtCtrls, StdCtrls,
    1919  Controls, Forms;
    2020
     
    105105  end;
    106106  templist.Free;
     107  FFileStream.Free;
     108  FFileStream := nil;
    107109end;
    108110
     
    137139
    138140end.
    139 
  • oup/current/FileClasses/TXPC.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/TxtC.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/UUEA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/UVDL.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/VCRA.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/WMCL.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/WMDD.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/WMMB.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/WMM_.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/WPge.pas

    r215 r233  
    2828    AddField(TLevelID, $04, 'LevelID', '', nil);
    2929  end;
     30  FFileStream.Free;
     31  FFileStream := nil;
    3032end;
    3133
    3234
    3335end.
    34 
  • oup/current/FileClasses/_DataTypes.pas

    r213 r233  
    44
    55uses
    6   Classes;
     6  Classes, _TreeElement;
    77
    88type
    9   TDataField = class
     9  TDataField = class(TTreeElement)
     10      function GetChildCount: Integer; override;
     11      function GetChild(ID: Integer): TTreeElement; override;
     12      function GetCaption: String; override;
    1013    protected
    1114      FOffset: Integer;
     
    3639    private
    3740      FDataFields: array of TDataField;
     41      FBlockLength: Integer;
     42      function GetChildCount: Integer; override;
     43      function GetChild(ID: Integer): TTreeElement; override;
    3844      function GetFieldByOffset(Offset: Integer): TDataField;
    39       function GetFieldByIndex(ID: Integer): TDataField;
    40       function GetFieldCount: Integer;
    41     public
    42       // ExtraArgs: keine
     45    public
     46      // ExtraArgs: Pointer auf Integer: BlockLength
    4347      constructor Create(ParentFile: TObject; ParentField: TDataField;
    4448          Offset: Integer; Name, Description: String; ExtraArgs: Pointer); override;
    4549      procedure Update(Offset, Length: Integer); override;
    4650      property FieldByOffset[Offset: Integer]: TDataField read GetFieldByOffset;
    47       property FieldByIndex[ID: Integer]: TDataField read GetFieldByIndex;
    48       property FieldCount: Integer read GetFieldCount;
    4951
    5052      function AddField(fieldtype: TFieldType; Offset: Integer;
     
    103105
    104106  TLinkByID = class(TDataField)
     107      function GetChildCount: Integer; override;
     108      function GetChild(ID: Integer): TTreeElement; override;
    105109    private
    106110      FFileID: Integer;
     
    127131
    128132
     133  TArrayArgs = packed record
     134    CounterSize: Integer;
     135    BlockLength: Integer;
     136    BlockCount:  Integer;
     137  end;
    129138  TArray = class(TDataField)
    130139    private
    131       FDataFields: array of TDataField;
     140      FDataFields: array of TBlock;
     141      function GetChildCount: Integer; override;
     142      function GetChild(ID: Integer): TTreeElement; override;
    132143      function GetFieldByOffset(Offset: Integer): TDataField;
    133       function GetFieldByIndex(ID: Integer): TDataField;
    134       function GetFieldCount: Integer;
    135     public
    136       // ExtraArgs: Pointer auf 2 Integer: Length+Count (packed record...)
    137       constructor Create(ParentFile: TObject; ParentField: TDataField;
    138           Offset: Integer; Name, Description: String; ExtraArgs: Pointer); override;
    139       procedure Update(Offset, Length: Integer); override;
    140       property FieldByOffset[Offset: Integer]: TDataField read GetFieldByOffset;
    141       property FieldByIndex[ID: Integer]: TDataField read GetFieldByIndex;
    142       property FieldCount: Integer read GetFieldCount;
     144    public
     145      // ExtraArgs: Pointer auf 3 Integer: CounterSize+Length+Count (packed record...)
     146      constructor Create(ParentFile: TObject; ParentField: TDataField;
     147          Offset: Integer; Name, Description: String; ExtraArgs: Pointer); override;
     148      procedure Update(Offset, Length: Integer); override;
    143149
    144150      function AddField(fieldtype: TFieldType; Offset: Integer;
     
    190196  FParentFile := ParentFile;
    191197  FParentField := ParentField;
     198  FConnectionID := TFile(ParentFile).ConnectionID;
     199end;
     200
     201function TDataField.GetCaption: String;
     202begin
     203  Result := FName;
     204end;
     205
     206function TDataField.GetChild(ID: Integer): TTreeElement;
     207begin
     208  Result := nil;
     209end;
     210
     211function TDataField.GetChildCount: Integer;
     212begin
     213  Result := 0;
    192214end;
    193215
     
    265287constructor TArray.Create(ParentFile: TObject; ParentField: TDataField;
    266288    Offset: Integer; Name, Description: String; ExtraArgs: Pointer);
    267 begin
    268   inherited Create(ParentFile, ParentField, Offset, Name, Description, ExtraArgs);
    269 end;
    270 
    271 function TArray.GetFieldByIndex(ID: Integer): TDataField;
    272 begin
    273   if ID < Length(FDataFields) then
    274     Result := FDataFields[ID]
    275   else
    276     Result := nil;
    277 end;
    278 
    279 function TArray.GetFieldByOffset(Offset: Integer): TDataField;
    280289var
    281290  i: Integer;
    282 begin
    283   Result := nil;
    284 
     291  args: TArrayArgs;
     292  fstream: TMemoryStream;
     293begin
     294  inherited Create(ParentFile, ParentField, Offset, Name, Description, ExtraArgs);
     295  args := TArrayArgs(ExtraArgs^);
     296  if args.CounterSize > 0 then
     297  begin
     298    fstream := TFile(ParentFile).FileStream;
     299    fstream.Seek(Offset, soFromBeginning);
     300    args.BlockCount := 0;
     301    fstream.Read(args.BlockCount, args.CounterSize);
     302  end;
     303  SetLength(FDataFields, args.BlockCount);
    285304  if Length(FDataFields) > 0 then
    286305  begin
    287306    for i := 0 to High(FDataFields) do
    288       if FDataFields[i].Offset = Offset then
    289         break;
    290     if i < Length(FDataFields) then
    291       Result := FDataFields[i];
    292   end;
    293 end;
    294 
    295 function TArray.GetFieldCount: Integer;
     307    begin
     308      FDataFields[i] := TBlock.Create(ParentFile, Self,
     309          Offset + args.CounterSize + i * args.BlockLength, Name+'['+IntToStr(i)+']', '', @args.BlockLength);
     310    end;
     311  end;
     312end;
     313
     314function TArray.GetChildCount: Integer;
    296315begin
    297316  Result := Length(FDataFields);
     317end;
     318
     319function TArray.GetChild(ID: Integer): TTreeElement;
     320begin
     321  Result := FDataFields[ID];
     322end;
     323
     324function TArray.GetFieldByOffset(Offset: Integer): TDataField;
     325begin
     326  Exit;
    298327end;
    299328
     
    333362begin
    334363  inherited Create(ParentFile, ParentField, Offset, Name, Description, ExtraArgs);
    335 end;
    336 
    337 function TBlock.GetFieldByIndex(ID: Integer): TDataField;
     364  if ExtraArgs <> nil then
     365    FBlockLength := Integer(ExtraArgs^)
     366  else
     367    FBlockLength := -1;
     368end;
     369
     370function TBlock.GetChild(ID: Integer): TTreeElement;
    338371begin
    339372  Result := FDataFields[ID];
    340373end;
    341374
     375function TBlock.GetChildCount: Integer;
     376begin
     377  Result := Length(FDataFields);
     378end;
     379
    342380function TBlock.GetFieldByOffset(Offset: Integer): TDataField;
    343381begin
    344382  Exit;
    345 end;
    346 
    347 function TBlock.GetFieldCount: Integer;
    348 begin
    349   Result := Length(FDataFields);
    350383end;
    351384
     
    433466end;
    434467
     468function TLinkByID.GetChild(ID: Integer): TTreeElement;
     469begin
     470  if FFileID > 0 then
     471    Result := ConManager.Connection[FConnectionID].MetaData.FileById[FFileID].Child[ID]
     472  else
     473    Result := nil;
     474end;
     475
     476function TLinkByID.GetChildCount: Integer;
     477begin
     478  if FFileID > 0 then
     479    Result := ConManager.Connection[FConnectionID].MetaData.FileById[FFileID].ChildCount
     480  else
     481    Result := 0;
     482end;
     483
    435484function TLinkByID.GetValueAsString: String;
    436485begin
  • oup/current/FileClasses/_Extensions.pas

    r231 r233  
    44
    55uses
    6   _FileTypes;
     6  _FileTypes, _TreeElement;
    77
    88type
    9   TExtension = class
     9  TExtension = class(TTreeElement)
     10      function GetChildCount: Integer; override;
     11      function GetChild(ID: Integer): TTreeElement; override;
     12      function GetCaption: String; override;
    1013    private
    11       FConnectionID: Integer;
    1214      FExt: String;
    1315      FFiles: array of Integer;
    14       function GetFile(ID: Integer): Integer;
    15       function GetFileCount: Integer;
    1616    public
    1717      constructor Create(ConnectionID: Integer; Ext: String); virtual;
    1818      procedure InitList;
    19       property Ext: String read FExt;
    20       property Files[ID: Integer]: Integer read GetFile;
    21       property FileCount: Integer read GetFileCount;
    2219  end;
    2320
    24   TExtensions = array of TExtension;
    25                      
     21  TExtensions = class(TTreeElement)
     22      function GetChildCount: Integer; override;
     23      function GetChild(ID: Integer): TTreeElement; override;
     24      function GetCaption: String; override;
     25    private
     26      FExtensions: array of TExtension;
     27    public
     28      constructor Create(DataAccess: TObject; ConnectionID: Integer);
     29      function GetExt(Ext: String): TExtension;
     30      procedure AddExt(Ext: String);
     31  end;
     32
    2633
    2734
     
    2936
    3037uses
    31   Classes, StrUtils, SysUtils, ConnectionManager, TypeDefs;
     38  Classes, StrUtils, SysUtils, ConnectionManager, TypeDefs, DataAccess, _MetaManager;
    3239
    3340{ TExtension }
     
    3946end;
    4047
    41 function TExtension.GetFile(ID: Integer): Integer;
     48function TExtension.GetCaption: String;
    4249begin
    43   Result := FFiles[ID];
     50  Result := FExt;
    4451end;
    4552
    46 function TExtension.GetFileCount: Integer;
     53function TExtension.GetChild(ID: Integer): TTreeElement;
     54var
     55  Meta: TMetaManager;
     56begin
     57  Meta := ConManager.Connection[FConnectionID].MetaData;
     58  Meta.InitFile(FFiles[ID]);
     59  Result := Meta.FileById[FFiles[ID]];
     60end;
     61
     62function TExtension.GetChildCount: Integer;
    4763begin
    4864  Result := Length(FFiles);
     
    5773begin
    5874  files := TStringList.Create;
    59   files := ConManager.Connection[FConnectionID].GetFilesList(Ext, '', False, ST_NameAsc);
     75  files := ConManager.Connection[FConnectionID].GetFilesList(FExt, '', False, ST_NameAsc);
    6076  if files.Count > 0 then
    6177  begin
     
    7490end;
    7591
     92
     93{ TExtensions }
     94
     95function TExtensions.GetCaption: String;
     96begin
     97  Result := '';
     98end;
     99
     100function TExtensions.GetChild(ID: Integer): TTreeElement;
     101begin
     102  Result := FExtensions[ID];
     103end;
     104
     105function TExtensions.GetChildCount: Integer;
     106begin
     107  Result := Length(FExtensions);
     108end;
     109
     110constructor TExtensions.Create(DataAccess: TObject; ConnectionID: Integer);
     111var
     112  files: TStrings;
     113  i: Integer;
     114  fid: Integer;
     115  finfo: TFileInfo;
     116begin
     117  FConnectionID := ConnectionID;
     118  files := TStringList.Create;
     119  files := TDataAccess(DataAccess).GetFilesList('', '', False, ST_IDAsc);
     120  SetLength(FExtensions, 0);
     121  if files.Count > 0 then
     122  begin
     123    for i := 0 to files.Count - 1 do
     124    begin
     125      fid := StrToInt(MidStr(files.Strings[i], 1, 5));
     126      finfo := TDataAccess(DataAccess).GetFileInfo(fid);
     127      if Length(finfo.Name) > 0 then
     128        if not Assigned(GetExt(finfo.Extension)) then
     129          AddExt(finfo.Extension);
     130    end;
     131  end;
     132  files.Free;
     133end;
     134
     135
     136function TExtensions.GetExt(Ext: String): TExtension;
     137var
     138  i: Integer;
     139begin
     140  Result := nil;
     141  if Length(FExtensions) > 0 then
     142    for i := 0 to High(FExtensions) do
     143      if FExtensions[i].GetCaption = Ext then
     144      begin
     145        Result := FExtensions[i];
     146        Break;
     147      end;
     148end;
     149
     150procedure TExtensions.AddExt(Ext: String);
     151var
     152  i: Integer;
     153begin
     154  SetLength(FExtensions, Length(FExtensions) + 1);
     155  for i := High(FExtensions) downto 1 do
     156  begin
     157    if FExtensions[i-1].GetCaption < Ext then
     158    begin
     159      FExtensions[i] := TExtension.Create(FConnectionID, Ext);
     160      Break;
     161    end
     162    else
     163      FExtensions[i] := FExtensions[i-1];
     164  end;
     165  if i = 0 then
     166    FExtensions[0] := TExtension.Create(FConnectionID, Ext);
     167end;
     168
     169
     170
    76171end.
  • oup/current/FileClasses/_FileTypes.pas

    r232 r233  
    44
    55uses
    6   TypeDefs, _DataTypes, Classes, Forms;
     6  TypeDefs, _DataTypes, _TreeElement, Classes, Forms;
    77
    88
    99type
    10   TFile = class
     10  TFile = class(TTreeElement)
     11      function GetChildCount: Integer; override;
     12      function GetChild(ID: Integer): TTreeElement; override;
     13      function GetCaption: String; override;
     14  private
     15    FConnectionID: Integer;
    1116    protected
    12       FConnectionID: Integer;
    1317      FFileInfo: TFileInfo;
    1418      FFileStream: TMemoryStream;
     
    1721      FChanged: Boolean;
    1822
    19       FDatLinks: TDatLinkList;
    2023      FDataFields: TBlock;
    21       FRawParts: TRawDataList;
    2224
    2325      FEditor: TFrame;
    2426      FOpened: Boolean;
    2527
    26       procedure InitDatLinks;
    27       procedure InitRawList;
    28 
    29       function GetDatLinkByOffset(Offset: Integer): TDatLink;
    30       function GetDatLinkByIndex(ID: Integer): TDatLink;
    3128      function GetFieldByOffset(Offset: Integer): TDataField;
    32       function GetFieldByIndex(ID: Integer): TDataField;
    33       function GetRawPartByOffset(Offset: Integer): TRawDataInfo;
    34       function GetRawPartByIndex(ID: Integer): TRawDataInfo;
    35       function GetChildCount: Integer;
    36       function GetRawCount: Integer;
     29  published
    3730    public
    3831      constructor Create(ConnectionID, FileID: Integer); virtual;
     
    5245      property Opened: Boolean read FOpened write FOpened;
    5346
    54       property ChildCount: Integer read GetChildCount;
    55       property LinkByOffset[Offset: Integer]: TDatLink read GetDatLinkByOffset;
    56       property LinkByIndex[ID: Integer]: TDatLink read GetDatLinkByIndex;
    57 
    5847      property FieldByOffset[Offset: Integer]: TDataField read GetFieldByOffset;
    59       property FieldByIndex[ID: Integer]: TDataField read GetFieldByIndex;
    60 
    61       property RawCount: Integer read GetRawCount;
    62       property RawPartByOffset[Offset: Integer]: TRawDataInfo read GetRawPartByOffset;
    63       property RawPartByIndex[ID: Integer]: TRawDataInfo read GetRawPartByIndex;
    6448  end;
    6549
     
    6852
    6953
    70 function GetDatLinkValue(stream: TStream; offset: Integer): Integer;
    71 
    72 
    7354
    7455implementation
    7556
    7657uses
    77   DatLinks, RawList, ConnectionManager, Dialogs, _EmptyFile;
     58  DatLinks, RawList, ConnectionManager, Dialogs, _MetaTypes, _MetaManager;
    7859
    7960{ TFileType }
     
    8970  if not (Self is TFile_Empty) then
    9071  begin
    91     InitDatLinks();
    92     InitRawList();
    9372    FDataFields := nil;
     73    InitDataFields;
    9474    FEditor := nil;
    9575  end
    9676  else
    9777  begin
    98     SetLength(FDatLinks, 0);
    99     SetLength(FRawParts, 0);
    10078    FEditor := nil;
    10179  end;
     
    10886end;
    10987
    110 function TFile.GetDatLinkByIndex(ID: Integer): TDatLink;
    111 var
    112   i: Integer;
    113   valids: Integer;
    114 begin
    115   if ID < GetChildCount then
    116   begin
    117     valids := 0;
    118     i := 0;
    119     repeat
    120       if FDatLinks[i].DestID >= 0 then
    121       begin
    122         Inc(valids);
    123       end;
    124       Inc(i);
    125     until valids > ID;
    126     Result := FDatLinks[i - 1];
    127   end
    128   else
    129     with Result do
    130     begin
    131       SrcOffset := -1;
    132       DestID := -1;
    133       PosDestExts := '';
    134     end;
    135 end;
    136 
    137 function TFile.GetDatLinkByOffset(Offset: Integer): TDatLink;
    138 var
    139   i: Integer;
    140 begin
    141   Result.SrcOffset := -1;
    142   Result.DestID := -1;
    143   Result.PosDestExts := '';
    144  
    145   if Length(FDatLinks) > 0 then
    146   begin
    147     for i := 0 to High(FDatLinks) do
    148       if FDatLinks[i].SrcOffset = Offset then
    149         break;
    150     if i < Length(FDatLinks) then
    151       Result := FDatLinks[i];
    152   end;
    153 end;
    154 
    155 
    156 function TFile.GetFieldByIndex(ID: Integer): TDataField;
    157 begin
    158   Result := FDataFields.FieldByIndex[ID];
    159 end;
    16088
    16189function TFile.GetFieldByOffset(Offset: Integer): TDataField;
     
    16593
    16694
    167 function TFile.GetChildCount: Integer;
    168 var
    169   i: Integer;
     95function TFile.GetCaption: String;
    17096begin
    171   Result := Length(FDatLinks);
    172   if Result > 0 then
    173   begin
    174     Result := 0;
    175     for i := 0 to High(FDatLinks) do
    176       if FDatLinks[i].DestID >= 0 then
    177         Inc(Result);
    178   end;
     97  Result := FFileInfo.Name;
     98  if Result = '' then
     99    Result := 'Unnamed';
    179100end;
    180101
    181 function TFile.GetRawCount: Integer;
    182 var
    183   i: Integer;
     102function TFile.GetChild(ID: Integer): TTreeElement;
    184103begin
    185   Result := Length(FRawParts);
    186   if Result > 0 then
    187   begin
    188     Result := 0;
    189     for i := 0 to High(FRawParts) do
    190       if FRawParts[i].RawSize > 0 then
    191         Inc(Result);
    192   end;
     104  Result := FDataFields.Child[ID];
    193105end;
    194106
    195 function TFile.GetRawPartByIndex(ID: Integer): TRawDataInfo;
    196 var
    197   i: Integer;
    198   valids: Integer;
     107function TFile.GetChildCount: Integer;
    199108begin
    200   if ID < GetRawCount then
    201   begin
    202     valids := 0;
    203     i := 0;
    204     repeat
    205       if FRawParts[i].RawSize > 0 then
    206       begin
    207         Inc(valids);
    208       end;
    209       Inc(i);
    210     until valids > ID;
    211     Result := FRawParts[i - 1];
    212   end
    213   else
    214     with Result do
    215     begin
    216       SrcID := -1;
    217       SrcOffset := -1;
    218       RawAddr := -1;
    219       RawSize := -1;
    220     end;
     109  if FDataFields <> nil then
     110    Result := FDataFields.ChildCount;
    221111end;
    222 
    223 function TFile.GetRawPartByOffset(Offset: Integer): TRawDataInfo;
    224 var
    225   i: Integer;
    226 begin
    227   with Result do
    228   begin
    229     SrcID := -1;
    230     SrcOffset := -1;
    231     RawAddr := -1;
    232     RawSize := -1;
    233   end;
    234 
    235   if Length(FRawParts) > 0 then
    236   begin
    237     for i := 0 to High(FRawParts) do
    238       if FRawParts[i].SrcOffset = Offset then
    239         break;
    240     if i < Length(FRawParts) then
    241       Result := FRawParts[i];
    242   end;
    243 end;
    244 
    245112
    246113
     
    249116  if Assigned(FDataFields) then
    250117    Exit;
     118  FFileStream := TMemoryStream.Create;
     119  ConManager.Connection[FConnectionID].LoadDatFile(FFileInfo.ID, TStream(FFileStream));
    251120end;
    252121
    253 procedure TFile.InitDatLinks;
    254 begin
    255   FDatLinks := ConManager.Connection[FConnectionID].GetDatLinks(FFileInfo.ID);
    256 end;
    257122
    258123procedure TFile.InitEditor;
     
    261126end;
    262127
    263 procedure TFile.InitRawList;
    264 begin
    265   FRawParts := ConManager.Connection[FConnectionID].GetRawList(FFileInfo.ID);
    266 end;
    267 
    268 function GetDatLinkValue(stream: TStream; offset: Integer): Integer;
    269 begin
    270   stream.Seek(Offset, soFromBeginning);
    271   stream.Read(Result, 4);
    272   if Result > 0 then
    273     Result := Result div 256
    274   else
    275     Result := -1;
    276 end;
    277128
    278129end.
  • oup/current/FileClasses/_MetaManager.pas

    r229 r233  
    1313      function GetFileCount: Integer;
    1414      function GetFileById(Id: Integer): TFile;
    15       function GetExt(Ext: String): TExtension;
    16       procedure AddExt(Ext: String);
    1715    private
    18       procedure InitExts;
    1916    public
    2017      constructor Create(ConnectionID: Integer; DataAccess: TObject);
    21       procedure InitExtFiles(Ext: String);
    2218      procedure InitFile(id: Integer);
    2319      procedure InitFileFields(id: Integer);
    2420
    2521      property Root: TExtensions read FRoot;
    26       property RootExt[Ext: String]: TExtension read GetExt;
    2722      property FileCount: Integer read GetFileCount;
    2823      property FileById[Id: Integer]: TFile read GetFileById;
     
    3328uses
    3429  Classes, ConnectionManager, Access_OniArchive, TypeDefs,
    35   Dialogs, SysUtils, StrUtils, DataAccess;
     30  Dialogs, SysUtils, StrUtils, DataAccess, _Extensions;
    3631
    3732{ TFileManager }
     
    4237  FDataAccess := DataAccess;
    4338  SetLength(FFiles, TDataAccess(DataAccess).GetFileCount);
    44   InitExts;
     39  FRoot := TExtensions.Create(DataAccess, ConnectionID);
    4540end;
    4641
    47 function TMetaManager.GetExt(Ext: String): TExtension;
    48 var
    49   i: Integer;
    50 begin
    51   Result := nil;
    52   if Length(FRoot) > 0 then
    53     for i := 0 to High(FRoot) do
    54       if FRoot[i].Ext = Ext then
    55       begin
    56         Result := FRoot[i];
    57         Break;
    58       end;
    59 end;
    60 
    61 procedure TMetaManager.AddExt(Ext: String);
    62 var
    63   i: Integer;
    64 begin
    65   SetLength(FRoot, Length(FRoot) + 1);
    66   for i := High(FRoot) downto 1 do
    67   begin
    68     if FRoot[i-1].Ext < Ext then
    69     begin
    70       FRoot[i] := TExtension.Create(FConnectionID, Ext);
    71       Break;
    72     end
    73     else
    74       FRoot[i] := FRoot[i-1];
    75   end;
    76   if i = 0 then
    77     FRoot[0] := TExtension.Create(FConnectionID, Ext);
    78 end;
    7942
    8043function TMetaManager.GetFileById(Id: Integer): TFile;
    8144begin
     45  InitFile(Id);
    8246  Result := FFiles[Id];
    8347end;
     
    13094end;
    13195
    132 procedure TMetaManager.InitExtFiles(Ext: String);
    133 var
    134   files: TStrings;
    135   i: Integer;
    136   typei: Integer;
    137   fid: Integer;
    138   finfo: TFileInfo;
    139 begin
    140   if ConManager.Connection[FConnectionID] is TAccess_OniArchive then
    141     TAccess_OniArchive(ConManager.Connection[FConnectionID]).UnloadWhenUnused := False;
    142   files := TStringList.Create;
    143   files := ConManager.Connection[FConnectionID].GetFilesList('', '', False, ST_IDAsc);
    144   SetLength(FFiles, ConManager.Connection[FConnectionID].GetFileCount);
    145   for i := 0 to High(FFiles) do
    146     FFiles[i] := nil;
    147   if files.Count > 0 then
    148   begin
    149     for i := 0 to files.Count - 1 do
    150     begin
    151       fid := StrToInt(MidStr(files.Strings[i], 1, 5));
    152       finfo := ConManager.Connection[FConnectionID].GetFileInfo(fid);
    153       if Length(finfo.Name) > 0 then
    154       begin
    155         if finfo.Size > 0 then
    156         begin
    157           for typei := 0 to High(FileDescs) do
    158           begin
    159             if FileDescs[typei].ext = finfo.Extension then
    160             begin
    161               FFiles[fid] := TFileClass(FileDescs[typei].ftype).Create(FConnectionID, fid);
    162               Break;
    163             end;
    164           end;
    165         end
    166         else
    167           FFiles[fid] := TFile_Empty.Create(FConnectionID, fid);
    168       end;
    169     end;
    170   end;
    171   files.Free;
    172   if ConManager.Connection[FConnectionID] is TAccess_OniArchive then
    173     TAccess_OniArchive(ConManager.Connection[FConnectionID]).UnloadWhenUnused := True;
    174 end;
    175 
    176 procedure TMetaManager.InitExts;
    177 var
    178   files: TStrings;
    179   i: Integer;
    180   fid: Integer;
    181   finfo: TFileInfo;
    182 begin
    183   files := TStringList.Create;
    184   files := TDataAccess(FDataAccess).GetFilesList('', '', False, ST_IDAsc);
    185   SetLength(FRoot, 0);
    186   if files.Count > 0 then
    187   begin
    188     for i := 0 to files.Count - 1 do
    189     begin
    190       fid := StrToInt(MidStr(files.Strings[i], 1, 5));
    191       finfo := TDataAccess(FDataAccess).GetFileInfo(fid);
    192       if Length(finfo.Name) > 0 then
    193         if not Assigned(GetExt(finfo.Extension)) then
    194           AddExt(finfo.Extension);
    195     end;
    196   end;
    197   files.Free;
    198 end;
    199 
    20096end.
  • oup/current/FileClasses/_MetaTypes.pas

    r229 r233  
    44
    55uses
    6   _FileTypes, _EmptyFile, _DataTypes, _Extensions,
     6  _FileTypes, _EmptyFile, _Unlinked, _DataTypes, _Extensions, _TreeElement,
    77  ABNA, AGDB, AGQC, AGQG, AGQM, AGQR, AISA, AITR, AIWA, AKAA, AKBA, AKBP, AKDA,
    88  AKEV, AKOT, AKVA, BINA, CBPI, CBPM, CONS, CRSA, DOOR, DPge, EDIA, ENVP, FILM,
     
    1616
    1717type
     18  TTreeElement = _TreeElement.TTreeElement;
    1819  TFile = _FileTypes.TFile;
    1920  TFile_Empty = _EmptyFile.TFile_Empty;
     21  TFile_Unlinked = _Unlinked.TFile_Unlinked;
    2022  TExtension = _Extensions.TExtension;
    2123  TExtensions = _Extensions.TExtensions;
  • oup/current/OniUnPacker.dpr

    r228 r233  
    152152  FileManager in 'Tools\FileManager.pas' {Form_FileManager},
    153153  _Extensions in 'FileClasses\_Extensions.pas',
    154   _MetaTypes in 'FileClasses\_MetaTypes.pas';
     154  _MetaTypes in 'FileClasses\_MetaTypes.pas',
     155  _TreeElement in 'FileClasses\_TreeElement.pas',
     156  _Unlinked in 'FileClasses\_Unlinked.pas';
    155157
    156158{$R *.res}
  • oup/current/Tools/MetaEditor.dfm

    r232 r233  
    1212    ExplicitTop = 25
    1313    ExplicitWidth = 598
    14     ExplicitHeight = 532
     14    ExplicitHeight = 424
    1515    object splitter: TSplitter
    1616      Left = 190
     
    4848      OnPaintText = VSTPaintText
    4949      OnInitChildren = VSTInitChildren
    50       ExplicitWidth = 502
    51       ExplicitHeight = 532
    5250      Columns = <
    5351        item
     
    8078        Caption = 'Meta Edit'
    8179        ImageIndex = 1
    82         ExplicitWidth = 192
    83         ExplicitHeight = 504
     80        ExplicitLeft = 0
     81        ExplicitTop = 0
     82        ExplicitWidth = 0
     83        ExplicitHeight = 0
    8484      end
    8585      object tab_hex: TTabSheet
    8686        Caption = 'Binary Edit'
    87         ExplicitWidth = 192
    88         ExplicitHeight = 504
    8987        object splitter_hex_1: TSplitter
    9088          Left = 0
     
    102100        object splitter_hex_2: TSplitter
    103101          Left = 0
    104           Top = 250
     102          Top = 256
    105103          Width = 392
    106104          Height = 8
     
    115113        object panel_hex_actions: TPanel
    116114          Left = 0
    117           Top = 355
    118           Width = 392
    119           Height = 41
     115          Top = 361
     116          Width = 392
     117          Height = 35
    120118          Align = alBottom
    121119          BevelOuter = bvNone
    122120          Caption = 'panel_hex_actions'
    123121          TabOrder = 0
    124           ExplicitLeft = 3
    125           ExplicitTop = 354
    126           ExplicitWidth = 192
     122          object btn_export: TButton
     123            Left = 2
     124            Top = 6
     125            Width = 117
     126            Height = 25
     127            Caption = 'Export to file...'
     128            TabOrder = 0
     129          end
     130          object btn_import: TButton
     131            Left = 125
     132            Top = 6
     133            Width = 117
     134            Height = 25
     135            Caption = 'Import from file...'
     136            TabOrder = 1
     137          end
    127138        end
    128139        object hex: TMPHexEditor
     
    151162          Colors.EvenColumn = clNavy
    152163          Colors.CurrentOffsetBackground = clBtnShadow
    153           Colors.OffsetBackground = clBtnFace
     164          Colors.OffsetBackGround = clBtnFace
    154165          Colors.CurrentOffset = clBtnHighlight
    155166          Colors.Grid = clBtnFace
     
    160171          AllowInsertMode = False
    161172          DrawGridLines = False
    162           Version = 'december 06, 2006; '#169' markus stephany, vcl[at]mirkes[dot]de'
     173          Version = 'May 23, 2005; '#169' markus stephany, vcl[at]mirkes[dot]de'
    163174          ShowPositionIfNotFocused = True
    164           ExplicitWidth = 192
    165175        end
    166176        object value_viewer: TWrapGrid
     
    168178          Top = 108
    169179          Width = 392
    170           Height = 142
     180          Height = 148
    171181          Align = alClient
    172182          ColCount = 1
     
    179189          ScrollBars = ssVertical
    180190          TabOrder = 2
    181           ExplicitTop = 363
    182           ExplicitWidth = 192
    183           ExplicitHeight = 0
    184191        end
    185192        object structviewer: TVirtualStringTree
    186193          Left = 0
    187           Top = 258
     194          Top = 264
    188195          Width = 392
    189196          Height = 97
     
    225232          OnFocusChanged = VSTFocusChanged
    226233          OnGetText = VSTGetText
    227           ExplicitLeft = -6
    228           ExplicitTop = 161
    229           ExplicitWidth = 192
    230234          Columns = <
    231235            item
     
    280284    end
    281285  end
     286  object value_viewer_context: TPopupMenu
     287    AutoHotkeys = maManual
     288    AutoLineReduction = maManual
     289    Left = 300
     290    Top = 196
     291    object value_viewer_context_copy: TMenuItem
     292      Caption = 'Copy to &clipboard'
     293    end
     294    object value_viewer_context_copyasdec: TMenuItem
     295      Caption = 'Copy to clipboard (as &dec)'
     296    end
     297    object value_viewer_context_copyasfloat: TMenuItem
     298      Caption = 'Copy to clipboard (as &float)'
     299    end
     300    object value_viewer_context_copyasbitset: TMenuItem
     301      Caption = 'Copy to clipboard (as &bitset)'
     302    end
     303    object value_viewer_context_copyasstring: TMenuItem
     304      Caption = 'Copy to clipboard (as &string)'
     305    end
     306    object value_viewer_context_copyashex: TMenuItem
     307      Caption = 'Copy to clipboard (as &hex)'
     308    end
     309  end
     310  object VTHPopup: TVTHeaderPopupMenu
     311    Left = 292
     312    Top = 340
     313  end
    282314end
  • oup/current/Tools/MetaEditor.pas

    r232 r233  
    66  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
    77  Dialogs, _BaseTemplate, ExtCtrls, VirtualTrees, StdCtrls, ComCtrls, Grids,
    8   MPHexEditor, Wrapgrid;
     8  MPHexEditor, Wrapgrid, VTHeaderPopup, Menus, _TreeElement;
    99
    1010type
     
    2121    splitter_hex_2: TSplitter;
    2222    structviewer: TVirtualStringTree;
     23    value_viewer_context: TPopupMenu;
     24    value_viewer_context_copy: TMenuItem;
     25    value_viewer_context_copyasdec: TMenuItem;
     26    value_viewer_context_copyasfloat: TMenuItem;
     27    value_viewer_context_copyasbitset: TMenuItem;
     28    value_viewer_context_copyasstring: TMenuItem;
     29    value_viewer_context_copyashex: TMenuItem;
     30    VTHPopup: TVTHeaderPopupMenu;
     31    btn_export: TButton;
     32    btn_import: TButton;
    2333    procedure FormCreate(Sender: TObject);
    2434    procedure VSTInitChildren(Sender: TBaseVirtualTree; Node: PVirtualNode;
     
    3646      TextType: TVSTTextType);
    3747  private
     48    root: TTreeElement;
    3849    procedure NewCon(ID: Integer);
    3950  public
     
    4960
    5061  TNodeData = record
    51     Field: TObject;
     62    Field: TTreeElement;
    5263  end;
    5364
     
    7081  node: PVirtualNode;
    7182  Meta: TMetaManager;
    72   root: TExtensions;
     83  root: TTreeElement;
    7384begin
    7485  if ID >= 0 then
     
    7889    VST.BeginUpdate;
    7990    root := ConManager.Connection[FConnectionID].MetaData.Root;
    80     for i := 0 to High(root) do
    81     begin
    82       data.Field := root[i];
     91    for i := 0 to root.ChildCount - 1 do
     92    begin
     93      data.Field := root.Child[i];
    8394      node := AddVSTEntry(VST, nil, data);
    8495      VST.HasChildren[node] := True;
     
    96107  newnode: PVirtualNode;
    97108  i: Integer;
    98   id: Integer;
    99109  Meta: TMetaManager;
    100110begin
    101111  data := Sender.GetNodeData(node);
    102112  Meta := ConManager.Connection[ConnectionID].MetaData;
    103   if data.Field is TFile then
    104   begin
    105     if TFile(data.Field).ChildCount > 0 then
    106     begin
    107       for i := 0 to TFile(data.Field).ChildCount - 1 do
    108       begin
    109         id := TFile(data.Field).LinkByIndex[i].DestID;
    110         Meta.InitFile(id);
    111         newdata.Field := Meta.FileById[id];
    112         newnode := AddVSTEntry(TCustomVirtualStringTree(Sender), Node, newdata);
    113         if Meta.FileById[id].ChildCount > 0 then
    114           Sender.HasChildren[newnode] := True;
    115       end;
    116     end;
    117     if TFile(data.Field).RawCount > 0 then
    118     begin
    119       for i := 0 to TFile(data.Field).RawCount - 1 do
    120       begin
    121 //        Exit;
    122       end;
    123     end;
    124   end;
    125113  if data.Field is TExtension then
    126   begin
    127     if TExtension(data.Field).FileCount = 0 then
     114    if TExtension(data.Field).ChildCount = 0 then
    128115      TExtension(data.Field).InitList;
    129     for i := 0 to TExtension(data.Field).FileCount - 1 do
    130     begin
    131       id := TExtension(data.Field).Files[i];
    132       Meta.InitFile(id);
    133       newdata.Field := Meta.FileById[id];
     116
     117  if data.Field.ChildCount > 0 then
     118  begin
     119    for i := 0 to data.Field.ChildCount - 1 do
     120    begin
     121      newdata.Field := data.Field.Child[i];
    134122      newnode := AddVSTEntry(TCustomVirtualStringTree(Sender), Node, newdata);
    135       if Meta.FileById[id].ChildCount > 0 then
     123      if newdata.Field.ChildCount > 0 then
    136124        Sender.HasChildren[newnode] := True;
    137125    end;
     
    205193      0:
    206194        begin
    207           if Data.Field is TFile then
    208           begin
    209             CellText := TFile(Data.Field).FileInfo.Name;
    210             if CellText = '' then
    211               CellText := 'Unnamed';
    212           end;
    213           if Data.Field is TExtension then
    214             CellText := TExtension(Data.Field).Ext;
     195          CellText := Data.Field.GetCaption;
    215196        end;
    216197      1:
  • oup/current/Tools/_TemplateFileList.dfm

    r231 r233  
    269269          Caption = 'Tree'
    270270          ImageIndex = 1
     271          ExplicitLeft = 0
     272          ExplicitTop = 0
     273          ExplicitWidth = 0
     274          ExplicitHeight = 0
    271275          object filelist_meta: TVirtualStringTree
    272276            Left = 0
  • oup/current/Tools/_TemplateFileList.pas

    r231 r233  
    173173    filelist_meta.Clear;
    174174    filelist_meta.BeginUpdate;
    175     root := ConManager.Connection[FConnectionID].MetaData.Root;
     175{    root := ConManager.Connection[FConnectionID].MetaData.Root;
    176176    for i := 0 to High(root) do
    177177    begin
     
    181181    end;
    182182    filelist_meta.EndUpdate;
    183   end;
     183}  end;
    184184end;
    185185
     
    453453begin
    454454  inherited;
    455   data := Sender.GetNodeData(Node);
     455{  data := Sender.GetNodeData(Node);
    456456  if data.Field is TExtension then
    457457  begin
     
    465465      CellText := TFile(data.Field).FileInfo.Extension + ': ' + TFile(data.Field).FileInfo.Name;
    466466  end;
    467 end;
     467}end;
    468468
    469469
     
    481481  Self.Cursor := crHourGlass;
    482482  Application.ProcessMessages;
    483   if data.Field is TExtension then
     483{  if data.Field is TExtension then
    484484  begin
    485485    if TExtension(data.Field).FileCount = 0 then
     
    509509    ChildCount := filelist_meta.ChildCount[node];
    510510  end;
    511   Self.Cursor := crDefault;
     511}  Self.Cursor := crDefault;
    512512end;
    513513
Note: See TracChangeset for help on using the changeset viewer.