public List <ElementTable> CreateElTable(eListCollection e) { List <ElementTable> etl = new List <ElementTable>(); for (int a = 0; a < e.Lists.Length; ++a) { for (int b = 0; b < e.Lists[a].elementValues.Length; ++b) { ElementTable et = new ElementTable(); et.list = e.Lists[a].listName; if (e.Lists[a].elementFields[0] == "ID") { et.id = Convert.ToInt32(e.GetValue(a, b, 0)); } et.f = new List <Fields>(); for (int c = 0; c < e.Lists[a].elementFields.Length; ++c) { if (e.Lists[a].elementTypes[c].Contains("string")) { Fields f = new Fields() { field = e.Lists[a].elementFields[c], value = e.GetValue(a, b, c) }; if (!f.value.Contains(".dds") && !f.value.Contains(".ecm")) { et.f.Add(f); } } } etl.Add(et); } } return(etl); }
public void Import(object filename) { dst = ed.LoadElements((string)filename); ProgressStatus.Maximum = dst.Lists.Length; int a, b, c, d; for (a = 0; a < dst.Lists.Length; ++a) { if (a == dst.ConversationListIndex) { dst.Lists[a] = src.Lists[a]; } for (c = 0; c < etl.Count; ++c) { if (dst.Lists[a].listName == etl[c].list) { for (b = 0; b < dst.Lists[a].elementValues.Length; ++b) { if (dst.Lists[a].elementFields[0] == "ID") { if (Convert.ToInt32(dst.GetValue(a, b, 0)) == etl[c].id) { for (d = 0; d < dst.Lists[a].elementFields.Length; ++d) { foreach (Fields f in etl[c].f) { if (dst.Lists[a].elementFields[d].IndexOf(f.field) > -1) { dst.SetValue(a, b, d, f.value); //debugBox.Text += "ID: " + dst.GetValue(a, b, 0) + " => " + f.value + "\n"; } } } } } } } } ProgressStatus.Value++; } dst.Save((string)filename); ProgressStatus.Value = 0; debugBox.Text += "Русификация Elements.data успешно завершена\n"; }
private void ListBox_items_SelectionChanged(object sender, EventArgs e) { if (Blocked) { return; } int list = list_id; try { int element = listBox_items.CurrentCell.RowIndex; Application.DoEvents(); int pos = eLC.Lists[list].elementPosition[element]; textBox5.Text = pos.ToString("X4").ToUpper(); dataGridView_item.Rows.Clear(); for (int f = 0; f < eLC.Lists[list].elementValues[element].Count; f++) { dataGridView_item.Rows.Add(new object[] { f.ToString(), eLC.Lists[list].elementFields[f].Replace('_', ' '), eLC.GetValue(list, element, f) }); } }catch { } Progress_bar("Done", 0, 0); }