Ejemplo n.º 1
0
        public AampEditorBase(AAMP aamp, bool IsSaveDialog)
        {
            InitializeComponent();

            treeView1.BackColor       = FormThemes.BaseTheme.FormBackColor;
            treeView1.ForeColor       = FormThemes.BaseTheme.FormForeColor;
            stTabControl1.myBackColor = FormThemes.BaseTheme.FormBackColor;

            AampFile = aamp;
            Text     = $"{AampFile.FileName} Type [{AampFile.aampFile.EffectType}]";

            STContextMenuStrip contextMenuStrip1 = new STContextMenuStrip();

            contextMenuStrip1.Items.Add(new ToolStripMenuItem("Save", null, saveAsToolStripMenuItem_Click, Keys.Control | Keys.I));
            contextMenuStrip1.Items.Add(new ToolStripSeparator());
            contextMenuStrip1.Items.Add(new ToolStripMenuItem("Export as Yaml", null, ToYamlAction, Keys.Control | Keys.A));
            contextMenuStrip1.Items.Add(new ToolStripMenuItem("Open as Yaml", null, OpenYamlEditorAction, Keys.Control | Keys.A));

            this.treeView1.ContextMenuStrip = contextMenuStrip1;

            textEditor      = new TextEditor();
            textEditor.Dock = DockStyle.Fill;
            textEditor.ClearContextMenus(new string[] { "Search" });
            textEditor.AddContextMenu("Decompile", TextEditorToYaml);
            textEditor.AddContextMenu("Compile", TextEditorFromYaml);
            stPanel2.Controls.Add(textEditor);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 public void LoadLayout(BFLYT bflyt)
 {
     activeLayout = bflyt;
     editor.AddContextMenu("Convert to BFLYT", TextCompiled);
     editor.FillEditor(bflyt.ConvertToString());
 }