Index: /oup/current/FileClasses/TXAN.pas
===================================================================
--- /oup/current/FileClasses/TXAN.pas	(revision 213)
+++ /oup/current/FileClasses/TXAN.pas	(revision 214)
@@ -10,6 +10,7 @@
     protected
       procedure InitDatLinks; override;
+      procedure InitRawList; override;
+    public
       procedure InitDataFields; override;
-      procedure InitRawList; override;
   end;
 
@@ -22,10 +23,7 @@
 var
   tempi: Integer;
-  temps: String;
-  templist: TStringList;
 begin
   inherited;
   FDataFields := TBlock.Create(Self, nil, 0, 'Base', '', nil);
-  templist := TStringList.Create;
   with FDataFields do
   begin
@@ -49,4 +47,5 @@
     AddField(TUnused, $1A, 'Unused', '', @tempi);
 
+    tempi := 2;
     with AddField(TArray, $1C, 'AnimTextures array', '', @tempi) do
     begin
@@ -54,5 +53,4 @@
     end;
   end;
-  templist.Free;
 end;
 
Index: /oup/current/FileClasses/TXMP.pas
===================================================================
--- /oup/current/FileClasses/TXMP.pas	(revision 213)
+++ /oup/current/FileClasses/TXMP.pas	(revision 214)
@@ -10,6 +10,7 @@
     protected
       procedure InitDatLinks; override;
+      procedure InitRawList; override;
+    public
       procedure InitDataFields; override;
-      procedure InitRawList; override;
   end;
 
Index: /oup/current/FileClasses/_EmptyFile.pas
===================================================================
--- /oup/current/FileClasses/_EmptyFile.pas	(revision 213)
+++ /oup/current/FileClasses/_EmptyFile.pas	(revision 214)
@@ -10,6 +10,7 @@
     protected
       procedure InitDatLinks; override;
+      procedure InitRawList; override;
+    public
       procedure InitDataFields; override;
-      procedure InitRawList; override;
   end;
 
@@ -21,4 +22,5 @@
 procedure TFile_Empty.InitDataFields;
 begin
+  inherited;
   FDataFields := TBlock.Create(Self, nil, 0, 'Base', '', nil);
 end;
Index: /oup/current/FileClasses/_FileTypes.pas
===================================================================
--- /oup/current/FileClasses/_FileTypes.pas	(revision 213)
+++ /oup/current/FileClasses/_FileTypes.pas	(revision 214)
@@ -4,5 +4,5 @@
 
 uses
-  TypeDefs, _DataTypes, Classes;
+  TypeDefs, _DataTypes, Classes, Forms;
 
 
@@ -23,4 +23,7 @@
       FDataFields: TBlock;
       FRawParts: TRawDataList;
+
+      FEditor: TFrame;
+      FOpened: Boolean;
 
       procedure InitDatLinks; virtual; abstract;
@@ -39,4 +42,5 @@
 
       procedure InitDataFields; virtual;
+      procedure InitEditor; virtual;
 
       property FileStream: TMemoryStream read FFileStream;
@@ -50,4 +54,7 @@
       property Changed: Boolean read FChanged write FChanged;
 
+      property Editor: TFrame read FEditor;
+      property Opened: Boolean read FOpened write FOpened;
+
       property ChildCount: Integer read GetChildCount;
       property LinkByOffset[Offset: Integer]: TDatLink read GetDatLinkByOffset;
@@ -78,5 +85,4 @@
 constructor TFile.Create(ConnectionID, FileID: Integer);
 var
-  i: Integer;
   fileinfo: TFileInfo;
 begin
@@ -100,4 +106,5 @@
   InitRawList();
   FDataFields := nil;
+  FEditor := nil;
 
   if not (Self is TFile_Empty) then
@@ -164,6 +171,4 @@
 
 function TFile.GetFieldByOffset(Offset: Integer): TDataField;
-var
-  i: Integer;
 begin
   Result := FDataFields.FieldByOffset[Offset];
@@ -229,4 +234,9 @@
 end;
 
+procedure TFile.InitEditor;
+begin
+  Exit;
+end;
+
 function GetDatLinkValue(stream: TStream; offset: Integer): Integer;
 begin
Index: /oup/current/FileClasses/_MetaManager.pas
===================================================================
--- /oup/current/FileClasses/_MetaManager.pas	(revision 213)
+++ /oup/current/FileClasses/_MetaManager.pas	(revision 214)
@@ -2,5 +2,5 @@
 interface
 
-uses _FileTypes, TXAN, TXMP, _EmptyFile;
+uses _FileTypes, SUBT, TXAN, TXMP, _EmptyFile;
 
 type
@@ -12,5 +12,6 @@
 
 const
-  FileDescs: array[0..1] of TFileDesc = (
+  FileDescs: array[0..2] of TFileDesc = (
+    (ext: 'SUBT'; ftype: TFile_SUBT),
     (ext: 'TXAN'; ftype: TFile_TXAN),
     (ext: 'TXMP'; ftype: TFile_TXMP)
@@ -34,4 +35,7 @@
       property FileById[Id: Integer]: TFile read GetFileById;
   end;
+
+var
+  Meta: TMetaManager;
 
 implementation
Index: /oup/current/OniUnPacker.bdsproj
===================================================================
--- /oup/current/OniUnPacker.bdsproj	(revision 213)
+++ /oup/current/OniUnPacker.bdsproj	(revision 214)
@@ -177,4 +177,5 @@
 			<Language Name="RootDir"></Language>
 		</Language>  
+    
     <Excluded_Packages>
       <Excluded_Packages Name="d:\programme\borland\bds\3.0\Bin\dbwebxprt.bpl">Borland Web Wizard Package</Excluded_Packages>
Index: /oup/current/OniUnPacker.dpr
===================================================================
--- /oup/current/OniUnPacker.dpr	(revision 213)
+++ /oup/current/OniUnPacker.dpr	(revision 214)
@@ -36,5 +36,6 @@
   _MetaManager in 'FileClasses\_MetaManager.pas',
   _EmptyFile in 'FileClasses\_EmptyFile.pas',
-  TXAN in 'FileClasses\TXAN.pas';
+  TXAN in 'FileClasses\TXAN.pas',
+  SUBT in 'FileClasses\SUBT.pas';
 
 {$R *.res}
Index: /oup/current/Tools/MetaEditor.dfm
===================================================================
--- /oup/current/Tools/MetaEditor.dfm	(revision 213)
+++ /oup/current/Tools/MetaEditor.dfm	(revision 214)
@@ -3,7 +3,9 @@
   Top = 0
   Caption = 'Form_Meta'
-  ClientHeight = 365
-  ClientWidth = 446
+  ClientHeight = 393
+  ClientWidth = 472
   Color = clBtnFace
+  Constraints.MinHeight = 100
+  Constraints.MinWidth = 200
   Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
@@ -17,22 +19,24 @@
   OnClose = FormClose
   OnCreate = FormCreate
-  DesignSize = (
-    446
-    365)
   PixelsPerInch = 96
   TextHeight = 13
-  object Label3: TLabel
-    Left = 3
-    Top = 6
-    Width = 61
-    Height = 13
-    Caption = 'Connection: '
+  object Splitter1: TSplitter
+    Left = 384
+    Top = 29
+    Width = 8
+    Height = 364
+    Align = alRight
+    AutoSnap = False
+    Beveled = True
+    MinSize = 75
+    ExplicitLeft = 301
+    ExplicitHeight = 336
   end
   object VST: TVirtualStringTree
-    Left = 4
-    Top = 44
-    Width = 409
-    Height = 321
-    Anchors = [akLeft, akTop, akRight, akBottom]
+    Left = 0
+    Top = 29
+    Width = 384
+    Height = 364
+    Align = alClient
     AnimationDuration = 0
     Header.AutoSizeIndex = 0
@@ -46,7 +50,13 @@
     TreeOptions.AutoOptions = [toAutoDropExpand, toAutoScrollOnExpand, toAutoDeleteMovedNodes]
     TreeOptions.MiscOptions = [toFullRepaintOnResize, toInitOnSave, toToggleOnDblClick, toWheelPanning]
+    OnFocusChanged = VSTFocusChanged
+    OnFocusChanging = VSTFocusChanging
     OnGetText = VSTGetText
     OnPaintText = VSTPaintText
     OnInitChildren = VSTInitChildren
+    ExplicitLeft = 4
+    ExplicitTop = 44
+    ExplicitWidth = 301
+    ExplicitHeight = 321
     Columns = <
       item
@@ -68,25 +78,59 @@
       end>
   end
-  object Button1: TButton
-    Left = 204
-    Top = 1
-    Width = 75
-    Height = 25
-    Anchors = [akTop, akRight]
-    Caption = 'Load'
-    Default = True
+  object Panel1: TPanel
+    Left = 0
+    Top = 0
+    Width = 472
+    Height = 29
+    Align = alTop
+    BevelOuter = bvNone
     TabOrder = 1
-    OnClick = Button1Click
+    ExplicitWidth = 446
+    DesignSize = (
+      472
+      29)
+    object Label3: TLabel
+      Left = 3
+      Top = 6
+      Width = 61
+      Height = 13
+      Caption = 'Connection: '
+    end
+    object Button1: TButton
+      Left = 379
+      Top = 1
+      Width = 75
+      Height = 25
+      Anchors = [akTop, akRight]
+      Caption = 'Load'
+      Default = True
+      TabOrder = 0
+      OnClick = Button1Click
+      ExplicitLeft = 196
+    end
+    object combo_connection: TComboBox
+      Left = 64
+      Top = 3
+      Width = 309
+      Height = 21
+      Style = csDropDownList
+      Anchors = [akLeft, akTop, akRight]
+      DropDownCount = 12
+      ItemHeight = 13
+      TabOrder = 1
+      ExplicitWidth = 126
+    end
   end
-  object combo_connection: TComboBox
-    Left = 64
-    Top = 3
-    Width = 134
-    Height = 21
-    Style = csDropDownList
-    Anchors = [akLeft, akTop, akRight]
-    DropDownCount = 12
-    ItemHeight = 13
+  object Panel2: TPanel
+    Left = 392
+    Top = 29
+    Width = 80
+    Height = 364
+    Align = alRight
+    BevelOuter = bvNone
+    Caption = 'Panel2'
     TabOrder = 2
+    ExplicitLeft = 329
+    ExplicitHeight = 336
   end
 end
Index: /oup/current/Tools/MetaEditor.pas
===================================================================
--- /oup/current/Tools/MetaEditor.pas	(revision 213)
+++ /oup/current/Tools/MetaEditor.pas	(revision 214)
@@ -3,12 +3,15 @@
 uses
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
-  Dialogs, VirtualTrees, _MetaManager, StdCtrls;
+  Dialogs, VirtualTrees, _MetaManager, StdCtrls, ExtCtrls;
 
 type
   TForm_Meta = class(TForm)
     VST: TVirtualStringTree;
+    Panel1: TPanel;
     Button1: TButton;
+    combo_connection: TComboBox;
     Label3: TLabel;
-    combo_connection: TComboBox;
+    Splitter1: TSplitter;
+    Panel2: TPanel;
     procedure FormClose(Sender: TObject; var Action: TCloseAction);
     procedure FormCreate(Sender: TObject);
@@ -21,7 +24,11 @@
       const TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;
       TextType: TVSTTextType);
+    procedure VSTFocusChanged(Sender: TBaseVirtualTree; Node: PVirtualNode;
+      Column: TColumnIndex);
+    procedure VSTFocusChanging(Sender: TBaseVirtualTree; OldNode,
+      NewNode: PVirtualNode; OldColumn, NewColumn: TColumnIndex;
+      var Allowed: Boolean);
   private
   public
-    MetaManager: TMetaManager;
   end;
 
@@ -64,14 +71,14 @@
 begin
   data := VST.GetNodeData(node);
-  for i := 0 to MetaManager.FileById[TFile(data.Field).FileID].ChildCount - 1 do
-  begin
-    id := MetaManager.FileById[TFile(data.Field).FileID].LinkByIndex[i].DestID;
-    MetaManager.InitFile(id);
-    newdata.Field := MetaManager.FileById[id];
+  for i := 0 to Meta.FileById[TFile(data.Field).FileID].ChildCount - 1 do
+  begin
+    id := Meta.FileById[TFile(data.Field).FileID].LinkByIndex[i].DestID;
+    Meta.InitFile(id);
+    newdata.Field := Meta.FileById[id];
     newnode := AddVSTEntry(VST, Node, newdata);
-    if MetaManager.FileById[id].ChildCount > 0 then
+    if Meta.FileById[id].ChildCount > 0 then
       VST.HasChildren[newnode] := True;
   end;
-  ChildCount := MetaManager.FileById[TFile(data.Field).FileID].ChildCount;
+  ChildCount := Meta.FileById[TFile(data.Field).FileID].ChildCount;
 end;
 
@@ -94,5 +101,6 @@
     QueryPerformanceFrequency(c);
     QueryPerformanceCounter(a);
-    MetaManager := TMetaManager.Create(conid);
+    if not Assigned(Meta) then
+      Meta := TMetaManager.Create(conid);
     QueryPerformanceCounter(b);
     ShowMessage('Loading Done - ' + FloatToStr((b-a)/c) + 's');
@@ -100,11 +108,11 @@
     VST.Clear;
     VST.BeginUpdate;
-    for i := 0 to MetaManager.FileCount - 1 do
-    begin
-      if Assigned(MetaManager.FileById[i]) then
+    for i := 0 to Meta.FileCount - 1 do
+    begin
+      if Assigned(Meta.FileById[i]) then
       begin
-        data.Field := MetaManager.FileById[i];
+        data.Field := Meta.FileById[i];
         node := AddVSTEntry(VST, nil, data);
-        if MetaManager.FileById[i].ChildCount > 0 then
+        if Meta.FileById[i].ChildCount > 0 then
           VST.HasChildren[node] := True;
       end;
@@ -116,5 +124,5 @@
 procedure TForm_Meta.FormClose(Sender: TObject; var Action: TCloseAction);
 begin
-  MetaManager.Free;
+  Meta.Free;
   Action := caFree;
 end;
@@ -158,4 +166,53 @@
 
 
+
+procedure TForm_Meta.VSTFocusChanged(Sender: TBaseVirtualTree;
+  Node: PVirtualNode; Column: TColumnIndex);
+var
+  data: PNodeData;
+begin
+  data := Sender.GetNodeData(Node);
+  if data.Field is TFile then
+  begin
+    TFile(data.Field).InitEditor;
+    if Assigned(TFile(data.Field).Editor) then
+    begin
+      panel2.InsertControl(TFile(data.Field).Editor);
+      TFile(data.Field).Opened := True;
+    end;
+  end;
+end;
+
+procedure TForm_Meta.VSTFocusChanging(Sender: TBaseVirtualTree; OldNode,
+  NewNode: PVirtualNode; OldColumn, NewColumn: TColumnIndex;
+  var Allowed: Boolean);
+var
+  data: PNodeData;
+  i: Integer;
+begin
+  data := Sender.GetNodeData(NewNode);
+  if data.Field is TFile then
+  begin
+    TFile(data.Field).InitEditor;
+    if Assigned(TFile(data.Field).Editor) then
+      Allowed := not TFile(data.Field).Opened
+    else
+      Allowed := True;
+  end;
+  if Allowed and Assigned(OldNode) then
+  begin
+    data := Sender.GetNodeData(OldNode);
+    if data.Field is TFile then
+    begin
+      if TFile(data.Field).Opened then
+      begin
+        if panel2.ControlCount > 0 then
+          for i := 0 to panel2.ControlCount - 1 do
+            panel2.RemoveControl(panel2.Controls[i]);
+        TFile(data.Field).Opened := False;
+      end;
+    end;
+  end;
+end;
 
 procedure TForm_Meta.VSTGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
Index: /oup/current/Tools/TxmpReplace.pas
===================================================================
--- /oup/current/Tools/TxmpReplace.pas	(revision 213)
+++ /oup/current/Tools/TxmpReplace.pas	(revision 214)
@@ -225,6 +225,4 @@
 
 procedure TForm_TxmpReplace.FormCreate(Sender: TObject);
-var
-  TXMP: TFile_TXMP;
 begin
   inherited;
