private void Save_Click(object sender, EventArgs e) { if (calculatedHashOfNameFld.Text.Length < 5) { MessageBox.Show("Enter file name!"); } else { string fn = calculatedHashOfNameFld.Text.Replace("0x", ""); fn = fn.Substring(2); string langCode = comboBox1.SelectedValue.ToString(); langCode = langCode.Substring(2); fn = langCode + fn; saveFileDialog1.FileName = "S4_220557DA_80000000_" + fn + "_" + stblNameFld.Text + "%%+STBL.stbl"; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { //MessageBox.Show(saveFileDialog1.FileName); if (mainUI.pathOpened) { mainUI.saveSTBL(); mainUI.closeSTBL(); mainUI.SavePackage(); mainUI.closePackage(); } mainUI.publicPath = saveFileDialog1.FileName; mainUI.SaveSTBL_V2(false); mainUI.openSTBLfile(saveFileDialog1.FileName); this.Close(); } } }
private void Save_Click(object sender, EventArgs e) { if (calculatedHashOfNameFld.Text.Length < 5) { MessageBox.Show("Enter file name!"); } else { string lang = comboBox1.SelectedValue.ToString(); if (lang.Equals("Add All Langs At Once")) { DataTable dt = comboBox1.DataSource as DataTable; foreach (DataRow dr in dt.Rows) { string l = dr.ItemArray[0].ToString(); if (!l.Equals("Add All Langs At Once")) { string fn = getStblNameHash(l); UInt64 fnU = Convert.ToUInt64(fn, 16); //ulong a = (ulong)FNVHasherStrFunctions.fnv64HighBit("qqqq"); TGIBlock newnmrk = new TGIBlock(0, null, 0x220557DA, 0x80000000, fnU); Stream s = new MemoryStream(); List <uint> textResourceID = new List <uint>(); List <string> textString = new List <string>(); ArrayList tempList = new ArrayList(); tempList.Add(textResourceID); tempList.Add(textString); mainUI.WriteSTBLStream(tempList, s); var addedResIndexEntry = MainUI.imppkg.AddResource(newnmrk, s, true); } } mainUI.saveSTBL(); mainUI.closeSTBL(); mainUI.SavePackage(); mainUI.closePackage(); } else { string fn = getStblNameHash(lang); UInt64 fnU = Convert.ToUInt64(fn, 16); //ulong a = (ulong)FNVHasherStrFunctions.fnv64HighBit("qqqq"); TGIBlock newnmrk = new TGIBlock(0, null, 0x220557DA, 0x80000000, fnU); Stream s = new MemoryStream(); List <uint> textResourceID = new List <uint>(); List <string> textString = new List <string>(); ArrayList tempList = new ArrayList(); tempList.Add(textResourceID); tempList.Add(textString); mainUI.WriteSTBLStream(tempList, s); var addedResIndexEntry = MainUI.imppkg.AddResource(newnmrk, s, true); MainUI.lrie.Add(addedResIndexEntry); BigInteger bi = BigInteger.Parse(addedResIndexEntry.Instance.ToString()); MainUI.packageElId = bi; ArrayList textResourceID2 = new ArrayList(); ArrayList textString2 = new ArrayList(); tempList = new ArrayList(); tempList.Add(textResourceID2); tempList.Add(textString2); mainUI.STBLToDataGridView(tempList); MainUI.imppkg.SavePackage(); MainUI.imppkg.Dispose(); mainUI.openPackageFile(MainUI.pathToOpenedPackageFile); } MessageBox.Show("Successfully done!"); } }