Ignore:
Timestamp:
Jul 18, 2007, 12:27:16 AM (17 years ago)
Author:
alloc
Message:
 
Location:
oup/current/FileClasses
Files:
9 edited

Legend:

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

    r237 r241  
    4141        AddField(TInt, 'X-tiles', 'size of pathfinding grid', [4]);
    4242        AddField(TInt, 'Z-tiles', 'size of pathfinding grid', [4]);
    43         AddField(TRawLink, 'RAW offset', 'offset of grid data', []);
     43        AddField(TRawLink, 'RAW offset', 'offset of grid data', ['AKVA']);
    4444        AddField(TInt, 'RAW size', 'size of grid data', [4]);
    4545        AddField(TFloat, 'Tile size', 'usually 4 world units', []);
  • oup/current/FileClasses/SUBT.pas

    r240 r241  
    3535    AddField(TUnused, 'Unused data', '', [16]);
    3636
    37     AddField(TRawLink, 'Raw Address', '', []);
     37    AddField(TRawLink, 'Raw Address', '', ['SUBT']);
    3838
    3939    with TArray(AddField(TArray, 'SUBT offsets array', '', [4])) do
  • oup/current/FileClasses/TXAN.pas

    r237 r241  
    3636    with TArray(AddField(TArray, 'AnimTextures array', '', [4])) do
    3737    begin
    38       AddField(TLinkByID, 'Texture', '', ['*']);
     38      AddField(TLinkByID, 'Texture', '', ['TXMP']);
    3939      SetCount;
    4040    end;
  • oup/current/FileClasses/TXMP.pas

    r236 r241  
    5353    AddField(TInt, 'Height', '', [2]);
    5454    AddField(TInt, 'StoreType', '', [4]);
    55     AddField(TLinkByID, 'TXAN', '', ['*']);
     55    AddField(TLinkByID, 'TXAN', '', ['TXAN']);
    5656    AddField(TLinkByID, 'TXMP', '', ['TXMP']);
    57     AddField(TRawLink, 'RawLink', '', []);
    58     AddField(TRawLink, 'SepLink', '', []);
     57    AddField(TRawLink, 'RawLink', '', ['TXMP']);
     58    AddField(TRawLink, 'SepLink', '', ['TXMP']);
    5959    AddField(TUnused, 'Unused', '', [$1C]);
    6060  end;
  • oup/current/FileClasses/_DataTypes.pas

    r240 r241  
    1010 
    1111  TDataField = class(TTreeElement)
    12       function GetChildCount: Integer; override;
    13       function GetChild(ID: Integer): TTreeElement; override;
    14       function GetCaption: String; override;
    1512    protected
    1613      FOffset: Integer;
    1714      FName:   String;
     15      FType:   String;
    1816      FDescription: String;
    1917      FDataLength: Integer;
     
    2220      FChanged: Boolean;
    2321      FExtraArgs: array of TVarRec;
     22      function GetChildCount: Integer; override;
     23      function GetChild(ID: Integer): TTreeElement; override;
     24      function GetCaption: String; override;
     25      function GetType: String; override;
    2426      function GetValueAsString: String; virtual;
    2527    public
     
    4749
    4850  TBlock = class(TContainer)
    49     private
     51    protected
    5052      FDataFields: array of TDataField;
    5153      function GetChildCount: Integer; override;
     
    6769
    6870  TInt = class(TDataField)
    69     private
     71    protected
    7072      FInt: Integer;
    7173      function GetValueAsString: String; override;
     
    8082
    8183  TFloat = class(TDataField)
    82     private
     84    protected
    8385      FFloat: Single;
    8486      function GetValueAsString: String; override;
     
    9395
    9496  TBitSet = class(TDataField)
    95     private
     97    protected
    9698      FBits: Byte;
    9799      FNames: TStringList;
     
    107109
    108110  TLevelID = class(TDataField)
    109     private
     111    protected
    110112      FLevelID: Integer;
    111113      function GetValueAsString: String; override;
     
    120122
    121123  TFileID = class(TDataField)
    122     private
     124    protected
    123125      FFileID: Integer;
    124126      function GetValueAsString: String; override;
     
    133135
    134136  TDatLink = class(TDataField)
    135     private
     137    protected
     138      FPosExts: String;
    136139      function GetTarget: TObject; virtual; abstract;
    137140    public
     141      property PosExts: String read FPosExts;
    138142      property TargetFile: TObject read GetTarget;
    139143  end;
     
    141145
    142146  TLinkByID = class(TDatLink)
     147    protected
     148      FFileID: Integer;
    143149      function GetChildCount: Integer; override;
    144150      function GetChild(ID: Integer): TTreeElement; override;
    145     private
    146       FFileID: Integer;
    147       FPosExts: String;
    148151      function GetValueAsString: String; override;
    149152      function GetTarget: TObject; override;
     
    158161
    159162  TString = class(TDataField)
    160     private
     163    protected
    161164      FString: String;
    162165      function GetValueAsString: String; override;
     
    171174
    172175  TArray = class(TContainer)
    173     private
     176    protected
    174177      FDataFields: array of TBlock;
    175178      FTemplate: TBlock;
     
    197200
    198201  TRawLink = class(TDataField)
    199     private
     202    protected
    200203      FRawAddress: Integer;
     204      FRawType:    String;
     205      FSep:        Boolean;
    201206      function GetValueAsString: String; override;
    202207    public
    203       // ExtraArgs: keine
    204       constructor Create(ParentFile: TObject; ParentBlock: TContainer;
    205           Name, Description: String; ExtraArgs: array of const); override;
    206       procedure Update(Offset, Length: Integer); override;
    207       procedure WriteData(stream: TStream); override;
     208      // ExtraArgs: String: RawType; Bool: Sep
     209      constructor Create(ParentFile: TObject; ParentBlock: TContainer;
     210          Name, Description: String; ExtraArgs: array of const); override;
     211      procedure Update(Offset, Length: Integer); override;
     212      procedure WriteData(stream: TStream); override;
     213
     214      property RawType: String read FRawType;
    208215  end;
    209216
    210217
    211218  TUnused = class(TDataField)
    212     private
     219    protected
    213220      function GetValueAsString: String; override;
    214221    public
     
    268275end;
    269276
     277function TDataField.GetType: String;
     278begin
     279  Result := FType;
     280end;
     281
    270282function TDataField.GetValueAsString: String;
    271283begin
     
    280292  inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs);
    281293  FDataLength := ExtraArgs[0].VInteger;
     294  FType := 'String[' + IntToStr(FDataLength) + ']';
    282295end;
    283296
     
    325338  inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs);
    326339  FDataLength := ExtraArgs[0].VInteger;
     340  FType := 'Int' + IntToStr(FDataLength * 8);
    327341  FInt := 0;
    328342end;
     
    364378  inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs);
    365379  FCounterSize := ExtraArgs[0].VInteger;
     380  FType := '';
    366381  if Length(ExtraArgs) = 2 then
    367382    FBlockCount := ExtraArgs[1].VInteger
     
    521536begin
    522537  inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs);
     538  FType := '';
    523539end;
    524540
     
    593609  inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs);
    594610  FDataLength := 4;
     611  FType := 'LevelID';
    595612  FLevelID := 0;
    596613end;
     
    628645  inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs);
    629646  FDataLength := 4;
     647  FType := 'FileID';
    630648  FFileID := -1;
    631649end;
     
    673691    vtAnsiString: FPosExts := String(ExtraArgs[0].VAnsiString);
    674692  end;
     693  FType := 'LinkByID(' + FPosExts + ')';
    675694  FFileID := -1;
    676695end;
     
    740759begin
    741760  inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs);
     761  case ExtraArgs[0].VType of
     762    vtChar: FRawType := ExtraArgs[0].VChar;
     763    vtAnsiString: FRawType := String(ExtraArgs[0].VAnsiString);
     764  end;
     765  if Length(ExtraArgs) > 1 then
     766    FSep := ExtraArgs[1].VBoolean;
     767  FType := 'RawLink(' + FRawType + ')';
    742768  FDataLength := 4;
    743769end;
     
    774800  inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs);
    775801  FDataLength := ExtraArgs[0].VInteger;
     802  FType := 'Unused';
    776803end;
    777804
     
    813840    end;
    814841  FDataLength := 1;
     842  FType := 'BitSet';
    815843  FBits := 0;
    816844end;
     
    854882  inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs);
    855883  FDataLength := 4;
     884  FType := 'Float';
    856885  FFloat := 0;
    857886end;
  • oup/current/FileClasses/_Extensions.pas

    r237 r241  
    88type
    99  TExtension = class(TTreeElement)
     10    protected
    1011      function GetChildCount: Integer; override;
    1112      function GetChild(ID: Integer): TTreeElement; override;
    1213      function GetCaption: String; override;
     14      function GetType: String; override;
    1315    private
    1416      FExt: String;
     
    6466begin
    6567  Result := Length(FFiles);
     68end;
     69
     70function TExtension.GetType: String;
     71begin
     72  Result := '';
    6673end;
    6774
  • oup/current/FileClasses/_FileTypes.pas

    r240 r241  
    99type
    1010  TFile = class(TTreeElement)
    11       function GetChildCount: Integer; override;
    12       function GetChild(ID: Integer): TTreeElement; override;
    13       function GetCaption: String; override;
    1411    protected
    1512      FFileInfo: TFileInfo;
     
    2522      FOpened: Boolean;
    2623
     24      function GetChildCount: Integer; override;
     25      function GetChild(ID: Integer): TTreeElement; override;
     26      function GetCaption: String; override;
     27      function GetType: String; override;
    2728      function GetEditor: TFrame;
    2829      function GetFieldByOffset(Offset: Integer): TDataField;
     
    6162
    6263uses
    63   DatLinks, RawList, ConnectionManager, Dialogs, _MetaTypes, _MetaManager;
     64  DatLinks, RawList, ConnectionManager, Dialogs, _MetaTypes, _MetaManager,
     65  SysUtils;
    6466
    6567{ TFileType }
     
    134136
    135137
     138function TFile.GetType: String;
     139begin
     140  Result := FFileInfo.Extension;
     141end;
     142
    136143function TFile.GetCaption: String;
    137144begin
     
    139146  if Result = '' then
    140147    Result := 'Unnamed';
     148  Result := Result + ' (' + IntToStr(FFileInfo.ID) + ')';
    141149end;
    142150
  • oup/current/FileClasses/_MetaTypes.pas

    r240 r241  
    44
    55uses
    6   _FileTypes, _EmptyFile, _Unlinked, _DataTypes, _Extensions, _TreeElement,
     6  _FileTypes, _EmptyFile, _DataTypes, _Extensions, _TreeElement,
    77  AKVA, SUBT, TXAN, TXMP;
    88//  ABNA, AGDB, AGQC, AGQG, AGQM, AGQR, AISA, AITR, AIWA, AKAA, AKBA, AKBP, AKDA,
     
    2020  TFile = _FileTypes.TFile;
    2121  TFile_Empty = _EmptyFile.TFile_Empty;
    22   TFile_Unlinked = _Unlinked.TFile_Unlinked;
    2322  TExtension = _Extensions.TExtension;
    2423  TExtensions = _Extensions.TExtensions;
     24
    2525  TDataField = _DataTypes.TDataField;
     26  TContainer = _DataTypes.TContainer;
     27  TBlock = _DataTypes.TBlock;
     28  TArray = _DataTypes.TArray;
     29
     30  TFileID = _DataTypes.TFileID;
     31  TLevelID = _DataTypes.TLevelID;
     32  TInt = _DataTypes.TInt;
     33  TFloat = _DataTypes.TFloat;
     34  TString = _DataTypes.TString;
     35  TBitSet = _DataTypes.TBitSet;
    2636  TDatLink = _DataTypes.TDatLink;
     37  TLinkByID = _DataTypes.TLinkByID;
     38  TRawLink = _DataTypes.TRawLink;
     39  TUnused = _DataTypes.TUnused;
    2740
    2841  TFileClass = class of TFile;
  • oup/current/FileClasses/_TreeElement.pas

    r238 r241  
    55type
    66  TTreeElement = class
     7    protected
    78      FConnectionID: Integer;
    89      function GetChildCount: Integer; virtual; abstract;
    910      function GetChild(ID: Integer): TTreeElement; virtual; abstract;
    1011      function GetCaption: String; virtual; abstract;
    11     private
     12      function GetType: String; virtual; abstract;
    1213    public
    1314      property ConnectionID: Integer read FConnectionID;
     
    1516      property Child[ID: Integer]: TTreeElement read GetChild;
    1617      property Caption: String read GetCaption;
     18      property VType: String read GetType;
    1719  end;
    1820
Note: See TracChangeset for help on using the changeset viewer.