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; }
/// <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); }
/// <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; }
/// <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); } }
/// <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); }
/// <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; }
/// <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); } }
/// <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; }
/// <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; }