FSO.IDE.ObjectWindow.RegenObjMeta C# (CSharp) Method

RegenObjMeta() public method

public RegenObjMeta ( GameIffResource res ) : bool
res GameIffResource
return bool
        public bool RegenObjMeta(GameIffResource res)
        {
            var objd = res.List<OBJD>();
            var entries = new List<ObjectRegistryEntry>();

            foreach (var obj in objd)
            {
                ObjectRegistryEntry entry = new ObjectRegistryEntry
                {
                    GUID = obj.GUID,
                    Filename = res.MainIff.Filename,
                    Name = obj.ChunkLabel,
                    Group = (short)obj.MasterID,
                    SubIndex = obj.SubIndex
                };
                entries.Add(entry);
            }

            if (entries.Count == 0) return false;

            entries = entries.OrderBy(x => x.SubIndex).OrderBy(x => x.Group).ToList();

            var GUID = (ActiveObj == null) ? 0 : ActiveObj.OBJ.GUID;
            //populate object selected box with options
            ObjCombo.Items.Clear();
            int i = 0;
            foreach (var item in entries)
            {
                ObjCombo.Items.Add(item);
                if (item.GUID == GUID) ObjCombo.SelectedIndex = i;
                i++;
            }
            if (ObjCombo.SelectedIndex == -1) ObjCombo.SelectedIndex = 0;

            Text = "Edit Object - " + ActiveObjTable.Filename;
            return true;
        }