Ejemplo n.º 1
0
        /// <summary>
        /// The create tree.
        /// </summary>
        /// <param name="ifps">The ifps.</param>
        /// <param name="path">The path.</param>
        /// <returns></returns>
        /// <remarks></remarks>
        private TreeNode[] CreateTree(object[] ifps, string path)
        {
            TreeNode[] tnc   = new TreeNode[ifps.Length];
            int        count = 0;

            for (int x = 0; x < ifps.Length; x++)
            {
                IFPIO.BaseObject ifpObj = (IFPIO.BaseObject)ifps[x];
                if (x < (ifps.Length - 1) && ifps[x + 1] is IFPIO.Ident && ifps[x] is IFPIO.TagType)
                {
                    continue;
                }

                string tempchunkname = ifpObj.name;
                if (tempchunkname == null)
                {
                    tempchunkname = "  <null>  ";
                }

                TreeNode ChunkNumberNode = new TreeNode(tempchunkname);
                ChunkNumberNode.ToolTipText = "[" + ifpObj.ObjectType.ToString().ToLower() + "]\n" + "Offset: " +
                                              ifpObj.offset;

                ChunkNumberNode.Name = path + ifpObj.offset;
                //if (ra.isOpen)
                //{
                //    ChunkNumberNode.Checked = false;
                //    string s = ra.getValue(ChunkNumberNode.Name);
                //    if (s != null)
                //    {
                //        bool check = bool.Parse(s);
                //        if (check)
                //        {
                //            ChunkNumberNode.Checked = true;
                //        }
                //    }
                //}

                if (ifps[x] is IFPIO.Reflexive)
                {
                    // TreeNode reflexnode = new TreeNode("Name: " + ((IFPIO.Reflexive)ifps[x]).name + " - Offset: " + ((IFPIO.Reflexive)ifps[x]).offset.ToString());
                    ChunkNumberNode.Nodes.AddRange(
                        CreateTree(((IFPIO.Reflexive)ifps[x]).items, path + ifpObj.offset + "\\"));
                }

                tnc[count++] = ChunkNumberNode;
            }

            TreeNode[] tempTN = new TreeNode[count];
            for (int i = 0; i < count; i++)
            {
                tempTN[i] = (TreeNode)tnc[i].Clone();
            }

            return(tempTN);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a tree listing of all tags & reflexives (called recursively)
        /// </summary>
        /// <param name="ifps">The ifps.</param>
        /// <param name="path">The offset to the given node (such as "100\8\24")</param>
        /// <returns></returns>
        /// <remarks></remarks>
        private TreeNode[] CreateTree(object[] ifps, string path)
        {
            System.Collections.Generic.List <TreeNode> tnc = new System.Collections.Generic.List <TreeNode>();
            //TreeNode[] tnc = new TreeNode[ifps.Length];
            int count = 0;

            for (int x = 0; x < ifps.Length; x++)
            {
                IFPIO.BaseObject ifpObj = (IFPIO.BaseObject)ifps[x];
                if (x < (ifps.Length - 1) && ifps[x + 1] is IFPIO.Ident && ifps[x] is IFPIO.TagType)
                {
                    continue;
                }

                string tempchunkname = ifpObj.name;
                if (tempchunkname == null)
                {
                    tempchunkname = "  <null>  ";
                }

                TreeNode ChunkNumberNode = new TreeNode(tempchunkname);
                ChunkNumberNode.ToolTipText = "[" + ifpObj.ObjectType.ToString().ToLower() + "]\n" + "Offset: " +
                                              ifpObj.offset;

                ChunkNumberNode.Name = path + ifpObj.offset;
                //if (ra.isOpen)
                //{
                //    ChunkNumberNode.Checked = false;
                //    string s = ra.getValue(ChunkNumberNode.Name);
                //    if (s != null)
                //    {
                //        bool check = bool.Parse(s);
                //        if (check)
                //        {
                //            ChunkNumberNode.Checked = true;
                //        }
                //    }
                //}

                if (ifps[x] is IFPIO.Reflexive)
                {
                    // TreeNode reflexnode = new TreeNode("Name: " + ((IFPIO.Reflexive)ifps[x]).name + " - Offset: " + ((IFPIO.Reflexive)ifps[x]).offset.ToString());
                    ChunkNumberNode.Nodes.AddRange(
                        CreateTree(((IFPIO.Reflexive)ifps[x]).items, path + ifpObj.offset + "\\"));
                    ChunkNumberNode.Tag = new tagInfo(((IFPIO.Reflexive)ifpObj).chunkSize);
                }

                tnc.Add(ChunkNumberNode);
            }

            return(tnc.ToArray());
        }
Ejemplo n.º 3
0
        /// <summary>
        /// The make controls.
        /// </summary>
        /// <param name="y">The y.</param>
        /// <param name="ifpobjects">The ifpobjects.</param>
        /// <param name="reflex">The reflex.</param>
        /// <remarks></remarks>
        public void MakeControls(int y, object[] ifpobjects, ref ReflexiveContainer reflex)
        {
            foreach (object o in ifpobjects)
            {
                IFPIO.BaseObject tempbase = (IFPIO.BaseObject)o;

                switch (tempbase.ObjectType)
                {
                case IFPIO.ObjectEnum.Struct:
                    IFPIO.Reflexive r = (IFPIO.Reflexive)tempbase;

                    // if (r.visible == false) { break; }
                    ReflexiveContainer tempr = new ReflexiveContainer(r);
                    MakeControls(0, r.items, ref tempr);
                    reflex.Controls.Add(tempr);

                    break;

                case IFPIO.ObjectEnum.Ident:
                    IFPIO.Ident id = (IFPIO.Ident)tempbase;

                    // if (id.visible == false) { break; }
                    IdentContainer tempid = new IdentContainer(id);
                    reflex.Controls.Add(tempid);
                    break;

                case IFPIO.ObjectEnum.Int:
                    IFPIO.IFPInt int32 = (IFPIO.IFPInt)tempbase;

                    // if (int32.visible == false) { break; }
                    Int32Container tempint = new Int32Container(int32);
                    reflex.Controls.Add(tempint);
                    break;
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// The cycle elements.
        /// </summary>
        /// <param name="reflex">The reflex.</param>
        /// <param name="elements">The elements.</param>
        /// <param name="meta">The meta.</param>
        /// <param name="offset">The offset.</param>
        /// <param name="map">The map.</param>
        /// <param name="TagIndex">The TagIndex.</param>
        /// <param name="magic">The magic.</param>
        /// <remarks></remarks>
        private void CycleElements(
            ref SplitReflexive reflex, object[] elements, ref Meta meta, int offset, Map map, int TagIndex, int magic)
        {
            for (int x = 0; x < reflex.chunkcount; x++)
            {
                SplitReflexive chunkreflexive = new SplitReflexive();
                map.BR.BaseStream.Position = reflex.realtranslation + (x * reflex.chunksize);
                chunkreflexive.MS          = new MemoryStream(reflex.chunksize);
                chunkreflexive.MS.Write(map.BR.ReadBytes(reflex.chunksize), 0, reflex.chunksize);
                chunkreflexive.chunksize          = reflex.chunksize;
                chunkreflexive.splitReflexiveType = SplitReflexive.SplitReflexiveType.Chunk;

                reflex.Chunks.Add(chunkreflexive);

                for (int xx = 0; xx < elements.Length; xx++)
                {
                    IFPIO.BaseObject tempbase = (IFPIO.BaseObject)elements[xx];

                    switch (tempbase.ObjectType)
                    {
                    case IFPIO.ObjectEnum.Struct:
                        IFPIO.Reflexive tempreflex = (IFPIO.Reflexive)tempbase;

                        SplitReflexive r = new SplitReflexive();
                        map.BR.BaseStream.Position = offset + tempreflex.offset + (x * reflex.chunksize);
                        r.mapOffset  = (int)map.BR.BaseStream.Position;
                        r.chunkcount = map.BR.ReadInt32();
                        if (r.chunkcount == 0)
                        {
                            continue;
                        }

                        r.chunksize        = tempreflex.chunkSize;
                        r.translation      = map.BR.ReadInt32() - magic;
                        r.pointstoTagIndex = map.Functions.ForMeta.FindMetaByOffset(r.translation);
                        r.description      = tempreflex.name;
                        if (r.pointstoTagIndex == -1)
                        {
                            continue;
                        }

                        // r.parent = reflex.description;// parentname;
                        r.realtranslation = r.translation;
                        r.realTagIndex    = r.pointstoTagIndex;

                        r.label = tempreflex.label;

                        r.pointstoTagIndex = meta.TagIndex;
                        r.pointstotagtype  = meta.type;
                        r.pointstotagname  = meta.name;
                        r.offset           = tempreflex.offset;
                        r.intag            = meta.TagIndex;
                        r.intagtype        = meta.type;
                        r.intagname        = meta.name;
                        r.translation     -= map.MetaInfo.Offset[r.realTagIndex];

                        r.inchunknumber      = x;
                        r.splitReflexiveType = SplitReflexive.SplitReflexiveType.Container;
                        r.Chunks             = new List <SplitReflexive>();
                        CycleElements(
                            ref r, tempreflex.items, ref meta, r.realtranslation, map, r.pointstoTagIndex, magic);
                        reflex.Chunks[x].ChunkResources.Add(r);
                        meta.reflexivecount++;

                        break;

                    case IFPIO.ObjectEnum.Ident:
                        IFPIO.Ident tempident = (IFPIO.Ident)tempbase;
                        SplitIdent  i         = new SplitIdent();
                        map.BR.BaseStream.Position = offset + tempident.offset + (x * reflex.chunksize);
                        i.mapOffset = (int)map.BR.BaseStream.Position;
                        i.ident     = map.BR.ReadInt32();
                        if (i.ident != -1)
                        {
                            try
                            {
                                i.pointstoTagIndex = map.Functions.ForMeta.FindMetaByID(i.ident);
                                i.pointstotagtype  = map.MetaInfo.TagType[i.pointstoTagIndex];
                                i.pointstotagname  = map.FileNames.Name[i.pointstoTagIndex];
                            }
                            catch
                            {
                                continue;
                            }
                        }
                        else
                        {
                            continue;
                        }

                        i.mapOffset = offset + tempident.offset + (x * reflex.chunksize);

                        i.offset        = tempident.offset;
                        i.inchunknumber = x;
                        i.intag         = TagIndex;
                        i.intagtype     = map.MetaInfo.TagType[i.intag];
                        i.intagname     = map.FileNames.Name[i.intag];
                        i.description   = tempident.name;

                        reflex.Chunks[x].ChunkResources.Add(i);
                        break;

                    case IFPIO.ObjectEnum.StringID:
                        IFPIO.SID   tempstringid = (IFPIO.SID)tempbase;
                        SplitString si           = new SplitString();
                        map.BR.BaseStream.Position = offset + tempstringid.offset + (x * reflex.chunksize);
                        si.mapOffset = (int)map.BR.BaseStream.Position;
                        si.id        = map.BR.ReadUInt16();
                        if (si.id == 0 | si.id >= map.MapHeader.scriptReferenceCount)
                        {
                            continue;
                        }

                        map.BR.ReadByte();
                        int temp = map.BR.ReadByte();
                        if (temp != map.Strings.Length[si.id])
                        {
                            continue;
                        }

                        si.mapOffset = offset + tempstringid.offset + (x * reflex.chunksize);
                        si.offset    = si.mapOffset - map.MetaInfo.Offset[TagIndex];

                        si.offset        = tempstringid.offset;
                        si.inchunknumber = x;
                        si.name          = map.Strings.Name[si.id];
                        si.intag         = TagIndex;
                        si.intagtype     = map.MetaInfo.TagType[si.intag];
                        si.intagname     = map.FileNames.Name[si.intag];
                        si.description   = tempstringid.name;
                        reflex.Chunks[x].ChunkResources.Add(si);
                        break;
                    }
                }
            }

            return;
        }
Ejemplo n.º 5
0
        private void LoadENTControls(object[] entArray)
        {
            this.selectedTagType = Maps.map[mapIndex].SelectedMeta.type;

            this.toolStripTagType.Text = "[" + this.selectedTagType.ToString() + "]";
            this.toolStripTagName.Text = Maps.map[mapIndex].SelectedMeta.name;
            //this.Padding = new Padding(10);
            int colorSpaceCount = 4;

            // Custom Plugins access
            ra = new RegistryAccess(Microsoft.Win32.Registry.CurrentUser, RegistryAccess.RegPaths.Halo2CustomPlugins + pluginName + "\\" + this.selectedTagType);
            if (pluginName == null)
            {
                ra.CloseReg();
            }

            foreach (object o in entArray)
            {
                IFPIO.BaseObject tempbase = (IFPIO.BaseObject)o;
                if (tempbase.visible == false)
                {
                    if (Meta_Editor.MetaEditor.ShowInvisibles == false)
                    {
                        continue;
                    }
                }

                // skip hidden custom plugins variables (mark reflexives to be removed if empty)
                bool skipEmptyReflex = false;
                if (ra.isOpen && ra.getValue(tempbase.offset.ToString()) == bool.FalseString)
                {
                    if (tempbase.ObjectType == IFPIO.ObjectEnum.Struct)
                    {
                        skipEmptyReflex = true;
                    }
                    else
                    {
                        continue;
                    }
                }


                switch (tempbase.ObjectType)
                {
                case IFPIO.ObjectEnum.Struct:
                {
                    if (Meta_Editor.MetaEditor.ShowReflexives == false)
                    {
                        break;
                    }
                    // tempLabel is a blank space located above reflexives
                    Label tempLabel = new Label();
                    tempLabel.AutoSize = true;
                    tempLabel.Location = new System.Drawing.Point(0, 0);
                    tempLabel.Name     = "label1";
                    tempLabel.Dock     = DockStyle.Top;
                    tempLabel.Size     = new System.Drawing.Size(35, 13);
                    tempLabel.TabIndex = tabIndex;

                    // tempReflexive is the reflexive and all data (incl other reflexives) within it
                    ReflexiveControl tempReflexive = new ReflexiveControl(mapIndex, Maps.map[mapIndex].SelectedMeta.offset, ((IFPIO.Reflexive)tempbase).HasCount, tempbase.lineNumber, this);
                    //tempReflexive.Location = new System.Drawing.Point(10, 0);
                    tempReflexive.Name     = "reflexive";
                    tempReflexive.TabIndex = tabIndex;
                    tempReflexive.LoadENTControls((IFPIO.Reflexive)tempbase, ((IFPIO.Reflexive)tempbase).items,
                                                  true, 0, ref tabIndex, tempbase.offset.ToString());

                    // Label, Combobox & Button are always added ( = 3)
                    if (!(tempReflexive.Controls.Count <= 2 && skipEmptyReflex))
                    {
                        this.Controls[0].Controls.Add(tempLabel);
                        this.Controls[0].Controls[this.Controls[0].Controls.Count - 1].BringToFront();
                        this.Controls[0].Controls.Add(tempReflexive);
                        this.Controls[0].Controls[this.Controls[0].Controls.Count - 1].BringToFront();
                    }
                    break;
                }

                case IFPIO.ObjectEnum.Ident:
                {
                    if (Meta_Editor.MetaEditor.ShowIdents == false)
                    {
                        break;
                    }
                    Ident tempident = new Ident(tempbase.name, mapIndex, tempbase.offset, ((IFPIO.Ident)tempbase).hasTagType, tempbase.lineNumber);
                    tempident.Name     = "ident";
                    tempident.TabIndex = tabIndex;
                    tempident.Populate(Maps.map[mapIndex].SelectedMeta.offset);
                    tempident.Tag = "[" + tempident.Controls[2].Text + "] "
                                    + tempident.Controls[1].Text;
                    tempident.Controls[1].ContextMenuStrip = identContext;
                    this.Controls[0].Controls.Add(tempident);
                    this.Controls[0].Controls[this.Controls[0].Controls.Count - 1].BringToFront();
                    break;
                }

                case IFPIO.ObjectEnum.StringID:
                {
                    if (Meta_Editor.MetaEditor.ShowSIDs == false)
                    {
                        break;
                    }
                    SID tempSID = new SID(tempbase.name, mapIndex, tempbase.offset, tempbase.lineNumber);
                    tempSID.Name     = "sid";
                    tempSID.TabIndex = tabIndex;
                    tempSID.Populate(Maps.map[mapIndex].SelectedMeta.offset);
                    this.Controls[0].Controls.Add(tempSID);
                    this.Controls[0].Controls[this.Controls[0].Controls.Count - 1].BringToFront();
                    break;
                }

                case IFPIO.ObjectEnum.Float:
                {
                    if (Meta_Editor.MetaEditor.ShowFloats == false)
                    {
                        break;
                    }
                    DataValues tempFloat = new DataValues(tempbase.name, mapIndex, tempbase.offset, IFPIO.ObjectEnum.Float, tempbase.lineNumber);
                    tempFloat.TabIndex = tabIndex;
                    tempFloat.Populate(Maps.map[mapIndex].SelectedMeta.offset);
                    this.Controls[0].Controls.Add(tempFloat);
                    this.Controls[0].Controls[this.Controls[0].Controls.Count - 1].BringToFront();
                    break;
                }

                case IFPIO.ObjectEnum.String32:
                {
                    if (Meta_Editor.MetaEditor.ShowString32s == false && tempbase.ObjectType == IFPIO.ObjectEnum.String32)
                    {
                        break;
                    }
                    EntStrings tempstring = new EntStrings(tempbase.name, mapIndex, tempbase.offset, ((IFPIO.IFPString)tempbase).size, ((IFPIO.IFPString)tempbase).type, tempbase.lineNumber);
                    tempstring.Name     = "string";
                    tempstring.TabIndex = tabIndex;
                    tempstring.Populate(Maps.map[mapIndex].SelectedMeta.offset);
                    this.Controls[0].Controls.Add(tempstring);
                    this.Controls[0].Controls[this.Controls[0].Controls.Count - 1].BringToFront();
                    break;
                }

                case IFPIO.ObjectEnum.UnicodeString256:
                {
                    if (Meta_Editor.MetaEditor.ShowUnicodeString256s == false)
                    {
                        break;
                    }
                    goto case IFPIO.ObjectEnum.String32;
                }

                case IFPIO.ObjectEnum.String256:
                {
                    if (Meta_Editor.MetaEditor.ShowString256s == false)
                    {
                        break;
                    }
                    goto case IFPIO.ObjectEnum.String32;
                }

                case IFPIO.ObjectEnum.UnicodeString64:
                {
                    if (Meta_Editor.MetaEditor.ShowUnicodeString64s == false)
                    {
                        break;
                    }
                    goto case IFPIO.ObjectEnum.String32;
                }

                case IFPIO.ObjectEnum.String:
                {
                    if (Meta_Editor.MetaEditor.ShowString32s == false && tempbase.ObjectType == IFPIO.ObjectEnum.String32)
                    {
                        break;
                    }
                    EntStrings tempstring = new EntStrings(tempbase.name, mapIndex, tempbase.offset, ((IFPIO.IFPString)tempbase).size, ((IFPIO.IFPString)tempbase).type, tempbase.lineNumber);
                    tempstring.Name     = "string";
                    tempstring.TabIndex = tabIndex;
                    tempstring.Populate(Maps.map[mapIndex].SelectedMeta.offset);
                    this.Controls[0].Controls.Add(tempstring);
                    this.Controls[0].Controls[this.Controls[0].Controls.Count - 1].BringToFront();
                    break;
                }

                case IFPIO.ObjectEnum.Int:
                {
                    if (((IFPIO.IFPInt)tempbase).entIndex.nulled == true)
                    {
                        if ((Meta_Editor.MetaEditor.ShowInts == false && tempbase.ObjectType == IFPIO.ObjectEnum.Int) ||
                            (Meta_Editor.MetaEditor.ShowShorts == false && tempbase.ObjectType == IFPIO.ObjectEnum.Short) ||
                            (Meta_Editor.MetaEditor.ShowUshorts == false && tempbase.ObjectType == IFPIO.ObjectEnum.UShort) ||
                            (Meta_Editor.MetaEditor.ShowUints == false && tempbase.ObjectType == IFPIO.ObjectEnum.UInt))
                        {
                            break;
                        }
                        DataValues tempdatavalues = new DataValues(tempbase.name, mapIndex, tempbase.offset, tempbase.ObjectType, tempbase.lineNumber);
                        tempdatavalues.TabIndex = tabIndex;
                        tempdatavalues.Populate(Maps.map[mapIndex].SelectedMeta.offset);
                        this.Controls[0].Controls.Add(tempdatavalues);
                        this.Controls[0].Controls[this.Controls[0].Controls.Count - 1].BringToFront();
                    }
                    else
                    {
                        if ((Meta_Editor.MetaEditor.ShowBlockIndex32s == false && (tempbase.ObjectType == IFPIO.ObjectEnum.Int | tempbase.ObjectType == IFPIO.ObjectEnum.UInt)) ||
                            (Meta_Editor.MetaEditor.ShowBlockIndex16s == false && (tempbase.ObjectType == IFPIO.ObjectEnum.Short | tempbase.ObjectType == IFPIO.ObjectEnum.UShort)) ||
                            (Meta_Editor.MetaEditor.ShowBlockIndex8s == false && tempbase.ObjectType == IFPIO.ObjectEnum.Byte))
                        {
                            break;
                        }
                        Indices tempdatavalues = new Indices(tempbase.name, mapIndex, tempbase.offset, tempbase.ObjectType, ((IFPIO.IFPInt)tempbase).entIndex);
                        tempdatavalues.TabIndex = tabIndex;
                        this.Controls[0].Controls.Add(tempdatavalues);
                        this.Controls[0].Controls[this.Controls[0].Controls.Count - 1].BringToFront();
                    }
                    break;
                }

                case IFPIO.ObjectEnum.Short:
                {
                    goto case IFPIO.ObjectEnum.Int;
                }

                case IFPIO.ObjectEnum.UShort:
                {
                    goto case IFPIO.ObjectEnum.Int;
                }

                case IFPIO.ObjectEnum.UInt:
                {
                    goto case IFPIO.ObjectEnum.Int;
                }

                case IFPIO.ObjectEnum.Unknown:
                {
                    if (Meta_Editor.MetaEditor.ShowUndefineds == false)
                    {
                        break;
                    }
                    DataValues tempUnknown = new DataValues(tempbase.name, mapIndex, tempbase.offset, IFPIO.ObjectEnum.Unknown, tempbase.lineNumber);
                    tempUnknown.TabIndex = tabIndex;
                    tempUnknown.Populate(Maps.map[mapIndex].SelectedMeta.offset);
                    this.Controls[0].Controls.Add(tempUnknown);
                    this.Controls[0].Controls[this.Controls[0].Controls.Count - 1].BringToFront();
                    break;
                }

                case IFPIO.ObjectEnum.Byte_Flags:
                {
                    if (Meta_Editor.MetaEditor.ShowBitmask8s == false)
                    {
                        break;
                    }
                    Bitmask tempbitmask = new Bitmask(tempbase.name, mapIndex, tempbase.offset, ((IFPIO.Bitmask)tempbase).bitmaskSize, ((IFPIO.Bitmask)tempbase).options, tempbase.lineNumber);
                    tempbitmask.TabIndex = tabIndex;
                    tempbitmask.Populate(Maps.map[mapIndex].SelectedMeta.offset);
                    this.Controls[0].Controls.Add(tempbitmask);
                    this.Controls[0].Controls[this.Controls[0].Controls.Count - 1].BringToFront();
                    break;
                }

                case IFPIO.ObjectEnum.Word_Flags:
                {
                    if (Meta_Editor.MetaEditor.ShowBitmask16s == false)
                    {
                        break;
                    }
                    Bitmask tempbitmask = new Bitmask(tempbase.name, mapIndex, tempbase.offset, ((IFPIO.Bitmask)tempbase).bitmaskSize, ((IFPIO.Bitmask)tempbase).options, tempbase.lineNumber);
                    tempbitmask.TabIndex = tabIndex;
                    tempbitmask.Populate(Maps.map[mapIndex].SelectedMeta.offset);
                    this.Controls[0].Controls.Add(tempbitmask);
                    this.Controls[0].Controls[this.Controls[0].Controls.Count - 1].BringToFront();
                    break;
                }

                case IFPIO.ObjectEnum.Long_Flags:
                {
                    if (Meta_Editor.MetaEditor.ShowBitmask32s == false)
                    {
                        break;
                    }
                    Bitmask tempbitmask = new Bitmask(tempbase.name, mapIndex, tempbase.offset, ((IFPIO.Bitmask)tempbase).bitmaskSize, ((IFPIO.Bitmask)tempbase).options, tempbase.lineNumber);
                    tempbitmask.TabIndex = tabIndex;
                    tempbitmask.Populate(Maps.map[mapIndex].SelectedMeta.offset);
                    this.Controls[0].Controls.Add(tempbitmask);
                    this.Controls[0].Controls[this.Controls[0].Controls.Count - 1].BringToFront();
                    break;
                }

                case IFPIO.ObjectEnum.Char_Enum:
                {
                    if (Meta_Editor.MetaEditor.ShowEnum8s == false)
                    {
                        break;
                    }
                    Enums tempenum = new Enums(tempbase.name, mapIndex, tempbase.offset, ((IFPIO.IFPEnum)tempbase).enumSize, ((IFPIO.IFPEnum)tempbase).options, tempbase.lineNumber);
                    tempenum.TabIndex = tabIndex;
                    tempenum.Populate(Maps.map[mapIndex].SelectedMeta.offset);
                    this.Controls[0].Controls.Add(tempenum);
                    this.Controls[0].Controls[this.Controls[0].Controls.Count - 1].BringToFront();
                    break;
                }

                case IFPIO.ObjectEnum.Enum:
                {
                    if (Meta_Editor.MetaEditor.ShowEnum16s == false)
                    {
                        break;
                    }
                    Enums tempenum = new Enums(tempbase.name, mapIndex, tempbase.offset, ((IFPIO.IFPEnum)tempbase).enumSize, ((IFPIO.IFPEnum)tempbase).options, tempbase.lineNumber);
                    tempenum.TabIndex = tabIndex;
                    tempenum.Populate(Maps.map[mapIndex].SelectedMeta.offset);
                    this.Controls[0].Controls.Add(tempenum);
                    this.Controls[0].Controls[this.Controls[0].Controls.Count - 1].BringToFront();
                    break;
                }

                case IFPIO.ObjectEnum.Long_Enum:
                {
                    if (Meta_Editor.MetaEditor.ShowEnum32s == false)
                    {
                        break;
                    }
                    Enums tempenum = new Enums(tempbase.name, mapIndex, tempbase.offset, ((IFPIO.IFPEnum)tempbase).enumSize, ((IFPIO.IFPEnum)tempbase).options, tempbase.lineNumber);
                    tempenum.TabIndex = tabIndex;
                    tempenum.Populate(Maps.map[mapIndex].SelectedMeta.offset);
                    this.Controls[0].Controls.Add(tempenum);
                    this.Controls[0].Controls[this.Controls[0].Controls.Count - 1].BringToFront();
                    break;
                }

                case IFPIO.ObjectEnum.Byte:
                {
                    if (((IFPIO.IFPByte)tempbase).entIndex.nulled == true)
                    {
                        if (Meta_Editor.MetaEditor.ShowBytes == false)
                        {
                            break;
                        }
                        DataValues tempByte = new DataValues(tempbase.name, mapIndex, tempbase.offset, IFPIO.ObjectEnum.Byte, tempbase.lineNumber);
                        tempByte.TabIndex = tabIndex;
                        this.Controls[0].Controls.Add(tempByte);
                        this.Controls[0].Controls[this.Controls[0].Controls.Count - 1].BringToFront();
                    }
                    else
                    {
                        if (Meta_Editor.MetaEditor.ShowBlockIndex8s == false)
                        {
                            break;
                        }
                        Indices tempdatavalues = new Indices(tempbase.name, mapIndex, tempbase.offset, tempbase.ObjectType, ((IFPIO.IFPByte)tempbase).entIndex);
                        tempdatavalues.TabIndex = tabIndex;
                        this.Controls[0].Controls.Add(tempdatavalues);
                        this.Controls[0].Controls[this.Controls[0].Controls.Count - 1].BringToFront();
                    }
                    break;
                }

                case IFPIO.ObjectEnum.Unused:
                {
                    DataValues tempUnknown = new DataValues(tempbase.name, mapIndex, tempbase.offset, IFPIO.ObjectEnum.Unused, tempbase.lineNumber);
                    tempUnknown.TabIndex = tabIndex;
                    tempUnknown.Populate(Maps.map[mapIndex].SelectedMeta.offset);
                    this.Controls[0].Controls.Add(tempUnknown);
                    this.Controls[0].Controls[this.Controls[0].Controls.Count - 1].BringToFront();
                    break;
                }

                case IFPIO.ObjectEnum.TagType:
                    continue;
                    break;
                }

                if (!(tempbase is IFPIO.Reflexive))
                {
                    ToolTip1.SetToolTip(this.Controls[0].Controls[0].Controls[0], "offset: " + tempbase.offset.ToString());
                }

                if (this.Controls[0].Controls.Count > 0 && this.Controls[0].Controls[0] is DataValues)
                {
                    //if (((tempbase.name.ToLower().Contains(" a") & tempbase.name[tempbase.name.ToLower().IndexOf(" a")]) ||
                    //     tempbase.name.ToLower().Contains("alpha"))& alphaControl == null)
                    if (ColorWheel.checkForColor(tempbase.name, alphaControl, " a", "alpha"))
                    {
                        alphaControl    = (DataValues)this.Controls[0].Controls[0];
                        colorSpaceCount = 0;
                    }
                    //if (tempbase.name.ToLower().Contains(" r") & redControl == null)
                    else if (ColorWheel.checkForColor(tempbase.name, redControl, " r", "red"))
                    {
                        redControl      = (DataValues)this.Controls[0].Controls[0];
                        colorSpaceCount = 0;
                    }
                    //if (tempbase.name.ToLower().Contains(" g") & greenControl == null)
                    else if (ColorWheel.checkForColor(tempbase.name, greenControl, " g", "green"))
                    {
                        greenControl    = (DataValues)this.Controls[0].Controls[0];
                        colorSpaceCount = 0;
                    }
                    //if (tempbase.name.ToLower().Contains(" b") & blueControl == null)
                    else if (ColorWheel.checkForColor(tempbase.name, blueControl, " b", "blue"))
                    {
                        blueControl     = (DataValues)this.Controls[0].Controls[0];
                        colorSpaceCount = 0;
                    }
                    else
                    {
                        colorSpaceCount++;
                        if (colorSpaceCount == 1)
                        {
                            alphaControl = null;
                            redControl   = null;
                            greenControl = null;
                            blueControl  = null;
                        }
                    }
                    if (redControl != null & greenControl != null & blueControl != null)
                    {
                        // Create the new ColorWheel class, indicating
                        // the locations of the color wheel itself, the
                        // brightness area, and the position of the selected color.
                        ColorWheel cw = new ColorWheel();

                        if (alphaControl != null)
                        {
                            cw.setTextBox(alphaControl.textBox1, Color.White);
                        }
                        cw.setTextBox(redControl.textBox1, Color.Red);
                        cw.setTextBox(greenControl.textBox1, Color.Green);
                        cw.setTextBox(blueControl.textBox1, Color.Blue);

                        //p.I.AddRange(new Rectangle[] { SelectedColorRectangle });
                        cw.Dock = DockStyle.Top;
                        this.Controls[0].Controls.Add(cw);
                        this.Controls[0].Controls[this.Controls[0].Controls.Count - 1].BringToFront();
                        // Reset for next batch
                        colorSpaceCount++;
                        alphaControl = null;
                        redControl   = null;
                        greenControl = null;
                        blueControl  = null;
                    }
                }
                else
                {
                    colorSpaceCount++;
                }
                tabIndex++;
            }
            ra.CloseReg();
        }