public ByamlEditor(System.Collections.IEnumerable by, bool _pathSupport, ushort _ver, ByteOrder defaultOrder = ByteOrder.LittleEndian, bool IsSaveDialog = false, BYAML byaml = null) { InitializeComponent(); treeView1.BackColor = FormThemes.BaseTheme.FormBackColor; treeView1.ForeColor = FormThemes.BaseTheme.FormForeColor; if (byaml.FileName == "course_muunt_debug.byaml" && useMuunt) { pathSupport = true; stPanel1.Controls.Remove(splitContainer1); TurboMunntEditor editor = new TurboMunntEditor(); editor.Dock = DockStyle.Fill; editor.LoadCourseInfo(by, byaml.FilePath); stPanel1.Controls.Add(editor); return; } byteOrder = defaultOrder; FileName = byaml.FileName; byml = by; pathSupport = _pathSupport; bymlVer = _ver; if (byml == null) { return; } ParseBymlFirstNode(); }
public void UpdateByaml(System.Collections.IEnumerable by, bool _pathSupport, ushort _ver, ByteOrder defaultOrder = ByteOrder.LittleEndian, bool IsSaveDialog = false, BYAML byaml = null) { FileFormat = byaml; treeView1.Nodes.Clear(); stTabControl1.myBackColor = FormThemes.BaseTheme.FormBackColor; if (byaml.FileName == "course_muunt_debug.byaml" && useMuunt) { pathSupport = true; stPanel1.Controls.Remove(splitContainer1); TurboMunntEditor editor = new TurboMunntEditor(); editor.Dock = DockStyle.Fill; editor.LoadCourseInfo(by, byaml.FilePath); stPanel1.Controls.Add(editor); return; } byteOrder = defaultOrder; FileName = byaml.FileName; byml = by; pathSupport = _pathSupport; bymlVer = _ver; if (byml == null) { return; } ParseBymlFirstNode(); stPanel4.Controls.Clear(); textEditor = new TextEditor(); textEditor.ClearContextMenus(new string[] { "Search" }); textEditor.AddContextMenu("Decompile", TextEditorToYaml); textEditor.AddContextMenu("Compile", TextEditorFromYaml); var formatMenu = new STToolStripItem("Change Formatting"); formatMenu.DropDownItems.Add(xmlOldToolstrip); formatMenu.DropDownItems.Add(xmlToolstrip); formatMenu.DropDownItems.Add(yamlToolstrip); textEditor.AddContextMenu(formatMenu); stPanel4.Controls.Add(textEditor); }