Changeset 241 for oup/current/FileClasses
- Timestamp:
- Jul 18, 2007, 12:27:16 AM (17 years ago)
- Location:
- oup/current/FileClasses
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/current/FileClasses/AKVA.pas
r237 r241 41 41 AddField(TInt, 'X-tiles', 'size of pathfinding grid', [4]); 42 42 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']); 44 44 AddField(TInt, 'RAW size', 'size of grid data', [4]); 45 45 AddField(TFloat, 'Tile size', 'usually 4 world units', []); -
oup/current/FileClasses/SUBT.pas
r240 r241 35 35 AddField(TUnused, 'Unused data', '', [16]); 36 36 37 AddField(TRawLink, 'Raw Address', '', [ ]);37 AddField(TRawLink, 'Raw Address', '', ['SUBT']); 38 38 39 39 with TArray(AddField(TArray, 'SUBT offsets array', '', [4])) do -
oup/current/FileClasses/TXAN.pas
r237 r241 36 36 with TArray(AddField(TArray, 'AnimTextures array', '', [4])) do 37 37 begin 38 AddField(TLinkByID, 'Texture', '', [' *']);38 AddField(TLinkByID, 'Texture', '', ['TXMP']); 39 39 SetCount; 40 40 end; -
oup/current/FileClasses/TXMP.pas
r236 r241 53 53 AddField(TInt, 'Height', '', [2]); 54 54 AddField(TInt, 'StoreType', '', [4]); 55 AddField(TLinkByID, 'TXAN', '', [' *']);55 AddField(TLinkByID, 'TXAN', '', ['TXAN']); 56 56 AddField(TLinkByID, 'TXMP', '', ['TXMP']); 57 AddField(TRawLink, 'RawLink', '', [ ]);58 AddField(TRawLink, 'SepLink', '', [ ]);57 AddField(TRawLink, 'RawLink', '', ['TXMP']); 58 AddField(TRawLink, 'SepLink', '', ['TXMP']); 59 59 AddField(TUnused, 'Unused', '', [$1C]); 60 60 end; -
oup/current/FileClasses/_DataTypes.pas
r240 r241 10 10 11 11 TDataField = class(TTreeElement) 12 function GetChildCount: Integer; override;13 function GetChild(ID: Integer): TTreeElement; override;14 function GetCaption: String; override;15 12 protected 16 13 FOffset: Integer; 17 14 FName: String; 15 FType: String; 18 16 FDescription: String; 19 17 FDataLength: Integer; … … 22 20 FChanged: Boolean; 23 21 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; 24 26 function GetValueAsString: String; virtual; 25 27 public … … 47 49 48 50 TBlock = class(TContainer) 49 pr ivate51 protected 50 52 FDataFields: array of TDataField; 51 53 function GetChildCount: Integer; override; … … 67 69 68 70 TInt = class(TDataField) 69 pr ivate71 protected 70 72 FInt: Integer; 71 73 function GetValueAsString: String; override; … … 80 82 81 83 TFloat = class(TDataField) 82 pr ivate84 protected 83 85 FFloat: Single; 84 86 function GetValueAsString: String; override; … … 93 95 94 96 TBitSet = class(TDataField) 95 pr ivate97 protected 96 98 FBits: Byte; 97 99 FNames: TStringList; … … 107 109 108 110 TLevelID = class(TDataField) 109 pr ivate111 protected 110 112 FLevelID: Integer; 111 113 function GetValueAsString: String; override; … … 120 122 121 123 TFileID = class(TDataField) 122 pr ivate124 protected 123 125 FFileID: Integer; 124 126 function GetValueAsString: String; override; … … 133 135 134 136 TDatLink = class(TDataField) 135 private 137 protected 138 FPosExts: String; 136 139 function GetTarget: TObject; virtual; abstract; 137 140 public 141 property PosExts: String read FPosExts; 138 142 property TargetFile: TObject read GetTarget; 139 143 end; … … 141 145 142 146 TLinkByID = class(TDatLink) 147 protected 148 FFileID: Integer; 143 149 function GetChildCount: Integer; override; 144 150 function GetChild(ID: Integer): TTreeElement; override; 145 private146 FFileID: Integer;147 FPosExts: String;148 151 function GetValueAsString: String; override; 149 152 function GetTarget: TObject; override; … … 158 161 159 162 TString = class(TDataField) 160 pr ivate163 protected 161 164 FString: String; 162 165 function GetValueAsString: String; override; … … 171 174 172 175 TArray = class(TContainer) 173 pr ivate176 protected 174 177 FDataFields: array of TBlock; 175 178 FTemplate: TBlock; … … 197 200 198 201 TRawLink = class(TDataField) 199 pr ivate202 protected 200 203 FRawAddress: Integer; 204 FRawType: String; 205 FSep: Boolean; 201 206 function GetValueAsString: String; override; 202 207 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; 208 215 end; 209 216 210 217 211 218 TUnused = class(TDataField) 212 pr ivate219 protected 213 220 function GetValueAsString: String; override; 214 221 public … … 268 275 end; 269 276 277 function TDataField.GetType: String; 278 begin 279 Result := FType; 280 end; 281 270 282 function TDataField.GetValueAsString: String; 271 283 begin … … 280 292 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 281 293 FDataLength := ExtraArgs[0].VInteger; 294 FType := 'String[' + IntToStr(FDataLength) + ']'; 282 295 end; 283 296 … … 325 338 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 326 339 FDataLength := ExtraArgs[0].VInteger; 340 FType := 'Int' + IntToStr(FDataLength * 8); 327 341 FInt := 0; 328 342 end; … … 364 378 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 365 379 FCounterSize := ExtraArgs[0].VInteger; 380 FType := ''; 366 381 if Length(ExtraArgs) = 2 then 367 382 FBlockCount := ExtraArgs[1].VInteger … … 521 536 begin 522 537 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 538 FType := ''; 523 539 end; 524 540 … … 593 609 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 594 610 FDataLength := 4; 611 FType := 'LevelID'; 595 612 FLevelID := 0; 596 613 end; … … 628 645 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 629 646 FDataLength := 4; 647 FType := 'FileID'; 630 648 FFileID := -1; 631 649 end; … … 673 691 vtAnsiString: FPosExts := String(ExtraArgs[0].VAnsiString); 674 692 end; 693 FType := 'LinkByID(' + FPosExts + ')'; 675 694 FFileID := -1; 676 695 end; … … 740 759 begin 741 760 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 + ')'; 742 768 FDataLength := 4; 743 769 end; … … 774 800 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 775 801 FDataLength := ExtraArgs[0].VInteger; 802 FType := 'Unused'; 776 803 end; 777 804 … … 813 840 end; 814 841 FDataLength := 1; 842 FType := 'BitSet'; 815 843 FBits := 0; 816 844 end; … … 854 882 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 855 883 FDataLength := 4; 884 FType := 'Float'; 856 885 FFloat := 0; 857 886 end; -
oup/current/FileClasses/_Extensions.pas
r237 r241 8 8 type 9 9 TExtension = class(TTreeElement) 10 protected 10 11 function GetChildCount: Integer; override; 11 12 function GetChild(ID: Integer): TTreeElement; override; 12 13 function GetCaption: String; override; 14 function GetType: String; override; 13 15 private 14 16 FExt: String; … … 64 66 begin 65 67 Result := Length(FFiles); 68 end; 69 70 function TExtension.GetType: String; 71 begin 72 Result := ''; 66 73 end; 67 74 -
oup/current/FileClasses/_FileTypes.pas
r240 r241 9 9 type 10 10 TFile = class(TTreeElement) 11 function GetChildCount: Integer; override;12 function GetChild(ID: Integer): TTreeElement; override;13 function GetCaption: String; override;14 11 protected 15 12 FFileInfo: TFileInfo; … … 25 22 FOpened: Boolean; 26 23 24 function GetChildCount: Integer; override; 25 function GetChild(ID: Integer): TTreeElement; override; 26 function GetCaption: String; override; 27 function GetType: String; override; 27 28 function GetEditor: TFrame; 28 29 function GetFieldByOffset(Offset: Integer): TDataField; … … 61 62 62 63 uses 63 DatLinks, RawList, ConnectionManager, Dialogs, _MetaTypes, _MetaManager; 64 DatLinks, RawList, ConnectionManager, Dialogs, _MetaTypes, _MetaManager, 65 SysUtils; 64 66 65 67 { TFileType } … … 134 136 135 137 138 function TFile.GetType: String; 139 begin 140 Result := FFileInfo.Extension; 141 end; 142 136 143 function TFile.GetCaption: String; 137 144 begin … … 139 146 if Result = '' then 140 147 Result := 'Unnamed'; 148 Result := Result + ' (' + IntToStr(FFileInfo.ID) + ')'; 141 149 end; 142 150 -
oup/current/FileClasses/_MetaTypes.pas
r240 r241 4 4 5 5 uses 6 _FileTypes, _EmptyFile, _ Unlinked, _DataTypes, _Extensions, _TreeElement,6 _FileTypes, _EmptyFile, _DataTypes, _Extensions, _TreeElement, 7 7 AKVA, SUBT, TXAN, TXMP; 8 8 // ABNA, AGDB, AGQC, AGQG, AGQM, AGQR, AISA, AITR, AIWA, AKAA, AKBA, AKBP, AKDA, … … 20 20 TFile = _FileTypes.TFile; 21 21 TFile_Empty = _EmptyFile.TFile_Empty; 22 TFile_Unlinked = _Unlinked.TFile_Unlinked;23 22 TExtension = _Extensions.TExtension; 24 23 TExtensions = _Extensions.TExtensions; 24 25 25 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; 26 36 TDatLink = _DataTypes.TDatLink; 37 TLinkByID = _DataTypes.TLinkByID; 38 TRawLink = _DataTypes.TRawLink; 39 TUnused = _DataTypes.TUnused; 27 40 28 41 TFileClass = class of TFile; -
oup/current/FileClasses/_TreeElement.pas
r238 r241 5 5 type 6 6 TTreeElement = class 7 protected 7 8 FConnectionID: Integer; 8 9 function GetChildCount: Integer; virtual; abstract; 9 10 function GetChild(ID: Integer): TTreeElement; virtual; abstract; 10 11 function GetCaption: String; virtual; abstract; 11 private12 function GetType: String; virtual; abstract; 12 13 public 13 14 property ConnectionID: Integer read FConnectionID; … … 15 16 property Child[ID: Integer]: TTreeElement read GetChild; 16 17 property Caption: String read GetCaption; 18 property VType: String read GetType; 17 19 end; 18 20
Note:
See TracChangeset
for help on using the changeset viewer.