ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/oup/current/Tools/MetaEditor.pas
(Generate patch)

Comparing oup/current/Tools/MetaEditor.pas (file contents):
Revision 244 by alloc, Fri Aug 17 21:09:51 2007 UTC vs.
Revision 321 by alloc, Wed May 6 13:47:23 2009 UTC

# Line 148 | Line 148 | procedure TForm_Meta.VSTFocusChanged(Sen
148    Node: PVirtualNode; Column: TColumnIndex);
149   var
150    data: PNodeData;
151 <  ffile: TFile;
152 < //*******************************************************************
153 <  fs: TFileStream;
154 < //*******************************************************************
151 >  ffile: TResource;
152   begin
153    data := Sender.GetNodeData(Node);
154    ffile := nil;
155 <  if data.Field is TFile then
156 <    ffile := TFile(data.Field);
155 >  if data.Field is TResource then
156 >    ffile := TResource(data.Field);
157    if data.Field is _MetaTypes.TDatLink then
158      if Assigned(_MetaTypes.TDatLink(data.Field).TargetFile) then
159 <      ffile := TFile(_MetaTypes.TDatLink(data.Field).TargetFile);
159 >      ffile := TResource(_MetaTypes.TDatLink(data.Field).TargetFile);
160    if Assigned(ffile) then
161    begin
162      if Assigned(ffile.Editor) then
# Line 168 | Line 165 | begin
165        tab_meta.InsertControl(ffile.Editor);
166        ffile.Opened := True;
167      end;
171 //*******************************************************************
172 //    fs := TFileStream.Create('C:\Spiele\Oni\GameDataFolder\tests\'+IntToStr(ffile.FileInfo.ID)+'_recreated.hex', fmCreate);
173 //    ffile.ReCreateFile(fs);
174 //    fs.Free;
175 //*******************************************************************
168    end;
169   end;
170  
# Line 185 | Line 177 | var
177    i: Integer;
178   begin
179    data := Sender.GetNodeData(NewNode);
180 <  if data.Field is TFile then
180 >  if data.Field is TResource then
181    begin
182 <    if Assigned(TFile(data.Field).Editor) then
183 <      Allowed := not TFile(data.Field).Opened
182 >    if Assigned(TResource(data.Field).Editor) then
183 >      Allowed := not TResource(data.Field).Opened
184      else
185        Allowed := True;
186    end;
187    if Allowed and Assigned(OldNode) then
188    begin
189      data := Sender.GetNodeData(OldNode);
190 <    if data.Field is TFile then
190 >    if data.Field is TResource then
191      begin
192 <      if TFile(data.Field).Opened then
192 >      if TResource(data.Field).Opened then
193        begin
194          if tab_meta.ControlCount > 0 then
195            for i := 0 to tab_meta.ControlCount - 1 do
196              tab_meta.RemoveControl(tab_meta.Controls[i]);
197 <        TFile(data.Field).Opened := False;
197 >        TResource(data.Field).Opened := False;
198        end;
199      end;
200    end;
# Line 243 | Line 235 | begin
235      case Column of
236        0:
237          begin
238 <          if Data.Field is TFile then
238 >          if Data.Field is TResource then
239            begin
240 <            if Length(TFile(Data.Field).FileInfo.Name) = 0 then
240 >            if Length(TResource(Data.Field).FileInfo.Name) = 0 then
241                TargetCanvas.Font.Color := $C06060;
242 <            if TFile(Data.Field).FileInfo.Size = 0 then
242 >            if TResource(Data.Field).FileInfo.Size = 0 then
243                TargetCanvas.Font.Color := $2020A0;
244            end;
245          end;
# Line 264 | Line 256 | var
256    data: PNodeData;
257    CellText: WideString;
258  
259 <  i: Integer;
268 <  links: TStrings;
269 <  ifile: TFile;
259 >  ifile: TResource;
260   begin
261    inherited;
262    if Assigned(Node) then
# Line 282 | Line 272 | begin
272            2: HintText := '';
273          end;
274        end;
275 <      if data.Field is TFile then
275 >      if data.Field is TResource then
276        begin
277 <        ifile := TFile(data.Field);
277 >        ifile := TResource(data.Field);
278          case Column of
279            0: HintText :=
280              'FileID:    ' + IntToStr(ifile.FileInfo.ID) + #13#10 +

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)