Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ListEntItems"/> class.
        /// </summary>
        /// <param name="imap">The imap.</param>
        /// <param name="entItems">The ent items.</param>
        /// <remarks></remarks>
        public ListEntItems(Map imap, IFPIO entItems)
        {
            if (imap.SelectedMeta == null)
            {
                this.Close();
            }

            this.Ent = entItems;
            this.map = imap;
            InitializeComponent();
            this.EntItemsTreeView.Nodes.AddRange(LoadEntItemsIntoTreeView(0));
            this.buttGoTo.Tag = this.Ent.ENTElements[0];
            DialogResult DR =
                MessageBox.Show(
                    "No N00bs Beyond This Point.....That Is IF You Want To Keep Working Plugins.....",
                    string.Empty,
                    MessageBoxButtons.OKCancel);
            if (DR == DialogResult.Cancel)
            {
                MessageBox.Show(
                    "You have taken the first step in the NA (N00bs Anonymous) program.  Please continue down the path to becoming 1337");
                this.Close();
            }

            this.combType.Items.AddRange(Enum.GetNames(typeof(IFPIO.ObjectEnum)));
        }
Ejemplo n.º 2
0
 public DataValues(Meta meta, string iEntName, Map map, int iOffsetInChunk, IFPIO.ObjectEnum type, int iLineNumber)
 {
     this.meta = meta;
     this.LineNumber = iLineNumber;
     this.chunkOffset = iOffsetInChunk;
     this.map = map;
     this.EntName = iEntName;
     InitializeComponent();
     this.Dock = DockStyle.Top;
     this.Controls[0].Text = EntName;
     this.Controls[2].Text = type.ToString();
     this.ValueType = type;
     switch (this.ValueType)
     {
         case IFPIO.ObjectEnum.Byte:
             this.size = 1;
             break;
         case IFPIO.ObjectEnum.Short:
         case IFPIO.ObjectEnum.UShort:
             this.size = 2;
             break;
         case IFPIO.ObjectEnum.Int:
         case IFPIO.ObjectEnum.UInt:
         case IFPIO.ObjectEnum.Float:
         case IFPIO.ObjectEnum.Unknown:
             this.size = 4;
             break;
         case IFPIO.ObjectEnum.Unused:
             this.size = 0;
             break;
     }
     this.AutoSize = false;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// The Enums class
 /// </summary>
 /// <param name="meta">The controls meta data</param>
 /// <param name="iEntName">The identifying name of the meta string</param>
 /// <param name="map">The metas map file</param>
 /// <param name="iOffsetInChunk">The offset to the string in the memory stream</param>
 /// <param name="iType">8 for Enum8, 16 for Enum16, 32 for Enum32 types</param>
 /// <param name="ioptions">The array of options available</param>
 /// <param name="iLineNumber"></param>
 public Enums(Meta meta, string iEntName, Map map, int iOffsetInChunk, int iType, IFPIO.Option[] ioptions, int iLineNumber)
 {
     this.meta = meta;
     this.LineNumber = iLineNumber;
     this.Options = ioptions;
     this.enumType = iType;
     this.size = iType / 8;
     this.chunkOffset = iOffsetInChunk;
     this.map = map;
     this.EntName = iEntName;
     InitializeComponent();
     this.Size = this.PreferredSize;
     this.Dock = DockStyle.Top;
     this.Controls[0].Text = EntName;
     switch (iType)
     {
         case 8:
             {
                 this.Controls[2].Text = "Enum8";
                 break;
             }
         case 16:
             {
                 this.Controls[2].Text = "Enum16";
                 break;
             }
         case 32:
             {
                 this.Controls[2].Text = "Enum32";
                 break;
             }
     }
     this.AutoSize = false;
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Creates a color wheel with associated (A)RGB text boxes
        /// </summary>
        /// <param name="meta"></param>
        /// <param name="iEntName">Control display name</param>
        /// <param name="map"></param>
        /// <param name="iOffsetInChunk"></param>
        /// <param name="hasAlphaChannel">True if ARGB, False for RGB</param>
        /// <param name="valueType">Float for 0f-1f, Int for 0-255</param>
        /// <param name="iLineNumber"></param>
        public argb_color(Meta meta, string iEntName, Map map, int iOffsetInChunk, bool hasAlphaChannel, IFPIO.ObjectEnum valueType,int iLineNumber)
        {
            InitializeComponent();

            this.meta = meta;
            this.LineNumber = iLineNumber;
            this.chunkOffset = iOffsetInChunk;
            this.map = map;
            this.EntName = " " + iEntName + " ";
            this.Dock = DockStyle.Top;
            this.Controls[0].Text = EntName;
            this.hasAlpha = hasAlphaChannel;
            this.ValueType = valueType;
            switch (valueType)
            {
                case IFPIO.ObjectEnum.Byte:
                    this.eachSize = 1;
                    break;
                case IFPIO.ObjectEnum.Short:
                case IFPIO.ObjectEnum.UShort:
                    this.eachSize = 2;
                    break;
                case IFPIO.ObjectEnum.Int:
                case IFPIO.ObjectEnum.UInt:
                case IFPIO.ObjectEnum.Float:
                case IFPIO.ObjectEnum.Unknown:
                    this.eachSize = 4;
                    break;
            }
            this.size = (hasAlpha ? eachSize * 4 : eachSize * 3);

            CW = new ColorWheel();
            CW.Location = new Point(180, 5);

            Red = new DataValues(meta, "Red", map, iOffsetInChunk, valueType, iLineNumber);
            Red.BackColor = System.Drawing.Color.DarkRed;
            CW.setTextBox(Red.textBox1, Color.Red);

            Blue = new DataValues(meta, "Blue", map, iOffsetInChunk + eachSize, valueType, iLineNumber);
            Blue.BackColor = System.Drawing.Color.DarkBlue;
            CW.setTextBox(Blue.textBox1, Color.Blue);

            Green = new DataValues(meta, "Green", map, iOffsetInChunk + eachSize * 2, valueType, iLineNumber);
            Green.BackColor = System.Drawing.Color.FromArgb(10, 80, 35);
            CW.setTextBox(Green.textBox1, Color.Green);

            if (hasAlpha)
            {
                Alpha = new DataValues(meta, "Alpha", map, iOffsetInChunk + eachSize * 3, valueType, iLineNumber);
                Alpha.BackColor = System.Drawing.Color.Gray;
                CW.setTextBox(Alpha.textBox1, Color.White);
                gbRGBColor.Controls.Add(Alpha);
            }

            gbRGBColor.Controls.Add(CW);
            CW.BringToFront();
            gbRGBColor.Controls.Add(Green);
            gbRGBColor.Controls.Add(Blue);
            gbRGBColor.Controls.Add(Red);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MetaEditor"/> class.
        /// </summary>
        /// <param name="ifp">The ifp.</param>
        /// <param name="split">The split.</param>
        /// <param name="mapx">The mapx.</param>
        /// <remarks></remarks>
        public MetaEditor(IFPIO ifp, SplitContainer split, Map mapx)
        {
            map = mapx;

            ReflexiveContainer tempr = new ReflexiveContainer("Header");
            MakeControls(0, ifp.items, ref tempr);
            Controls = tempr;
            DrawControls(ref split);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// The get ifp.
        /// </summary>
        /// <param name="TagType">The tag type.</param>
        /// <param name="map">The map.</param>
        /// <returns></returns>
        /// <remarks></remarks>
        public static IFPIO GetIfp(string TagType, HaloVersionEnum HaloVersion)
        {
            IFPIO tempifp;
            if (HaloVersion == HaloVersionEnum.Halo2 ||
                HaloVersion == HaloVersionEnum.Halo2Vista)
            {
                tempifp = (IFPIO)H2IFPHash[TagType];
                if (tempifp == null)
                {
                    tempifp = new IFPIO();

                    // string temps = Global.StartupPath + "\\plugins\\" + TagType.Trim() + ".ifp";
                    string temps = Prefs.pathPluginsFolder + "\\" + TagType.Trim() + ".ent";
                    temps = temps.Replace("<", "_");
                    temps = temps.Replace(">", "_");
                    try
                    {
                        tempifp.ReadIFP(temps);
                    }
                    catch (Exception e)
                    {
                        throw new Exception("Error Reading Ent: " + TagType, e);
                    }

                    // IFPHashMap.H2IFPHash.Remove(TagType);
                    H2IFPHash.Add(TagType, tempifp);
                }
            }
            else
            {
                // Halo 1 or Halo CE
                tempifp = (IFPIO)H1IFPHash[TagType];
                if (tempifp == null)
                {
                    tempifp = new IFPIO();

                    // string temps = Global.StartupPath + "\\plugins\\" + TagType.Trim() + ".ifp";
                    string temps = Global.StartupPath + "\\Plugins\\Halo 1\\ent\\" + TagType.Trim() + ".ent";
                    temps = temps.Replace("<", "_");
                    temps = temps.Replace(">", "_");
                    try
                    {
                        tempifp.ReadIFP(temps /* + "2"*/);
                    }
                    catch (Exception ex)
                    {
                        Global.ShowErrorMsg("Error Reading Ent: " + TagType, ex);
                    }

                    H1IFPHash.Add(TagType, tempifp);
                }
            }

            return tempifp;
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DataValues"/> class.
 /// </summary>
 /// <param name="iEntName">
 /// The i ent name.
 /// </param>
 /// <param name="map">
 /// The map.
 /// </param>
 /// <param name="iOffsetInChunk">
 /// The i offset in chunk.
 /// </param>
 /// <param name="type">
 /// The type.
 /// </param>
 /// <param name="iLineNumber">
 /// The i line number.
 /// </param>
 public DataValues(string iEntName, Map map, int iOffsetInChunk, IFPIO.ObjectEnum type, int iLineNumber)
 {
     this.LineNumber = iLineNumber;
     this.chunkOffset = iOffsetInChunk;
     this.map = map;
     this.EntName = iEntName;
     InitializeComponent();
     this.Dock = DockStyle.Top;
     this.Controls[0].Text = EntName;
     this.Controls[2].Text = type.ToString();
     this.ValueType = type;
     this.AutoSize = false;
     this.Enter += DataValues_GotFocus;
     this.Leave += DataValues_LostFocus;
 }
Ejemplo n.º 8
0
        /// <summary>
        /// The split with ifp.
        /// </summary>
        /// <param name="ifp">The ifp.</param>
        /// <param name="meta">The meta.</param>
        /// <param name="map">The map.</param>
        /// <remarks></remarks>
        public void SplitWithIFP(ref IFPIO ifp, ref Meta meta, Map map)
        {
            this.type = meta.type;
            this.TagIndex = meta.TagIndex;
            this.name = meta.name;
            this.offset = meta.offset;
            this.magic = meta.magic;
            this.raw = meta.raw;
            this.rawtype = meta.rawType;
            map.OpenMap(MapTypes.Internal);
            if (ifp.items != null)
            {
                map.BR.BaseStream.Position = meta.offset;
                Header = new SplitReflexive();
                Header.offset = 0;
                Header.Chunks = new List<SplitReflexive>();
                Header.translation = 0;

                // Header.MS = new MemoryStream(ifp.headerSize);
                // Header.MS.Write(map.BR.ReadBytes(ifp.headerSize), 0, ifp.headerSize);
                Header.chunksize = ifp.headerSize;
                Header.chunkcount = 1;
                Header.splitReflexiveType = SplitReflexive.SplitReflexiveType.Container;
                Header.realtranslation = meta.offset;
                if (meta.type == "sbsp")
                {
                    int p = map.BSP.FindBSPNumberByBSPIdent(meta.ident);
                    CycleElements(
                        ref Header, ifp.items, ref meta, meta.offset, map, meta.TagIndex, map.BSP.sbsp[p].magic);
                }
                else if (meta.type == "ltmp")
                {
                    int p = map.BSP.FindBSPNumberByLightMapIdent(meta.ident);
                    CycleElements(
                        ref Header, ifp.items, ref meta, meta.offset, map, meta.TagIndex, map.BSP.sbsp[p].magic);
                }
                else
                {
                    // not "sbsp" or "ltmp"
                    CycleElements(ref Header, ifp.items, ref meta, meta.offset, map, meta.TagIndex, map.SecondaryMagic);
                }
            }

            map.CloseMap();
        }
Ejemplo n.º 9
0
        /// <summary>
        /// The format if ps in directory.
        /// </summary>
        /// <param name="path">The path.</param>
        /// <remarks></remarks>
        public static void FormatIFPsInDirectory(string path)
        {
            string[] temps = Directory.GetFiles(path, "*.ifp2");

            for (int counter = 0; counter < 2; counter++)
            {
                foreach (string s in temps)
                {
                    IFPIO ifp = new IFPIO();
                    ifp.ReadIFP(s);
                    string tempentstring = s.Replace("ifp2", "ent");
                    tempentstring = tempentstring.Replace("ifp", "ent");
                    ifp.IFPOutput(tempentstring);
                }

                temps = Directory.GetFiles(path, "*.ifp");
            }
        }
Ejemplo n.º 10
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="iEntName"></param>
 /// <param name="map"></param>
 /// <param name="iOffsetInChunk"></param>
 /// <param name="iBitCount"></param>
 /// <param name="ioptions"></param>
 /// <param name="iLineNumber"></param>
 public Bitmask(string iEntName, Map map, int iOffsetInChunk, int iBitCount, IFPIO.Option[] ioptions, int iLineNumber)
 {
     this.LineNumber = iLineNumber;
     this.Options = ioptions;
     this.Bits = new bool[iBitCount];
     this.visibleBits = new bool[iBitCount];
     this.bitCount = iBitCount;
     this.chunkOffset = iOffsetInChunk;
     this.map = map;
     this.EntName = iEntName;
     InitializeComponent();
     this.label1.Text = "Bitmask" + iBitCount;
     this.label1.Left -= iBitCount.ToString().Length * 8;
     this.getLongestName();
     this.MakeControls();
     this.Size = this.PreferredSize;
     this.Dock = DockStyle.Top;
     this.Controls[0].Text = EntName;
     this.AutoSize = true;
     this.Enter += Bitmask_Enter;
     this.Leave += Bitmask_Leave;
 }
Ejemplo n.º 11
0
        private void createTreeListing()
        {
            if (meta == null)
                return;

            try
            {
                ifp = HaloMap.Plugins.IFPHashMap.GetIfp(meta.type, HaloVersion);

                #region Save info about our current Selected Node
                TreeNode node = this.SelectedNode;
                string tempS = string.Empty;
                string[] path = new string[0];
                if (node != null)
                {
                    while (node.Level > 0)
                    {
                        tempS = "\\" + ((reflexiveData)node.Tag).reflexive.offset.ToString() + tempS;
                        node = node.Parent;
                    }
                    path = ("0" + tempS).Split('\\');
                }
                #endregion

                this.Nodes.Clear();
                this.Sorted = sortByName;
                this.Nodes.Add("0", ".:[ MAIN ]:.");
                reflexiveData rd = new reflexiveData();
                this.Nodes[0].Tag = rd;
                rd.node = this.Nodes[0];
                rd.chunkCount = 1;
                rd.chunkSelected = 0;
                rd.baseOffset = 0; // meta.offset;
                rd.inTagNumber = meta.TagIndex;
                refData.Clear();
                refData.Add(rd);

                BinaryReader br = new BinaryReader(memStream);
                this.Nodes[0].Nodes.AddRange(loadTreeReflexives(br, 0, ifp.items, true)); //meta.offset

                //this.ExpandAll();
                this.Nodes[0].Expand();

                #region Re-Select our previously selected node
                TreeNodeCollection nodes = this.Nodes[0].Nodes;
                this.Enabled = false;
                this.SelectedNode = this.Nodes[0];
                for (int i = 1; i < path.Length; i++)
                {
                    foreach (TreeNode tn in nodes)
                    {
                        if (((reflexiveData)tn.Tag).reflexive.offset.ToString() == path[i])
                        {
                            this.SelectedNode = tn;
                            nodes = tn.Nodes;
                            break;
                        }
                    }
                }
                // If we didn't get the right node, deselect all nodes
                if (this.SelectedNode.Level != path.Length - 1)
                    this.SelectedNode = null;
                this.Enabled = true;
                #endregion
            }
            catch (Exception ex)
            {
                Globals.Global.ShowErrorMsg(string.Empty, ex);
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Creates a "MAIN" reflexive and a complete list of all sub-reflexives.
        /// </summary>
        /// <returns>A Pointer to the topmost reflexive</returns>
        private reflexiveData createReflexiveList()
        {
            reflexiveData rd = new reflexiveData(null);
            try
            {
                ifp = HaloMap.Plugins.IFPHashMap.GetIfp(meta.type, map.HaloVersion);

                rd.node = new TreeNode(".:[ MAIN ]:.");
                rd.node.Tag = rd;
                rd.chunkCount = 1;
                rd.chunkSelected = 0;
                rd.baseOffset = 0; // meta.offset;
                rd.inTagNumber = meta.TagIndex;

                // Load all the children reflexives for the Tag ("Main")
                rd.children = loadReflexivesList(rd, meta.offset, ifp.items);

                // Loads all chunk count, offset, etc data from MAIN down.
                refreshReflexiveList(rd);

                rd.node.Expand();
            }
            catch (Exception ex)
            {
                Globals.Global.ShowErrorMsg(string.Empty, ex);
            }
            return rd;
        }
Ejemplo n.º 13
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="ifpName"></param>
 /// <param name="ifpVisible"></param>
 /// <param name="hasAlphaChannel"></param>
 /// <param name="type"></param>
 /// <param name="ifpOffset"></param>
 /// <param name="entlineNumber"></param>
 /// <param name="entparent"></param>
 /// <param name="entPrevSibling"></param>
 public IFPColor(
     string ifpName, bool ifpVisible, bool hasAlphaChannel, IFPIO.ObjectEnum type, int ifpOffset, int entlineNumber, int entparent, int entPrevSibling)
 {
     this.siblingPrevious = entPrevSibling;
     this.parent = entparent;
     this.lineNumber = entlineNumber;
     this.ObjectType = ObjectEnum.ARGB_Color;
     this.hasAlpha = hasAlphaChannel;
     this.type = type;
     this.offset = ifpOffset;
     this.name = ifpName;
     this.visible = ifpVisible;
 }
Ejemplo n.º 14
0
 /// <summary>
 /// The Indices class
 /// </summary>
 /// <param name="meta">The controls meta data</param>
 /// <param name="iEntName">The identifying name of the meta string</param>
 /// <param name="map">The metas map file</param>
 /// <param name="iOffsetInChunk">The offset to the string in the memory stream</param>
 /// <param name="iValueType">The value type associated with the Indices
 /// <para>Available types are:</para>
 /// <para>��Byte, Short, UShort, Int, UInt, Float, Unknown</para></param>
 /// <param name="iIndex">The type of data that the value points to
 /// <para>Available types are:</para>
 /// <para>��Ident, StringID, Float, Short, UShort, Int, UInt, String32, UnicodeString64, String256, UnicodeString256</para></param>
 public Indices(Meta meta, string iEntName, Map map, int iOffsetInChunk, IFPIO.ObjectEnum iValueType, IFPIO.Index iIndex)
 {
     this.meta = meta;
     this.LineNumber = iIndex.lineNumber;
     this.Dock = DockStyle.Top;
     this.map = map;
     switch (iValueType)
     {
         case IFPIO.ObjectEnum.Byte:
             this.size = 1;
             break;
         case IFPIO.ObjectEnum.Short:
         case IFPIO.ObjectEnum.UShort:
             this.size = 2;
             break;
         case IFPIO.ObjectEnum.Int:
         case IFPIO.ObjectEnum.UInt:
         case IFPIO.ObjectEnum.Float:
         case IFPIO.ObjectEnum.Unknown:
             this.size = 4;
             break;
     }
     this.chunkOffset = iOffsetInChunk;
     this.EntName = iEntName;
     this._EntIndex = iIndex;
     this._IndicesList = new List<string>(0);
     #region Set Block Indice Reference Type
     switch (this._EntIndex.ItemType.ToLower())
     {
         case "ident":
             {
                 this._ItemType = IFPIO.ObjectEnum.Ident; // entity.MetaEditor.DataValues.ENTType.ident;
                 break;
             }
         case "stringid":
             {
                 this._ItemType = IFPIO.ObjectEnum.StringID; // entity.MetaEditor.DataValues.ENTType.sid;
                 break;
             }
         case "float":
             {
                 this._ItemType = IFPIO.ObjectEnum.Float; // entity.MetaEditor.DataValues.ENTType.Float;
                 break;
             }
         case "short":
             {
                 this._ItemType = IFPIO.ObjectEnum.Short; // entity.MetaEditor.DataValues.ENTType.Int16;
                 break;
             }
         case "ushort":
             {
                 this._ItemType = IFPIO.ObjectEnum.UShort; // entity.MetaEditor.DataValues.ENTType.Uint16;
                 break;
             }
         case "int":
             {
                 this._ItemType = IFPIO.ObjectEnum.Int; // entity.MetaEditor.DataValues.ENTType.Int32;
                 break;
             }
         case "uint":
             {
                 this._ItemType = IFPIO.ObjectEnum.UInt; // entity.MetaEditor.DataValues.ENTType.UInt32;
                 break;
             }
         case "string32":
             {
                 this._ItemType = IFPIO.ObjectEnum.String32; // entity.MetaEditor.DataValues.ENTType.string32;
                 break;
             }
         case "unicodestring64":
             {
                 this._ItemType = IFPIO.ObjectEnum.UnicodeString64; // entity.MetaEditor.DataValues.ENTType.unicodestring64;
                 break;
             }
         case "string256":
             {
                 this._ItemType = IFPIO.ObjectEnum.String256; // entity.MetaEditor.DataValues.ENTType.string256;
                 break;
             }
         case "unicodestring256":
             {
                 this._ItemType = IFPIO.ObjectEnum.UnicodeString256; // entity.MetaEditor.DataValues.ENTType.unicodestring64;
                 break;
             }
         default:
             {
                 this._ItemType = IFPIO.ObjectEnum.Unknown; // entity.MetaEditor.DataValues.ENTType.nothing;
                 break;
             }
     }
     #endregion
     InitializeComponent();
     switch (iValueType)
     {
         case IFPIO.ObjectEnum.Short:
             {
                 this.label1.Text = "Int16 Block Index";
                 this._ValueType = IFPIO.ObjectEnum.Short;
                 break;
             }
         case IFPIO.ObjectEnum.Int:
             {
                 this.label1.Text = "Int32 Block Index";
                 this._ValueType = IFPIO.ObjectEnum.Int;
                 break;
             }
         case IFPIO.ObjectEnum.UShort:
             {
                 this.label1.Text = "Uint16 Block Index";
                 this._ValueType = IFPIO.ObjectEnum.UShort;
                 break;
             }
         case IFPIO.ObjectEnum.UInt:
             {
                 this.label1.Text = "Uint32 Block Index";
                 this._ValueType = IFPIO.ObjectEnum.UInt;
                 break;
             }
         case IFPIO.ObjectEnum.Byte:
             {
                 this.label1.Text = "Byte Block Index";
                 this._ValueType = IFPIO.ObjectEnum.Byte;
                 break;
             }
     }
     this.label2.Text = this.EntName;
     if (this._EntIndex.reflexiveTagType + this._EntIndex.reflexiveTagName != string.Empty)
     {
         System.Windows.Forms.ToolTip toolTip1 = new ToolTip();
         toolTip1.IsBalloon = true;
         toolTip1.AutoPopDelay = 10000;
         toolTip1.SetToolTip(
             this.comboBox1,
             "Label located in [" + this._EntIndex.reflexiveTagType + "] " + this._EntIndex.reflexiveTagName);
     }
 }
Ejemplo n.º 15
0
        /// <summary>
        /// The load indices.
        /// </summary>
        /// <param name="EntIndex">The ent index.</param>
        /// <remarks></remarks>
        private void LoadIndices(IFPIO.Index EntIndex)
        {
            if (EntIndex.reflexiveLayer == "root")
            {
                this.UpdateIndices(0, EntIndex);
            }
            else if (EntIndex.reflexiveLayer == "oneup")
            {
                // this is confusing to say the least......I have to get the parent's parent's child.......
                try
                {
                    this.UpdateIndices(
                        this.Ent.ENTElements[this.Ent.ENTElements[((IFPIO.BaseObject)this.buttGoTo.Tag).parent].parent].
                            child,
                        EntIndex);
                }
                catch
                {
                    this.UpdateIndices(0, EntIndex);
                }
            }

            this.combIndicesLayer.Text = EntIndex.reflexiveLayer;
        }
Ejemplo n.º 16
0
            /// <summary>
            /// Initializes a new instance of the <see cref="Int32Container"/> class.
            /// </summary>
            /// <param name="intx">The intx.</param>
            /// <remarks></remarks>
            public Int32Container(IFPIO.IFPInt intx)
            {
                type = ContainerType.Int32;
                Label templabel = new Label();
                templabel.BorderStyle = BorderStyle.FixedSingle;
                templabel.BackColor = Color.Silver;
                templabel.Text = "Int32 (" + intx.name + ") • Offset: " + intx.offset.ToString("X");
                templabel.TextAlign = ContentAlignment.MiddleCenter;
                templabel.Dock = DockStyle.Left;
                templabel.Height = 20;
                templabel.AutoSize = true;
                DescriptionLabel = templabel;

                IntTextBox = new TextBox();
                IntTextBox.Dock = DockStyle.Fill;
                IntTextBox.Height = 20;

                // IntTextBox.Text=

                // NameCombo.Dock = DockStyle.Top;
                panel = new Panel();
                panel.Dock = DockStyle.Top;
                panel.Height = 40;

                // panel.BorderStyle = BorderStyle.FixedSingle;
                panel.Controls.Add(DescriptionLabel);
                panel.Controls.Add(IntTextBox);
            }
Ejemplo n.º 17
0
            /// <summary>
            /// Initializes a new instance of the <see cref="IdentContainer"/> class.
            /// </summary>
            /// <param name="ident">The ident.</param>
            /// <remarks></remarks>
            public IdentContainer(IFPIO.Ident ident)
            {
                type = ContainerType.Ident;
                Label templabel = new Label();
                templabel.BorderStyle = BorderStyle.FixedSingle;
                templabel.BackColor = Color.Silver;
                templabel.Text = "Ident (" + ident.name + ") • Offset: " + ident.offset.ToString("X");
                templabel.TextAlign = ContentAlignment.MiddleCenter;
                templabel.Dock = DockStyle.Top;
                templabel.Height = 20;
                templabel.Width = 125;
                templabel.Top = 0;

                DescriptionLabel = templabel;
                TagTypeCombo = new ComboBox();
                TagTypeCombo.Width = 75;
                TagTypeCombo.Dock = DockStyle.Right;
                TagTypeCombo.Top = 20;
                TagTypeCombo.Left = 0;

                // TagTypeCombo=
                GenerateIdentTypeCombobox(TagTypeCombo);

                NameCombo = new ComboBox();
                NameCombo.Width = 250;
                NameCombo.Dock = DockStyle.Bottom;
                NameCombo.Top = 20;
                NameCombo.Left = 200;

                // NameCombo.Dock = DockStyle.Top;
                panel = new Panel();
                panel.Dock = DockStyle.Top;
                panel.Height = 40;

                // panel.BorderStyle = BorderStyle.FixedSingle;
                panel.Controls.Add(DescriptionLabel);
                panel.Controls.Add(TagTypeCombo);
                panel.Controls.Add(NameCombo);
            }
Ejemplo n.º 18
0
            /// <summary>
            /// Initializes a new instance of the <see cref="IFPEnum"/> class.
            /// </summary>
            /// <param name="ifpoffset">The ifpoffset.</param>
            /// <param name="ifpvisible">if set to <c>true</c> [ifpvisible].</param>
            /// <param name="ifpname">The ifpname.</param>
            /// <param name="ifpoptions">The ifpoptions.</param>
            /// <param name="ifpsize">The ifpsize.</param>
            /// <param name="entlineNumber">The entline number.</param>
            /// <param name="entparent">The entparent.</param>
            /// <param name="entPrevSibling">The ent prev sibling.</param>
            /// <remarks></remarks>
            public IFPEnum(
                int ifpoffset, 
                bool ifpvisible, 
                string ifpname,
                string extendedDescription,
                IFPIO.Option[] ifpoptions, 
                int ifpsize, 
                int entlineNumber, 
                int entparent, 
                int entPrevSibling)
            {
                this.siblingPrevious = entPrevSibling;
                this.parent = entparent;
                this.lineNumber = entlineNumber;
                switch (ifpsize)
                {
                    case 8:
                        this.ObjectType = ObjectEnum.Char_Enum;
                        break;
                    case 16:
                        this.ObjectType = ObjectEnum.Enum;
                        break;
                    case 32:
                        this.ObjectType = ObjectEnum.Long_Enum;
                        break;
                }

                this.offset = ifpoffset;
                this.name = ifpname;
                this.description = extendedDescription;
                this.options = ifpoptions;
                this.visible = ifpvisible;
                this.enumSize = ifpsize;
            }
Ejemplo n.º 19
0
        // Clears all meta data & Transfers ifp to meta
        /// <summary>
        /// The scan with ifp.
        /// </summary>
        /// <param name="ifp">The ifp.</param>
        /// <returns></returns>
        /// <remarks></remarks>
        public string[] ScanWithIFP(ref IFPIO ifp)
        {
            string[] errors = new string[0];
            meta.items.Clear();
            if (ifp.items != null)
            {
                if (meta.parsed)
                {
                    meta.size = 0;
                    meta.MS = new MemoryStream();
                    meta.Map.BR.BaseStream.Position = meta.offset;
                    meta.MS.Write(meta.Map.BR.ReadBytes(ifp.headerSize), 0, ifp.headerSize);
                    meta.size += ifp.headerSize;
                }

                if (meta.type == "sbsp")
                {
                    int p = meta.Map.BSP.FindBSPNumberByBSPIdent(meta.ident);
                    errors = CycleElements(
                        ifp.items, meta.offset, 1, meta.TagIndex, 0, meta.Map.BSP.sbsp[p].magic, 0);
                }
                else if (meta.type == "ltmp")
                {
                    int p = meta.Map.BSP.FindBSPNumberByLightMapIdent(meta.ident);
                    errors = CycleElements(
                        ifp.items, meta.offset, 1, meta.TagIndex, 0, meta.Map.BSP.sbsp[p].magic, 0);
                }
                else
                {
                    // not "sbsp" or "ltmp"
                    // Returns any IDENTS, REFLEXIVES & STRINGS for Reference Listing
                    errors = CycleElements(
                        ifp.items, meta.offset, 1, meta.TagIndex, 0, meta.Map.SecondaryMagic, 0);
                }
            }

            return errors;
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Indices"/> class.
        /// </summary>
        /// <param name="iEntName">
        /// The i ent name.
        /// </param>
        /// <param name="map">
        /// The map.
        /// </param>
        /// <param name="iOffsetInChunk">
        /// The i offset in chunk.
        /// </param>
        /// <param name="iValueType">
        /// The i value type.
        /// </param>
        /// <param name="iIndex">
        /// The i index.
        /// </param>
        public Indices(string iEntName, Map map, int iOffsetInChunk, IFPIO.ObjectEnum iValueType, IFPIO.Index iIndex)
        {
            this.LineNumber = iIndex.lineNumber;
            this.Dock = DockStyle.Top;
            this.map = map;
            this.chunkOffset = iOffsetInChunk;
            this.EntName = iEntName;
            this.EntIndex = iIndex;
            this.tempvalue = new List<string>(0);

            switch (this.EntIndex.ItemType.ToLower())
            {
                case "ident":
                    {
                        this.ItemType = IFPIO.ObjectEnum.Ident; // Entity.MetaEditor.DataValues.ENTType.ident;
                        break;
                    }

                case "stringid":
                    {
                        this.ItemType = IFPIO.ObjectEnum.StringID; // Entity.MetaEditor.DataValues.ENTType.sid;
                        break;
                    }

                case "float":
                    {
                        this.ItemType = IFPIO.ObjectEnum.Float; // Entity.MetaEditor.DataValues.ENTType.Float;
                        break;
                    }

                case "short":
                    {
                        this.ItemType = IFPIO.ObjectEnum.Short; // Entity.MetaEditor.DataValues.ENTType.Int16;
                        break;
                    }

                case "ushort":
                    {
                        this.ItemType = IFPIO.ObjectEnum.UShort; // Entity.MetaEditor.DataValues.ENTType.Uint16;
                        break;
                    }

                case "int":
                    {
                        this.ItemType = IFPIO.ObjectEnum.Int; // Entity.MetaEditor.DataValues.ENTType.Int32;
                        break;
                    }

                case "uint":
                    {
                        this.ItemType = IFPIO.ObjectEnum.UInt; // Entity.MetaEditor.DataValues.ENTType.UInt32;
                        break;
                    }

                case "string32":
                    {
                        this.ItemType = IFPIO.ObjectEnum.String32;

                        // Entity.MetaEditor.DataValues.ENTType.string32;
                        break;
                    }

                case "unicodestring64":
                    {
                        this.ItemType = IFPIO.ObjectEnum.UnicodeString64;

                        // Entity.MetaEditor.DataValues.ENTType.unicodestring64;
                        break;
                    }

                case "string256":
                    {
                        this.ItemType = IFPIO.ObjectEnum.String256;

                        // Entity.MetaEditor.DataValues.ENTType.string256;
                        break;
                    }

                case "unicodestring256":
                    {
                        goto case "string256";
                    }

                default:
                    {
                        this.ItemType = IFPIO.ObjectEnum.Unknown;

                        // Entity.MetaEditor.DataValues.ENTType.nothing;
                        break;
                    }
            }

            InitializeComponent();
            switch (iValueType)
            {
                case IFPIO.ObjectEnum.Short:
                    {
                        this.label1.Text = "Int16 Block Index";
                        this.ValueType = IFPIO.ObjectEnum.Short;
                        break;
                    }

                case IFPIO.ObjectEnum.Int:
                    {
                        this.label1.Text = "Int32 Block Index";
                        this.ValueType = IFPIO.ObjectEnum.Int;
                        break;
                    }

                case IFPIO.ObjectEnum.UShort:
                    {
                        this.label1.Text = "Uint16 Block Index";
                        this.ValueType = IFPIO.ObjectEnum.UShort;
                        break;
                    }

                case IFPIO.ObjectEnum.UInt:
                    {
                        this.label1.Text = "Uint32 Block Index";
                        this.ValueType = IFPIO.ObjectEnum.UInt;
                        break;
                    }

                case IFPIO.ObjectEnum.Byte:
                    {
                        this.label1.Text = "Byte Block Index";
                        this.ValueType = IFPIO.ObjectEnum.Byte;
                        break;
                    }
            }

            this.label2.Text = this.EntName;
            this.Enter += Indices_Enter;
            this.Leave += Indices_Leave;
        }
Ejemplo n.º 21
0
        public void loadControls(int MapNumber)
        {
            this.mapIndex = MapNumber;
            if (Maps.map[mapIndex].SelectedMeta == null) return;
            this.setInfoText("Loading Tag");
            ToolTip1.InitialDelay = 800;
            _Paint = false;
            ReflexiveControl.ME = this;

            this.Controls.Clear();
            // Thanks to RapiD for pointing this fix out! If you just clear them, they stay in memory!
            foreach (Control control in this.panel1.Controls)
            {
                control.Dispose();
            }
            this.panel1.Controls.Clear();
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.toolStrip1);
            this.Controls.Add(this.statusStrip1);
            this.panel1.Top = this.Padding.Top + this.toolStrip1.Height;
            this.panel1.Height = this.Height - (this.Padding.Top + this.Padding.Bottom + this.toolStrip1.Height + this.statusStrip1.Height);
            this.Controls[0].Hide();
            this.Refresh();
            this.SuspendLayout();
            ifp = IFP.IFPHashMap.GetIfp(Maps.map[mapIndex].SelectedMeta.type,mapIndex);
            LoadENTControls(ifp.items);
            this.ResumeLayout(true);
            this.Controls[0].Show();
            _Paint = true;
            this.ReloadMetaForSameTagType(true);
            this.restoreInfoText();
        }
Ejemplo n.º 22
0
        /// <summary>
        /// The load controls.
        /// </summary>
        /// <param name="map">The map number.</param>
        /// <remarks></remarks>
        public void loadControls(Map map)
        {
            this.map = map;
            if (map.SelectedMeta == null)
            {
                return;
            }

            this.setInfoText("Loading Tag");
            ToolTip1.InitialDelay = 800;
            _Paint = false;
            ReflexiveControl.ME = this;

            this.Controls.Clear();

            // Thanks to RapiD for pointing this fix out! If you just clear them, they stay in memory!
            // UPDATE: was using FOREACH loop before, but due to the method, it would only remove half the controls
            //    leaving a memory leak here!
            for (int count = 0; count < this.panel1.Controls.Count; count++)
            {
                this.panel1.Controls[count].Dispose();
            }

            this.panel1.Controls.Clear();
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.toolStrip1);
            this.Controls.Add(this.statusStrip1);
            this.panel1.Top = this.Padding.Top + this.toolStrip1.Height;
            this.panel1.Height = this.Height -
                                 (this.Padding.Top + this.Padding.Bottom + this.toolStrip1.Height +
                                  this.statusStrip1.Height);
            this.Controls[0].Hide();
            this.Refresh();
            this.SuspendLayout();
            ifp = IFPHashMap.GetIfp(map.SelectedMeta.type, map.HaloVersion);
            LoadENTControls(ifp.items);
            this.ResumeLayout(true);
            this.Controls[0].Show();
            _Paint = true;
            this.ReloadMetaForSameTagType(true);
            this.restoreInfoText();
        }
Ejemplo n.º 23
0
        /// <summary>
        /// The update indices.
        /// </summary>
        /// <param name="Counter">The counter.</param>
        /// <param name="EntIndex">The ent index.</param>
        /// <remarks></remarks>
        private void UpdateIndices(int Counter, IFPIO.Index EntIndex)
        {
            List<int> tempIndexers = new List<int>(0);
            List<string> tempNames = new List<string>(0);
            this.combIndicesRToIndex.Items.Clear();
            this.combIndicesItem.Items.Clear();
            tempNames.Add(string.Empty);
            tempIndexers.Add(-1);
            int comboboxitemindexer = 0;
            int comboboxreflexiveindexer = 0;
            int tempitemindexer = 0;
            while (Counter != -1)
            {
                switch (this.Ent.ENTElements[Counter].ObjectType)
                {
                    case IFPIO.ObjectEnum.Struct:
                        {
                            tempIndexers.Add(Counter);
                            tempNames.Add(this.Ent.ENTElements[Counter].name);
                            if (this.Ent.ENTElements[Counter].offset == EntIndex.ReflexiveOffset)
                            {
                                tempitemindexer = this.Ent.ENTElements[Counter].child;
                                comboboxreflexiveindexer = tempIndexers.Count - 1;
                            }

                            goto default;
                        }

                    default:
                        {
                            Counter = this.Ent.ENTElements[Counter].siblingNext;
                            break;
                        }
                }
            }

            this.combIndicesRToIndex.Items.AddRange(tempNames.ToArray());
            this.combIndicesRToIndex.Tag = tempIndexers.ToArray();
            tempIndexers.Clear();
            tempNames.Clear();
            tempNames.Add(string.Empty);
            tempIndexers.Add(-1);
            while (tempitemindexer != -1)
            {
                switch (this.Ent.ENTElements[tempitemindexer].ObjectType)
                {
                    case IFPIO.ObjectEnum.Ident:
                        {
                            tempIndexers.Add(tempitemindexer);
                            tempNames.Add(this.Ent.ENTElements[tempitemindexer].name);
                            if (this.Ent.ENTElements[tempitemindexer].offset == EntIndex.ItemOffset)
                            {
                                comboboxitemindexer = tempIndexers.Count - 1;
                            }

                            goto default;
                        }

                    case IFPIO.ObjectEnum.StringID:
                        {
                            goto case IFPIO.ObjectEnum.Ident;
                        }

                    case IFPIO.ObjectEnum.Float:
                        {
                            goto case IFPIO.ObjectEnum.Ident;
                        }

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

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

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

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

                    case IFPIO.ObjectEnum.String32:
                        {
                            goto case IFPIO.ObjectEnum.Ident;
                        }

                    case IFPIO.ObjectEnum.UnicodeString256:
                        {
                            goto case IFPIO.ObjectEnum.Ident;
                        }

                    case IFPIO.ObjectEnum.String256:
                        {
                            goto case IFPIO.ObjectEnum.Ident;
                        }

                    case IFPIO.ObjectEnum.UnicodeString64:
                        {
                            goto case IFPIO.ObjectEnum.Ident;
                        }

                    default:
                        {
                            tempitemindexer = this.Ent.ENTElements[tempitemindexer].siblingNext;
                            break;
                        }
                }
            }

            this.combIndicesItem.Items.AddRange(tempNames.ToArray());
            this.combIndicesItem.Tag = tempIndexers.ToArray();
            this.combIndicesItem.SelectedIndex = comboboxitemindexer;
            this.combIndicesRToIndex.SelectedIndex = comboboxreflexiveindexer;

            // return tempint;
        }
Ejemplo n.º 24
0
            /// <summary>
            /// Initializes a new instance of the <see cref="ReflexiveContainer"/> class.
            /// </summary>
            /// <param name="reflexive">The reflexive.</param>
            /// <remarks></remarks>
            public ReflexiveContainer(IFPIO.Reflexive reflexive)
            {
                type = ContainerType.Reflexive;

                // Controls.
                Label templabel = new Label();
                templabel.BorderStyle = BorderStyle.FixedSingle;
                templabel.BackColor = Color.Silver;
                templabel.Text = "Reflexive (" + reflexive.name + ") • Offset: " + reflexive.offset.ToString("X");
                templabel.TextAlign = ContentAlignment.MiddleCenter;
                templabel.Dock = DockStyle.Fill;
                templabel.MouseDown += ReflexiveHeader_MouseDown;

                SelectedChunkComboBox = new ComboBox();
                SelectedChunkComboBox.Dock = DockStyle.Right;
                SelectedChunkComboBox.Width = 50;
                SelectedChunkComboBox.Height = 25;
                SelectedChunkComboBox.FlatStyle = FlatStyle.Popup;

                // container
                SplitContainer tempsplit = new SplitContainer();
                tempsplit.Orientation = Orientation.Horizontal;
                tempsplit.Panel1MinSize = 0;
                tempsplit.SplitterDistance = 25;
                tempsplit.IsSplitterFixed = true;
                tempsplit.SplitterWidth = 1;
                tempsplit.Dock = DockStyle.Top;
                SetMaxSize(0, 25);
                tempsplit.MaximumSize = this.MaxSize;

                // panel 1
                tempsplit.Panel1.Controls.Add(templabel);
                tempsplit.Panel1.Controls.Add(SelectedChunkComboBox);

                // panel 2
                tempsplit.Panel2.AutoScroll = true;
                tempsplit.Panel2.BackColor = Color.Honeydew;
                Padding prop = new Padding();
                prop.All = 10;

                // prop.Right = 0;
                tempsplit.Panel2.Padding = prop;
                tempsplit.Panel2Collapsed = true;
                tempsplit.BorderStyle = BorderStyle.None;

                // tempsplit.Visible = true;
                this.Container = tempsplit;
            }
Ejemplo n.º 25
0
        /// <summary>
        /// The butt write plugin_ click.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The e.</param>
        /// <remarks></remarks>
        private void ButtWritePlugin_Click(object sender, EventArgs e)
        {
            this.buttSaveCurrentItem.PerformClick();
            for (int counter = 0; counter < 2; counter++)
            {
                this.Ent.EntOutput(string.Empty, true);
                this.Ent = IFPHashMap.GetIfp(this.map.SelectedMeta.type, this.map.HaloVersion);
            }

            this.UpdateTreeViewItems();
        }
Ejemplo n.º 26
0
        /// <summary>
        /// The load ent controls.
        /// </summary>
        /// <param name="reflexive">
        /// The reflexive.
        /// </param>
        /// <param name="entArray">
        /// The ent array.
        /// </param>
        /// <param name="clearControls">
        /// The clear controls.
        /// </param>
        /// <param name="layer">
        /// The layer.
        /// </param>
        /// <param name="tabIndex">
        /// The tab index.
        /// </param>
        /// <param name="customPluginPath">
        /// The custom plugin path.
        /// </param>
        public void LoadENTControls(
            IFPIO.Reflexive reflexive, 
            object[] entArray, 
            bool clearControls, 
            int layer, 
            ref int tabIndex, 
            string customPluginPath)
        {
            // add padding, offset label vertically, Change button sizes
            // int over = 10;
            if (clearControls)
            {
                foreach (Control c in this.bottomPanel.Controls)
                {
                    c.Dispose();
                }

                this.bottomPanel.Controls.Clear();
            }

            this.reflexiveItems = entArray;
            this.reflexiveLabel = reflexive.label;
            this.AutoSize = true;
            this.BackColor = Color.DarkGray;
            this.BorderStyle = BorderStyle.FixedSingle;
            this.Dock = DockStyle.Top;

            // this.ForeColor = System.Drawing.Color.DarkGray;
            this.Padding = new Padding(10, 0, 0, 0);
            this.offsetInMeta = reflexive.offset;
            this.chunkSize = reflexive.chunkSize;
            int tempCBindex = this.Controls.Count;
            this.tempComboBox.Tag = reflexive.name;
            this.tempLabel.Text = reflexive.name;
            ToolTip1.SetToolTip(this.tempLabel, "offset: " + customPluginPath);

            int colorSpaceCount = 3;

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

                bool skipEmptyReflex = false;
                //if (MetaEditor.ra.isOpen &&
                //    MetaEditor.ra.getValue(customPluginPath + "\\" + tempbase.offset) == bool.FalseString)
                //{
                //    if (tempbase.ObjectType == IFPIO.ObjectEnum.Struct)
                //    {
                //        skipEmptyReflex = true;
                //    }
                //    else
                //    {
                //        continue;
                //    }
                //}

                // ComboBox for changing types
                ComboBox cbox = new ComboBox();
                cbox.Anchor = AnchorStyles.Right | AnchorStyles.Top;
                cbox.BackColor = Color.LightGray;
                cbox.DropDownStyle = ComboBoxStyle.DropDownList;
                cbox.Width = 95;
                cbox.Items.AddRange(Enum.GetNames(typeof(IFPIO.ObjectEnum)));
                cbox.Items.RemoveAt(0); // Remove reflexive listing
                cbox.SelectionChangeCommitted += fieldTypeChanged; // Remove reflexive listing

                switch (tempbase.ObjectType)
                {
                    case IFPIO.ObjectEnum.Struct:
                        {
                            if (MetaEditor.ShowReflexives == false)
                            {
                                continue;
                            }

                            Label tempLabel1 = new Label();
                            tempLabel1.AutoSize = true;
                            tempLabel1.Location = new Point(0, 0);
                            tempLabel1.Name = "label1";
                            tempLabel1.Dock = DockStyle.Top;
                            tempLabel1.Size = new Size(35, 13);
                            tempLabel1.TabIndex = 1;
                            ReflexiveControl tempReflexive = new ReflexiveControl(
                                map, translatedOffset, ((IFPIO.Reflexive)tempbase).HasCount, tempbase.lineNumber);
                            tempReflexive.Name = "reflexive";
                            tempReflexive.LoadENTControls(
                                (IFPIO.Reflexive)tempbase,
                                ((IFPIO.Reflexive)tempbase).items,
                                true,
                                layer + 1,
                                ref tabIndex,
                                customPluginPath + "\\" + tempbase.offset);

                            // Label, Combobox & Button are always added ( = 3)
                            if (!(tempReflexive.Controls.Count <= 2 && skipEmptyReflex))
                            {
                                bottomPanel.Controls.Add(tempLabel1);
                                tempLabel1.BringToFront();
                                bottomPanel.Controls.Add(tempReflexive);
                                tempReflexive.BringToFront();
                            }

                            break;
                        }

                    case IFPIO.ObjectEnum.Block:
                        {
                            if (MetaEditor.ShowIdents == false)
                            {
                                continue;
                            }

                            TagBlock tempBlock = new TagBlock(
                                tempbase.name, map, tempbase.offset, tempbase.lineNumber);
                            tempBlock.Name = "tagblock";
                            tempBlock.Controls[1].ContextMenuStrip = identContext;
                            bottomPanel.Controls.Add(tempBlock);
                            bottomPanel.Controls[bottomPanel.Controls.Count - 1].BringToFront();
                            break;
                        }

                    case IFPIO.ObjectEnum.Ident:
                        {
                            if (MetaEditor.ShowIdents == false)
                            {
                                continue;
                            }

                            Ident tempident = new Ident(
                                tempbase.name,
                                map,
                                tempbase.offset,
                                ((IFPIO.Ident)tempbase).hasTagType,
                                tempbase.lineNumber);
                            tempident.Name = "ident";
                            tempident.Controls[1].ContextMenuStrip = identContext;
                            tempident.Controls[2].ContextMenuStrip = identContext;
                            bottomPanel.Controls.Add(tempident);
                            bottomPanel.Controls[bottomPanel.Controls.Count - 1].BringToFront();
                            break;
                        }

                    case IFPIO.ObjectEnum.StringID:
                        {
                            if (MetaEditor.ShowSIDs == false)
                            {
                                continue;
                            }

                            SID tempSID = new SID(tempbase.name, map, tempbase.offset, tempbase.lineNumber);
                            tempSID.Name = "sid";
                            bottomPanel.Controls.Add(tempSID);
                            bottomPanel.Controls[bottomPanel.Controls.Count - 1].BringToFront();
                            break;
                        }

                    case IFPIO.ObjectEnum.Float:
                        {
                            if (MetaEditor.ShowFloats == false)
                            {
                                continue;
                            }

                            DataValues tempFloat = new DataValues(
                                tempbase.name, map, tempbase.offset, IFPIO.ObjectEnum.Float, tempbase.lineNumber);

                            // Float tempFloat = new Float(tempbase.name, map, tempbase.offset);
                            tempFloat.Name = "float";
                            bottomPanel.Controls.Add(tempFloat);
                            bottomPanel.Controls[bottomPanel.Controls.Count - 1].BringToFront();
                            break;
                        }

                    case IFPIO.ObjectEnum.String32:
                        {
                            if (MetaEditor.ShowString32s == false && tempbase.ObjectType == IFPIO.ObjectEnum.String32)
                            {
                                continue;
                            }

                            EntStrings tempstring = new EntStrings(
                                tempbase.name,
                                map,
                                tempbase.offset,
                                ((IFPIO.IFPString)tempbase).size,
                                ((IFPIO.IFPString)tempbase).type,
                                tempbase.lineNumber);
                            tempstring.Name = "string";
                            tempstring.TabIndex = tabIndex;
                            bottomPanel.Controls.Add(tempstring);
                            bottomPanel.Controls[bottomPanel.Controls.Count - 1].BringToFront();
                            break;
                        }

                    case IFPIO.ObjectEnum.UnicodeString256:
                        {
                            if (MetaEditor.ShowUnicodeString256s == false)
                            {
                                continue;
                            }

                            goto case IFPIO.ObjectEnum.String32;
                        }

                    case IFPIO.ObjectEnum.UnicodeString64:
                        {
                            if (MetaEditor.ShowUnicodeString64s == false)
                            {
                                continue;
                            }

                            goto case IFPIO.ObjectEnum.String32;
                        }

                    case IFPIO.ObjectEnum.String256:
                        {
                            if (MetaEditor.ShowString256s == false)
                            {
                                continue;
                            }

                            goto case IFPIO.ObjectEnum.String32;
                        }

                    case IFPIO.ObjectEnum.String:
                        {
                            if (MetaEditor.ShowString32s == false && tempbase.ObjectType == IFPIO.ObjectEnum.String)
                            {
                                continue;
                            }

                            goto case IFPIO.ObjectEnum.String32;
                        }

                    case IFPIO.ObjectEnum.Int:
                        {
                            if (((IFPIO.IFPInt)tempbase).entIndex.nulled)
                            {
                                if ((MetaEditor.ShowInts == false && tempbase.ObjectType == IFPIO.ObjectEnum.Int) ||
                                    (MetaEditor.ShowShorts == false && tempbase.ObjectType == IFPIO.ObjectEnum.Short) ||
                                    (MetaEditor.ShowUshorts == false && tempbase.ObjectType == IFPIO.ObjectEnum.UShort) ||
                                    (MetaEditor.ShowUints == false && tempbase.ObjectType == IFPIO.ObjectEnum.UInt))
                                {
                                    continue;
                                }

                                DataValues tempdatavalues = new DataValues(
                                    tempbase.name, map, tempbase.offset, tempbase.ObjectType, tempbase.lineNumber);
                                bottomPanel.Controls.Add(tempdatavalues);
                                bottomPanel.Controls[bottomPanel.Controls.Count - 1].BringToFront();
                            }
                            else
                            {
                                if ((MetaEditor.ShowBlockIndex32s == false &&
                                     (tempbase.ObjectType == IFPIO.ObjectEnum.Int |
                                      tempbase.ObjectType == IFPIO.ObjectEnum.UInt)) ||
                                    (MetaEditor.ShowBlockIndex16s == false &&
                                     (tempbase.ObjectType == IFPIO.ObjectEnum.Short |
                                      tempbase.ObjectType == IFPIO.ObjectEnum.UShort)) ||
                                    (MetaEditor.ShowBlockIndex8s == false &&
                                     tempbase.ObjectType == IFPIO.ObjectEnum.Byte))
                                {
                                    continue;
                                }

                                Indices tempdatavalues = new Indices(
                                    tempbase.name,
                                    map,
                                    tempbase.offset,
                                    tempbase.ObjectType,
                                    ((IFPIO.IFPInt)tempbase).entIndex);
                                bottomPanel.Controls.Add(tempdatavalues);
                                bottomPanel.Controls[bottomPanel.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 (MetaEditor.ShowUndefineds == false)
                            {
                                continue;
                            }

                            DataValues tempUndefined = new DataValues(
                                tempbase.name, map, tempbase.offset, IFPIO.ObjectEnum.Unknown, tempbase.lineNumber);

                            // Float tempFloat = new Float(tempbase.name, map, tempbase.offset);
                            tempUndefined.Name = "tempUndefined";
                            bottomPanel.Controls.Add(tempUndefined);
                            bottomPanel.Controls[bottomPanel.Controls.Count - 1].BringToFront();
                            break;
                        }

                    case IFPIO.ObjectEnum.Byte_Flags:
                        {
                            if (MetaEditor.ShowBitmask8s == false && ((IFPIO.Bitmask)tempbase).bitmaskSize == 8)
                            {
                                continue;
                            }

                            Bitmask tempbitmask = new Bitmask(
                                tempbase.name,
                                map,
                                tempbase.offset,
                                ((IFPIO.Bitmask)tempbase).bitmaskSize,
                                ((IFPIO.Bitmask)tempbase).options,
                                tempbase.lineNumber);
                            bottomPanel.Controls.Add(tempbitmask);
                            bottomPanel.Controls[bottomPanel.Controls.Count - 1].BringToFront();
                            break;
                        }

                    case IFPIO.ObjectEnum.Word_Flags:
                        {
                            if (MetaEditor.ShowBitmask16s == false && ((IFPIO.Bitmask)tempbase).bitmaskSize == 16)
                            {
                                continue;
                            }

                            Bitmask tempbitmask = new Bitmask(
                                tempbase.name,
                                map,
                                tempbase.offset,
                                ((IFPIO.Bitmask)tempbase).bitmaskSize,
                                ((IFPIO.Bitmask)tempbase).options,
                                tempbase.lineNumber);
                            bottomPanel.Controls.Add(tempbitmask);
                            bottomPanel.Controls[bottomPanel.Controls.Count - 1].BringToFront();
                            break;
                        }

                    case IFPIO.ObjectEnum.Long_Flags:
                        {
                            if (MetaEditor.ShowBitmask32s == false && ((IFPIO.Bitmask)tempbase).bitmaskSize == 32)
                            {
                                continue;
                            }

                            Bitmask tempbitmask = new Bitmask(
                                tempbase.name,
                                map,
                                tempbase.offset,
                                ((IFPIO.Bitmask)tempbase).bitmaskSize,
                                ((IFPIO.Bitmask)tempbase).options,
                                tempbase.lineNumber);
                            bottomPanel.Controls.Add(tempbitmask);
                            bottomPanel.Controls[bottomPanel.Controls.Count - 1].BringToFront();
                            break;
                        }

                    case IFPIO.ObjectEnum.Byte:
                        {
                            if (((IFPIO.IFPByte)tempbase).entIndex.nulled)
                            {
                                if (MetaEditor.ShowBytes == false)
                                {
                                    continue;
                                }

                                DataValues tempByte = new DataValues(
                                    tempbase.name, map, tempbase.offset, IFPIO.ObjectEnum.Byte, tempbase.lineNumber);
                                bottomPanel.Controls.Add(tempByte);
                                bottomPanel.Controls[bottomPanel.Controls.Count - 1].BringToFront();
                            }
                            else
                            {
                                if (MetaEditor.ShowBlockIndex8s == false)
                                {
                                    continue;
                                }

                                Indices tempdatavalues = new Indices(
                                    tempbase.name,
                                    map,
                                    tempbase.offset,
                                    tempbase.ObjectType,
                                    ((IFPIO.IFPByte)tempbase).entIndex);
                                bottomPanel.Controls.Add(tempdatavalues);
                                bottomPanel.Controls[bottomPanel.Controls.Count - 1].BringToFront();
                            }

                            break;
                        }

                    case IFPIO.ObjectEnum.Char_Enum:
                        {
                            if (MetaEditor.ShowEnum8s == false)
                            {
                                continue;
                            }

                            Enums tempenum = new Enums(
                                tempbase.name,
                                map,
                                tempbase.offset,
                                ((IFPIO.IFPEnum)tempbase).enumSize,
                                ((IFPIO.IFPEnum)tempbase).options,
                                tempbase.lineNumber);
                            bottomPanel.Controls.Add(tempenum);
                            bottomPanel.Controls[bottomPanel.Controls.Count - 1].BringToFront();
                            break;
                        }

                    case IFPIO.ObjectEnum.Enum:
                        {
                            if (MetaEditor.ShowEnum16s == false)
                            {
                                continue;
                            }

                            Enums tempenum = new Enums(
                                tempbase.name,
                                map,
                                tempbase.offset,
                                ((IFPIO.IFPEnum)tempbase).enumSize,
                                ((IFPIO.IFPEnum)tempbase).options,
                                tempbase.lineNumber);
                            bottomPanel.Controls.Add(tempenum);
                            bottomPanel.Controls[bottomPanel.Controls.Count - 1].BringToFront();
                            break;
                        }

                    case IFPIO.ObjectEnum.Long_Enum:
                        {
                            if (MetaEditor.ShowEnum32s == false)
                            {
                                continue;
                            }

                            Enums tempenum = new Enums(
                                tempbase.name,
                                map,
                                tempbase.offset,
                                ((IFPIO.IFPEnum)tempbase).enumSize,
                                ((IFPIO.IFPEnum)tempbase).options,
                                tempbase.lineNumber);
                            bottomPanel.Controls.Add(tempenum);
                            bottomPanel.Controls[bottomPanel.Controls.Count - 1].BringToFront();
                            break;
                        }

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

                    case IFPIO.ObjectEnum.TagType:
                        continue;
                }

                if (!(tempbase is IFPIO.Reflexive))
                {
                    bottomPanel.Controls[0].ContextMenuStrip = identContext;
                    bottomPanel.Controls[0].Controls[1].ContextMenuStrip = identContext;
                    ToolTip1.SetToolTip(
                        this.bottomPanel.Controls[0].Controls[0], "offset: " + customPluginPath + "\\" + tempbase.offset);

                    // cbox.Location = new Point(this.bottomPanel.Controls[0].Width - 100, 4);
                    // cbox.SelectedIndex = cbox.Items.IndexOf(tempbase.ObjectType.ToString());
                    // this.bottomPanel.Controls[0].Controls.RemoveAt(this.bottomPanel.Controls[0].Controls.Count - 1);
                    this.bottomPanel.Controls[0].Controls[this.bottomPanel.Controls[0].Controls.Count - 1].Click +=
                        fieldTypeChanged;

                    // this.bottomPanel.Controls[0].Controls.Add(cbox);
                }

                if (bottomPanel.Controls.Count > 0 && bottomPanel.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)bottomPanel.Controls[0];
                        colorSpaceCount = 0;
                    }

                        // if (tempbase.name.ToLower().Contains(" r") & redControl == null)
                    else if (ColorWheel.checkForColor(tempbase.name, redControl, " r", "red"))
                    {
                        redControl = (DataValues)bottomPanel.Controls[0];
                        colorSpaceCount = 0;
                    }

                        // if (tempbase.name.ToLower().Contains(" g") & greenControl == null)
                    else if (ColorWheel.checkForColor(tempbase.name, greenControl, " g", "green"))
                    {
                        greenControl = (DataValues)bottomPanel.Controls[0];
                        colorSpaceCount = 0;
                    }

                        // if (tempbase.name.ToLower().Contains(" b") & blueControl == null)
                    else if (ColorWheel.checkForColor(tempbase.name, blueControl, " b", "blue"))
                    {
                        blueControl = (DataValues)bottomPanel.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;
                        bottomPanel.Controls.Add(cw);
                        bottomPanel.Controls[bottomPanel.Controls.Count - 1].BringToFront();

                        // Reset for next batch
                        colorSpaceCount++;
                        alphaControl = null;
                        redControl = null;
                        greenControl = null;
                        blueControl = null;
                    }
                }
                else
                {
                    colorSpaceCount++;
                }
            }

            // used for customPlugin variables
            this.Size = this.PreferredSize;
            this.AutoScroll = false;
            this.AutoSize = false;
        }