Esempio n. 1
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);
            }
        }
Esempio n. 2
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;
        }