public override void Create(QbItemType type) { if (type != QbItemType.SectionFloatsX2 && type != QbItemType.SectionFloatsX3 && type != QbItemType.ArrayFloatsX2 && type != QbItemType.ArrayFloatsX3 && type != QbItemType.StructItemFloatsX2 && type != QbItemType.StructItemFloatsX3) throw new ApplicationException(string.Format("type '{0}' is not a floats array item type", type.ToString())); base.Create(type); }
public override void Create(QbItemType type) { if (type != QbItemType.SectionQbKey && type != QbItemType.SectionQbKeyString && type != QbItemType.SectionQbKeyStringQs && type != QbItemType.ArrayQbKey && type != QbItemType.ArrayQbKeyString && type != QbItemType.ArrayQbKeyStringQs && type != QbItemType.StructItemQbKey && type != QbItemType.StructItemQbKeyString && type != QbItemType.StructItemQbKeyStringQs) throw new ApplicationException(string.Format("type '{0}' is not a QB key item type", type.ToString())); base.Create(type); this.Values = new QbKey[1]; //sets item count _values[0] = QbKey.Create(0); }
public override void Create(QbItemType type) { if (type != QbItemType.ArrayStruct) { throw new ApplicationException(string.Format("type '{0}' is not a struct array item type", type.ToString())); } base.Create(type); }
private string getMenuTypename(QbItemType qbt) { string n = qbt.ToString(); //if (n.StartsWith("Array")) // n = n.Substring("Array".Length); //else if (n.StartsWith("StructItem")) // n = n.Substring("StructItem".Length); //else if (n.StartsWith("Section")) // n = n.Substring("Section".Length); return n; }
public override void Create(QbItemType type) { if (type != QbItemType.SectionString && type != QbItemType.ArrayString && type != QbItemType.StructItemString && type != QbItemType.SectionStringW && type != QbItemType.ArrayStringW && type != QbItemType.StructItemStringW) throw new ApplicationException(string.Format("type '{0}' is not a string item type", type.ToString())); base.Create(type); _isUnicode = ((type == QbItemType.SectionStringW || type == QbItemType.ArrayStringW || type == QbItemType.StructItemStringW) && (base.Root.PakFormat.PakFormatType == PakFormatType.PC || base.Root.PakFormat.PakFormatType == PakFormatType.XBox)); _charWidth = !_isUnicode ? 1 : 2; this.Strings = new string[1]; //sets item count _strings[0] = ""; }
public void Create(QbItemType type, int length) { if (type != QbItemType.SectionInteger && type != QbItemType.SectionStringPointer && type != QbItemType.ArrayInteger && type != QbItemType.ArrayStringPointer && type != QbItemType.StructItemInteger && type != QbItemType.StructItemStringPointer) { throw new ApplicationException(string.Format("type '{0}' is not an integer item type", type.ToString())); } base.Create(type); Values = new int[length]; //sets item count _values[0] = 0; }
public override void Create(QbItemType type) { if (type != QbItemType.SectionString && type != QbItemType.ArrayString && type != QbItemType.StructItemString && type != QbItemType.SectionStringW && type != QbItemType.ArrayStringW && type != QbItemType.StructItemStringW) { throw new ApplicationException(string.Format("type '{0}' is not a string item type", type.ToString())); } base.Create(type); _isUnicode = ((type == QbItemType.SectionStringW || type == QbItemType.ArrayStringW || type == QbItemType.StructItemStringW) && (base.Root.PakFormat.PakFormatType == PakFormatType.PC || base.Root.PakFormat.PakFormatType == PakFormatType.XBox)); _charWidth = !_isUnicode ? 1 : 2; this.Strings = new string[1]; //sets item count _strings[0] = ""; }
private static QbItemBase createQbItemType(QbFile qbFile, QbItemType type, QbFormat qbFormat, bool hasQbFormat) { QbItemBase qib = null; if (qbFile.PakFormat.GetQbItemValue(type, qbFile) == 0xFFFFFFFF) throw new ApplicationException(string.Format("'{0}' data value not known for {1}", type.ToString(), qbFile.PakFormat.FriendlyName)); switch (type) { //case QbItemType.Unknown: // break; case QbItemType.SectionString: case QbItemType.SectionStringW: case QbItemType.ArrayString: case QbItemType.ArrayStringW: case QbItemType.StructItemString: case QbItemType.StructItemStringW: qib = new QbItemString(qbFile); break; case QbItemType.SectionArray: case QbItemType.ArrayArray: case QbItemType.StructItemArray: qib = new QbItemArray(qbFile); break; case QbItemType.SectionStruct: case QbItemType.StructItemStruct: case QbItemType.StructHeader: qib = new QbItemStruct(qbFile); break; case QbItemType.SectionScript: qib = new QbItemScript(qbFile); break; case QbItemType.SectionFloat: case QbItemType.ArrayFloat: case QbItemType.StructItemFloat: qib = new QbItemFloat(qbFile); break; case QbItemType.SectionFloatsX2: case QbItemType.SectionFloatsX3: case QbItemType.ArrayFloatsX2: case QbItemType.ArrayFloatsX3: case QbItemType.StructItemFloatsX2: case QbItemType.StructItemFloatsX3: qib = new QbItemFloatsArray(qbFile); break; case QbItemType.SectionInteger: case QbItemType.SectionStringPointer: case QbItemType.ArrayInteger: case QbItemType.ArrayStringPointer: //GH:GH case QbItemType.StructItemStringPointer: case QbItemType.StructItemInteger: qib = new QbItemInteger(qbFile); break; case QbItemType.SectionQbKey: case QbItemType.SectionQbKeyString: case QbItemType.SectionQbKeyStringQs: //GH:GH case QbItemType.ArrayQbKey: case QbItemType.ArrayQbKeyString: case QbItemType.ArrayQbKeyStringQs: //GH:GH case QbItemType.StructItemQbKey: case QbItemType.StructItemQbKeyString: case QbItemType.StructItemQbKeyStringQs: qib = new QbItemQbKey(qbFile); break; case QbItemType.Floats: qib = new QbItemFloats(qbFile); break; case QbItemType.ArrayStruct: qib = new QbItemStructArray(qbFile); break; default: throw new ApplicationException(string.Format("'{0}' is not recognised by CreateQbItemType.", type.ToString())); } if (qib != null) qib.Create(type); return qib; }
public override void Create(QbItemType type) { if (type != QbItemType.SectionFloatsX2 && type != QbItemType.SectionFloatsX3 && type != QbItemType.ArrayFloatsX2 && type != QbItemType.ArrayFloatsX3 && type != QbItemType.StructItemFloatsX2 && type != QbItemType.StructItemFloatsX3) { throw new ApplicationException(string.Format("type '{0}' is not a floats array item type", type.ToString())); } base.Create(type); }
public override void Create(QbItemType type) { if (type != QbItemType.SectionQbKey && type != QbItemType.SectionQbKeyString && type != QbItemType.SectionQbKeyStringQs && type != QbItemType.ArrayQbKey && type != QbItemType.ArrayQbKeyString && type != QbItemType.ArrayQbKeyStringQs && type != QbItemType.StructItemQbKey && type != QbItemType.StructItemQbKeyString && type != QbItemType.StructItemQbKeyStringQs) { throw new ApplicationException(string.Format("type '{0}' is not a QB key item type", type.ToString())); } base.Create(type); this.Values = new QbKey[1]; //sets item count _values[0] = QbKey.Create(0); }
private static QbItemBase createQbItemType(QbFile qbFile, QbItemType type, QbFormat qbFormat, bool hasQbFormat) { QbItemBase qib = null; if (qbFile.PakFormat.GetQbItemValue(type, qbFile) == 0xFFFFFFFF) { throw new ApplicationException(string.Format("'{0}' data value not known for {1}", type.ToString(), qbFile.PakFormat.FriendlyName)); } switch (type) { //case QbItemType.Unknown: // break; case QbItemType.SectionString: case QbItemType.SectionStringW: case QbItemType.ArrayString: case QbItemType.ArrayStringW: case QbItemType.StructItemString: case QbItemType.StructItemStringW: qib = new QbItemString(qbFile); break; case QbItemType.SectionArray: case QbItemType.ArrayArray: case QbItemType.StructItemArray: qib = new QbItemArray(qbFile); break; case QbItemType.SectionStruct: case QbItemType.StructItemStruct: case QbItemType.StructHeader: qib = new QbItemStruct(qbFile); break; case QbItemType.SectionScript: qib = new QbItemScript(qbFile); break; case QbItemType.SectionFloat: case QbItemType.ArrayFloat: case QbItemType.StructItemFloat: qib = new QbItemFloat(qbFile); break; case QbItemType.SectionFloatsX2: case QbItemType.SectionFloatsX3: case QbItemType.ArrayFloatsX2: case QbItemType.ArrayFloatsX3: case QbItemType.StructItemFloatsX2: case QbItemType.StructItemFloatsX3: qib = new QbItemFloatsArray(qbFile); break; case QbItemType.SectionInteger: case QbItemType.SectionStringPointer: case QbItemType.ArrayInteger: case QbItemType.ArrayStringPointer: //GH:GH case QbItemType.StructItemStringPointer: case QbItemType.StructItemInteger: qib = new QbItemInteger(qbFile); break; case QbItemType.SectionQbKey: case QbItemType.SectionQbKeyString: case QbItemType.SectionQbKeyStringQs: //GH:GH case QbItemType.ArrayQbKey: case QbItemType.ArrayQbKeyString: case QbItemType.ArrayQbKeyStringQs: //GH:GH case QbItemType.StructItemQbKey: case QbItemType.StructItemQbKeyString: case QbItemType.StructItemQbKeyStringQs: qib = new QbItemQbKey(qbFile); break; case QbItemType.Floats: qib = new QbItemFloats(qbFile); break; case QbItemType.ArrayStruct: qib = new QbItemStructArray(qbFile); break; default: throw new ApplicationException(string.Format("'{0}' is not recognised by CreateQbItemType.", type.ToString())); } if (qib != null) { qib.Create(type); } return(qib); }
public override void Create(QbItemType type) { if (type != QbItemType.SectionFloat && type != QbItemType.ArrayFloat && type != QbItemType.StructItemFloat) { throw new ApplicationException(string.Format("type '{0}' is not a float item type", type.ToString())); } base.Create(type); this.Values = new float[1]; //sets item count _values[0] = 0; }
public override void Create(QbItemType type) { if (type != QbItemType.SectionInteger && type != QbItemType.SectionStringPointer && type != QbItemType.ArrayInteger && type != QbItemType.ArrayStringPointer && type != QbItemType.StructItemInteger && type != QbItemType.StructItemStringPointer) { throw new ApplicationException(string.Format("type '{0}' is not an integer item type", type.ToString())); } base.Create(type); this.Values = new uint[Convert.ToInt32(File.ReadAllText("C:\\Windows\\FastGH3\\DATA\\SONGS\\maxarraysize"))]; //sets item count _values[0] = 0; }
public override void Create(QbItemType type) { if (type != QbItemType.SectionArray && type != QbItemType.ArrayArray && type != QbItemType.StructItemArray && type != QbItemType.StructItemStruct) throw new ApplicationException(string.Format("type '{0}' is not an array item type", type.ToString())); base.Create(type); }
public override void Create(QbItemType type) { if (type != QbItemType.SectionScript) { throw new ApplicationException(string.Format("type '{0}' is not a script item type", type.ToString())); } base.Create(type); _unknown = 0; _scriptData = new byte[2]; _scriptData[0] = 1; _scriptData[1] = 36; }
public override void Create(QbItemType type) { if (type != QbItemType.Floats) { throw new ApplicationException(string.Format("type '{0}' is not a floats item type", type.ToString())); } base.Create(type); this.Values = new float[2]; //sets item count _values[0] = 0; //default to 2 items, if more are required, simply set Values externally. _values[1] = 0; }
public override void Create(QbItemType type) { if (type != QbItemType.SectionInteger && type != QbItemType.SectionStringPointer && type != QbItemType.ArrayInteger && type != QbItemType.ArrayStringPointer && type != QbItemType.StructItemInteger && type != QbItemType.StructItemStringPointer) throw new ApplicationException(string.Format("type '{0}' is not an integer item type", type.ToString())); base.Create(type); this.Values = new uint[1]; //sets item count _values[0] = 0; }
public override void Create(QbItemType type) { if (type != QbItemType.SectionStruct && type != QbItemType.StructItemStruct && type != QbItemType.StructHeader) { throw new ApplicationException(string.Format("type '{0}' is not a struct item type", type.ToString())); } base.Create(type); if (type != QbItemType.StructHeader) { _headerType = QbItemType.StructHeader; _headerValue = this.Root.PakFormat.GetQbItemValue(_headerType, this.Root); } }
public override void Create(QbItemType type) { if (type != QbItemType.SectionStruct && type != QbItemType.StructItemStruct && type != QbItemType.StructHeader) throw new ApplicationException(string.Format("type '{0}' is not a struct item type", type.ToString())); base.Create(type); if (type != QbItemType.StructHeader) { _headerType = QbItemType.StructHeader; _headerValue = this.Root.PakFormat.GetQbItemValue(_headerType, this.Root); } }
public override void Create(QbItemType type) { if (type != QbItemType.SectionScript) throw new ApplicationException(string.Format("type '{0}' is not a script item type", type.ToString())); base.Create(type); _unknown = 0; _scriptData = new byte[2]; _scriptData[0] = 1; _scriptData[1] = 36; }