Ejemplo n.º 1
0
        private void LinkSpriteMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                int sind = PartsListBox.SelectedIndex;
                if (sind < 0 || sind >= LoadedResource.Sprites.Count)
                {
                    return;
                }
                var sprites = LoadedResource.Sprites[sind];

                GLSurface.MakeCurrent();
                var subform = new ExplorerForm(Directory.GetCurrentDirectory(), true, ResourceType.Sprite);
                if (subform.ShowDialog(this) == DialogResult.OK)
                {
                    foreach (var link in subform.SelectedResources)
                    {
                        sprites.Add(new Subresource <SpriteResource>(link, true));
                        VariantsListBox.Items.Add(link);
                    }
                    BackupChanges();
                    MakeUnsaved();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.ToString(), "Error: Can not .",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 2
0
 private void btnLaunch_Click(object sender, EventArgs e)
 {
     using (var explorerForm = new ExplorerForm())
     {
         explorerForm.AssignExitPoint(this.txtExitPoint.Text);
         if (explorerForm.AssignFacetsData(this.txtFacetsData.Text))
         { //XML is valid
             if (explorerForm.ShowDialog() == DialogResult.Yes)
             {
                 this.txtFacetsData.Text = explorerForm.RetrieveFacetsData();
             }
         }
     }
 }
Ejemplo n.º 3
0
        public TxdEditorForm(ExplorerForm ef, string fp, byte[] data)
        {
            InitializeComponent();

            Owner    = ef;
            FilePath = fp;
            Data     = data;

            Txd = new TxdFile(fp);
            Txd.Load(data);

            InitForm();
            UpdateSelectionPropertyGrid();
            UpdatePictureBox();
        }
Ejemplo n.º 4
0
 // Show explorer form
 public void showExplorerForm(PowerPoint.Presentations presentations)
 {
     try
     {
         if (explorerForm == null)
         {
             explorerForm = new ExplorerForm(presentations, OKMDocumentType.TYPE_POWER_POINT, configXML, docXML);
         }
         explorerForm.Show();
         explorerForm.startUp();
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Ejemplo n.º 5
0
 // Show explorer form
 public void showExplorerForm(Word.Documents documents)
 {
     try
     {
         if (explorerForm == null)
         {
             explorerForm = new ExplorerForm(documents, OKMDocumentType.TYPE_WORD, configXML, docXML);
         }
         explorerForm.Show();
         explorerForm.startUp();
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Ejemplo n.º 6
0
 // Show explorer form
 public void showExplorerForm(Excel.Workbooks workkbooks)
 {
     try
     {
         if (explorerForm == null)
         {
             explorerForm = new ExplorerForm(workkbooks, OKMDocumentType.TYPE_EXCEL, configXML, docXML);
         }
         explorerForm.Show();
         explorerForm.startUp();
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Ejemplo n.º 7
0
 private void LinkSpriteMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         GLSurface.MakeCurrent();
         var subform = new ExplorerForm(Directory.GetCurrentDirectory(), false, ResourceType.Ragdoll);
         if (subform.ShowDialog(this) == DialogResult.OK && subform.SelectedResources.Count == 1)
         {
             SpriteLinkTextBox.Text = subform.SelectedResources[0];
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.ToString(), "Error: Can not link ragdoll.",
                         MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 8
0
        private void ConfigureDock()
        {
            _explorer              = new ExplorerForm();
            _explorer.FileChanged += ExplorerOnFileChanged;
            _explorer.RestoreItem += ExplorerOnRestoreItem;

            _searchResults              = new SearchResultsForm();
            _searchResults.FileChanged += ExplorerOnFileChanged;

            tsExtender.DefaultRenderer = _toolStripProfessionalRenderer;

            dockPanel.Theme         = dockTheme;
            dockPanel.DocumentStyle = DocumentStyle.DockingSdi;
            EnableVsRenderer(VisualStudioToolStripExtender.VsVersion.Vs2015, dockTheme);

            if (!string.IsNullOrEmpty(Settings.Default.WindowLayout))
            {
                using (var ms = new MemoryStream(Encoding.UTF8.GetBytes(Settings.Default.WindowLayout)))
                {
                    dockPanel.LoadFromXml(ms, GetContentFromPersistString);
                }

                if (_explorer.DockPanel == null)
                {
                    _explorer.Show(dockPanel, DockState.DockLeft);
                }

                if (_searchResults.DockPanel == null)
                {
                    _searchResults.Show(dockPanel, DockState.DockBottomAutoHide);
                }
            }
            else
            {
                _explorer.Show(dockPanel, DockState.DockLeft);
                _searchResults.Show(dockPanel, DockState.DockBottomAutoHide);
            }
        }
Ejemplo n.º 9
0
        internal static void Show()
        {
            Application.SetHighDpiMode(HighDpiMode.SystemAware);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            SuperNintendo.Rom.Data = Properties.Resources.Rom;
            SuperNintendo.ConsoleRom.Load();

            Form = new ExplorerForm();

            Form.TreeView.BeforeExpand     += TreeView_BeforeExpand;
            Form.TreeView.AfterSelect      += TreeView_AfterSelect;
            Form.ListView.MouseDoubleClick += ListView_MouseDoubleClick;

            var romNode = Form.TreeView.Nodes.Add("Rom", "Final Fantasy II");

            var songsNode = romNode.Nodes.Add("Songs", "Songs");

            songsNode.Nodes.Add("Loading");

            Application.Run(Form);
        }
Ejemplo n.º 10
0
 public RouterTreeNode(ExplorerForm form,ServiceBusNode serviceBusNode,string name) : base(form,serviceBusNode,name,ExplorerForm.RouterIndex)
 {}
Ejemplo n.º 11
0
        static void Main()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

            //initialization of static classes that needs to be done after all other static initialization - doing it here
            ArgumentKinds.InitArgumentKinds();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            ExplorerForm explorerForm = null;
            var          args         = Environment.GetCommandLineArgs();

            string fileName1   = FixMojibake(args.GetOrDefault(1, ""));
            string fileName2   = FixMojibake(args.GetOrDefault(2, ""));
            string fileName3   = FixMojibake(args.GetOrDefault(3, ""));
            string ext1        = Path.GetExtension(fileName1).ToLowerInvariant();
            string ext2        = Path.GetExtension(fileName2).ToLowerInvariant();
            string ext3        = Path.GetExtension(fileName3).ToLowerInvariant();
            bool   file1Exists = File.Exists(fileName1);
            bool   file2Exists = File.Exists(fileName2);
            bool   file3Exists = File.Exists(fileName3);

            if (fileName1 == "")
            {
                //no arguments - run the program
                explorerForm = new ExplorerForm();
                Application.Run(explorerForm);
                return;
            }

            if ((ext1 == ".ain" || ext1 == ".ain_") && file1Exists && fileName2 == "")
            {
                //one argument, an AIN file, run the program opening that file.
                explorerForm = new ExplorerForm(fileName1);
                Application.Run(explorerForm);
                return;
            }

            ConsoleTools.CreateOrAttachConsole();
            Program.ConsoleMode = true;
            //use modified Shift Jis 2.0 by default when running in console mode
            Extensions.BinaryEncoding = ModifiedShiftJis2.GetEncoding();
            Extensions.TextEncoding   = new UTF8Encoding(true);

            if ((ext1 == ".ain" || ext1 == ".ain_") && file1Exists && fileName2 != "")
            {
                switch (ext2)
                {
                case ".txt":
                    if (file2Exists && fileName3 != "" && ext3 == ".ain")
                    {
                        if (!ImportText(fileName1, fileName2, fileName3))
                        {
                            Environment.ExitCode = 1;
                        }
                        return;
                    }
                    break;

                case ".jaf":
                    if (file2Exists && fileName3 != "" && ext3 == ".ain")
                    {
                        QuickCompileCodePatch(fileName1, fileName2, fileName3);
                        return;
                    }
                    break;

                case ".jam":
                    CreateProject(fileName1, fileName2);
                    return;

                    break;

                case ".pje":
                    DecompileCode(fileName1, fileName2);
                    return;

                    break;
                }
            }
            if (ext1 == ".jam" && file1Exists && fileName2 != "" && (ext2 == ".ain" || ext2 == ".ain_"))
            {
                BuildProject(fileName1, fileName2);
                return;
            }
            if (ext1 == ".pje" && file1Exists)
            {
                CompileCode(fileName1);
                return;
            }

            Console.Error.WriteLine();
            Console.Error.WriteLine(
                "Command line syntax:" + Environment.NewLine +
                "No arguments: Start the program" + Environment.NewLine +
                "<file.ain>: Load the AIN file" + Environment.NewLine +
                "<file.ain> <file.jam>: Decompile ASM to directory containing file.jam (multiple files)" + Environment.NewLine +
                "<file.ain> <file.pje>: Decompile Code to directory contianing file.pje" + Environment.NewLine +
                "<file.jam> <file.ain>: Compile ASM code" + Environment.NewLine +
                "<file.pje>: Compile Code" + Environment.NewLine +
                "<file.ain> <file.txt> <file.ain>: Import Text (New)" + Environment.NewLine +
                "<file.ain> <file.jaf> <file.ain>: Quick Compile Code Patch");
            Console.Error.WriteLine();
        }