public static string GetProps(int pos_item) { string line = ""; try { for (int k = 0; k < TaskEditor.eLC.Lists[124].elementFields.Length; k++) { if (TaskEditor.eLC.Lists[124].elementFields[k] == "require_level") { string require_level = TaskEditor.eLC.GetValue(124, pos_item, k); if (require_level != "0") { line += "\n" + String.Format(Extensions.GetLocalization(7018), require_level); } break; } } for (int k = 0; k < TaskEditor.eLC.Lists[124].elementFields.Length; k++) { if (TaskEditor.eLC.Lists[124].elementFields[k] == "price") { string price = TaskEditor.eLC.GetValue(124, pos_item, k); if (price != "0") { line += "\n" + Extensions.GetLocalization(7024) + " " + Convert.ToInt32(price).ToString("N0", CultureInfo.CreateSpecificCulture("zh-CN")); } break; } } for (int k = 0; k < TaskEditor.eLC.Lists[124].elementFields.Length; k++) { if (TaskEditor.eLC.Lists[124].elementFields[k] == "num_area") { string num_area = TaskEditor.eLC.GetValue(124, pos_item, k); if (Convert.ToInt32(num_area) > 0) { for (int t = 0; t < TaskEditor.eLC.Lists[124].elementFields.Length; t++) { if (TaskEditor.eLC.Lists[124].elementFields[t] == "area_id_1") { line += "\n" + Extensions.GetLocalization(7083); for (int a = 0; a < Convert.ToInt32(num_area) && a < 10; a++) { line += " " + Extensions.InstanceName(Convert.ToInt32(TaskEditor.eLC.GetValue(124, pos_item, t + a))).name.Replace("\r\n", " "); } break; } } } break; } } for (int k = 0; k < TaskEditor.eLC.Lists[124].elementFields.Length; k++) { if (TaskEditor.eLC.Lists[124].elementFields[k] == "num_use_pertime") { string num_use_pertime = TaskEditor.eLC.GetValue(124, pos_item, k); if (num_use_pertime != "0") { line += "\n" + String.Format(Extensions.GetLocalization(7084), num_use_pertime); } break; } } for (int k = 0; k < TaskEditor.eLC.Lists[124].elementFields.Length; k++) { if (TaskEditor.eLC.Lists[124].elementFields[k] == "id_skill") { line += "\n" + Extensions.SkillDesc(Convert.ToInt32(TaskEditor.eLC.GetValue(124, pos_item, k))); break; } } for (int k = 0; k < TaskEditor.eLC.Lists[124].elementFields.Length; k++) { if (TaskEditor.eLC.Lists[124].elementFields[k] == "use_in_combat") { string use_in_combat = TaskEditor.eLC.GetValue(124, pos_item, k); if (use_in_combat == "0") { line += "\n" + Extensions.GetLocalization(7085); } break; } } for (int k = 0; k < TaskEditor.eLC.Lists[124].elementFields.Length; k++) { if (TaskEditor.eLC.Lists[124].elementFields[k] == "use_in_sanctuary_only") { string use_in_sanctuary_only = TaskEditor.eLC.GetValue(124, pos_item, k); if (use_in_sanctuary_only != "0") { line += "\n" + Extensions.GetLocalization(7086); } break; } } } catch { line = ""; } return(line); }
private void dataGridView_Items_SelectionChanged(object sender, EventArgs e) { uint proctypes; int l = 3; int selectedindex = this.comboBox_ItemsLists.SelectedIndex; l = Convert.ToInt32(ElementsEditor.database.task_items_list[selectedindex * 2]); int k = this.dataGridView_Items.CurrentCell.RowIndex - 1; if (k >= 0) { if (l != TaskEditor.eLC.ConversationListIndex && Loced == false) { string line = ""; int pos = -1; for (int i = 0; i < TaskEditor.eLC.Lists[l].elementFields.Length; i++) { if (TaskEditor.eLC.Lists[l].elementFields[i] == "proc_type") { pos = i; break; } } if (TaskEditor.eLC.Lists[l].elementFields[0] == "ID") { bool result = uint.TryParse(TaskEditor.eLC.GetValue(l, k, pos), out proctypes); List <uint> powers = new List <uint>(GetPowers(proctypes)); for (int p = 0; p < powers.Count; p++) { if (powers[p] == 0) { continue; } switch (p) { case 6: line += Extensions.GetLocalization(3006) + "\n\n"; //proc_type_64 break; case 15: line += Extensions.GetLocalization(3015); //proc_type_32768 break; } } for (int p = 0; p < powers.Count; p++) { if (powers[p] == 0) { continue; } switch (p) { case 13: line += Extensions.GetLocalization(3013); //proc_type_8192 break; } } if (l == 124) { for (int i = 0; i < TaskEditor.eLC.Lists[l].elementFields.Length; i++) { if (TaskEditor.eLC.Lists[l].elementFields[i] == "id_skill") { line += Extensions.SkillDesc(Convert.ToInt32(TaskEditor.eLC.GetValue(l, k, i))) + "\n\n"; break; } } } for (int p = 0; p < powers.Count; p++) { if (powers[p] == 0) { continue; } switch (p) { case 0: line += Extensions.GetLocalization(3000); //proc_type_1 break; case 1: line += Extensions.GetLocalization(3001); //proc_type_2 break; case 2: line += Extensions.GetLocalization(3002); //proc_type_4 break; case 3: line += Extensions.GetLocalization(3003); //proc_type_8 break; case 4: line += Extensions.GetLocalization(3004); //proc_type_16 break; case 5: line += Extensions.GetLocalization(3005); //proc_type_32 break; case 7: line += Extensions.GetLocalization(3007); //proc_type_128 break; case 8: line += Extensions.GetLocalization(3008); //proc_type_256 break; case 9: line += Extensions.GetLocalization(3009); //proc_type_512 break; case 10: line += Extensions.GetLocalization(3010); //proc_type_1024 break; case 11: line += Extensions.GetLocalization(3011); //proc_type_2048 break; case 12: line += Extensions.GetLocalization(3012); //proc_type_4096 break; case 14: line += Extensions.GetLocalization(3014); //proc_type_16384 break; } } line += Extensions.ItemDesc(Convert.ToInt32(this.dataGridView_Items.Rows[k + 1].Cells[0].Value)); string[] blocks = line.Split(new char[] { '^' }); if (blocks.Length > 1) { int le1 = 0; this.richTextBox_Desc.Text = ""; le1 = (line.IndexOf('^', 0)); this.richTextBox_Desc.AppendText(string.Format(line.Substring(0, le1))); this.richTextBox_Desc.Select(0, le1); this.richTextBox_Desc.SelectionColor = Color.White; /*string result = ""; * * if (blocks[0] != "") * { * result += blocks[0]; * }*/ int le = 0; int st = 0; Color color = Color.White; for (int i = 1; i < blocks.Length; i++) { if (blocks[i] != "") { st = this.richTextBox_Desc.Text.Length; try { color = Color.FromArgb(int.Parse(blocks[i].Substring(0, 6), NumberStyles.HexNumber)); this.richTextBox_Desc.AppendText(string.Format(blocks[i].Substring(6))); } catch { this.richTextBox_Desc.AppendText(string.Format("^" + blocks[i])); } le = this.richTextBox_Desc.Text.Length - st; this.richTextBox_Desc.Select(st, le); this.richTextBox_Desc.SelectionColor = color; } } } else { this.richTextBox_Desc.Text = line; this.richTextBox_Desc.Select(0, this.richTextBox_Desc.Text.Length); this.richTextBox_Desc.SelectionColor = Color.White; } } } } else { this.richTextBox_Desc.Text = ""; } int scroll = this.dataGridView_Props.FirstDisplayedScrollingRowIndex; this.dataGridView_Props.Rows.Clear(); if (k >= 0 && Loced == false) { for (int f = 0; f < TaskEditor.eLC.Lists[l].elementValues[k].Count; f++) { this.dataGridView_Props.Rows.Add(new string[] { TaskEditor.eLC.Lists[l].elementFields[f], TaskEditor.eLC.GetValue(l, k, f) }); } } if (scroll > -1 && k > -1) { this.dataGridView_Props.FirstDisplayedScrollingRowIndex = scroll; } }
private void dataGridView_Skills_SelectionChanged(object sender, EventArgs e) { if (loaded == true) { int index = this.dataGridView_Skills.CurrentCell.RowIndex; int id = Convert.ToInt32(this.dataGridView_Skills.Rows[index].Cells[0].Value); if (id != 0) { string line = Extensions.SkillDesc(id); string[] blocks = line.Split(new char[] { '^' }); if (blocks.Length > 1) { int le1 = 0; this.richTextBox_SkillDesc.Text = ""; le1 = (line.IndexOf('^', 0)); this.richTextBox_SkillDesc.AppendText(string.Format(line.Substring(0, le1))); this.richTextBox_SkillDesc.Select(0, le1); this.richTextBox_SkillDesc.SelectionColor = Color.White; string result = ""; if (blocks[0] != "") { result += blocks[0]; } int le = 0; int st = 0; Color color = Color.White; for (int i = 1; i < blocks.Length; i++) { if (blocks[i] != "") { st = this.richTextBox_SkillDesc.Text.Length; try { color = Color.FromArgb(int.Parse(blocks[i].Substring(0, 6), NumberStyles.HexNumber)); this.richTextBox_SkillDesc.AppendText(string.Format(blocks[i].Substring(6))); } catch { this.richTextBox_SkillDesc.AppendText(string.Format("^" + blocks[i])); } le = this.richTextBox_SkillDesc.Text.Length - st; this.richTextBox_SkillDesc.Select(st, le); this.richTextBox_SkillDesc.SelectionColor = color; } } } else { this.richTextBox_SkillDesc.Text = line; this.richTextBox_SkillDesc.Select(0, this.richTextBox_SkillDesc.Text.Length); this.richTextBox_SkillDesc.SelectionColor = Color.White; } } else { this.richTextBox_SkillDesc.Text = Extensions.GetLocalization(402); this.richTextBox_SkillDesc.Select(0, this.richTextBox_SkillDesc.Text.Length); this.richTextBox_SkillDesc.SelectionColor = Color.White; } } }