private void tv3_AfterSelect(object sender, TreeViewEventArgs e) { TreeNode t = tv3.SelectedNode; if (t == null) { return; } BF2HUDElement result = null; foreach (BF2HUDElement el in BF2HUDLoader.elements) { if (el.name == t.Name) { result = el; break; } } if (result == null) { return; } StringBuilder sb = new StringBuilder(); foreach (string p in result.parameter) { sb.AppendLine(p); } rtb2.Text = sb.ToString(); }
public static void ProcessLine(string s, int line) { string tmp = s.ToLower(); if (tmp.StartsWith("hudbuilder.create")) { if (current != null) { BF2HUDLoader.elements.Add(current); } tmp = s.Replace("\t", " "); while (tmp.Contains(" ")) { tmp = tmp.Replace(" ", " "); } string[] parts = tmp.Split(' '); string name = parts[2].Trim(); string parentname = parts[1].Trim(); BF2HUDElement parent = null; foreach (BF2HUDElement e in BF2HUDLoader.elements) { if (e.name == parentname) { parent = e; break; } } if (parent == null) { Log.WriteLine("[BF2 HB] ERROR line " + line + " : cannot find parent \"" + parentname + "\"!"); current = null; return; } current = new BF2HUDElement(name, parent); current.parameter.Add(s.Substring(11)); } else if (current != null) { current.parameter.Add(s.Substring(11)); } }
public BF2HUDElement(string _name, BF2HUDElement _parent) { name = _name; parent = _parent; parameter = new List <string>(); }