private void saveToolStripMenuItem_Click(object sender, EventArgs e) { using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Write)) { using (bbwriter bigbw = new bbwriter(fs)) { bigbw.Write(paramNum); paramFuncs.writeParam(bigbw, parameterVal); } } }
public static void writeParam(bbwriter bbw, List<Parameter> prm) { for (int i = 0; i < prm.Count; i++) { bbw.Write(prm[i].hash); bbw.BaseStream.WriteByte(0); bbw.Write(prm[i].name); bbw.Write(prm[i].valueLength); switch (prm[i].valueLength) { case 4: switch (prm[i].flag) { case valueType.dub: bbw.Write((Single)prm[i].dubValue); break; case valueType.integer: bbw.Write(prm[i].intValue); break; case valueType.unk: bbw.Write(prm[i].fourVal); break; case valueType.color: bbw.WriteRgba(prm[i].colorVal); break; } break; case 1: bbw.Write((byte)prm[i].intValue); break; case 2: bbw.Write((short)prm[i].intValue); break; case 12: bbw.writeVector(prm[i].vec); break; default: break; } } }
private void saveAsTSM_Click(object sender, EventArgs e) { saveParam.DefaultExt = ".prm"; saveParam.ShowDialog(); if (saveParam.FileName != "") { using (FileStream fs = new FileStream(saveParam.FileName, FileMode.OpenOrCreate)) { using (bbwriter bigbw = new bbwriter(fs)) { bigbw.Write(paramNum); paramFuncs.writeParam(bigbw, parameterVal); } } } }