Пример #1
0
        protected void OnBundleBrowserClicked(object sender, EventArgs e)
        {
            frmPackageBrowser brows = new frmPackageBrowser();

            brows.Show();
            this.Visible = false;
            //this.Close ();
        }
Пример #2
0
        public App(string[] args, Application app)
        {
            Instance     = this;
            this.MainApp = app;

            StaticData.Engine   = Python.CreateEngine();
            StaticData.Settings = new Settings();

            //this.LoadScripts();

            bool launchMain = true;
            bool showHelp   = false;

            /*string fontFile = null;
             * string textureFile = null;*/

            var p = new OptionSet()
            {
                /*{ "t|texture=", "the {FILEPATH} of a DDS texture you wish to use.",
                 *      v => {
                 *              textureFile = v;
                 *              launchMain = false;
                 *      } },
                 * { "f|font=", "the {FILEPATH} of the font you wish to open, to open a font texture with this use -t",
                 *      v => {
                 *              fontFile = v;
                 *              launchMain = false;
                 *      } },
                 * { "s|scriptdata=",
                 *      "the {FILEPATH} of a ScriptData file you wish to view.",
                 *      v => {
                 *              ScriptDataViewer textView = new ScriptDataViewer();
                 *              textView.LoadScriptData(v);
                 *              textView.Show();
                 *              launchMain = false;
                 *      } },*/
                { "db|database=", "the {FILEPATH} of the database you wish to load on launch",
                  v => {
                      frmPackageBrowser brows = new frmPackageBrowser();
                      brows.LoadDatabase(v);
                      app.Run(brows);
                      launchMain = false;
                  } },
                { "h|help", "show this message and exit",
                  v => { showHelp = v != null; launchMain = false; } },
            };

            List <string> extra;

            try
            {
                extra = p.Parse(args);
            }
            catch (OptionException exc)
            {
                Console.WriteLine(exc.Message);
                return;
            }

            /*if (fontFile != null)
             *          {
             *                  FontEditor fontEd = new FontEditor(fontFile, textureFile);
             *                  fontEd.Show();
             *          }
             *          else if (textureFile != null)
             *          {
             *                  DDSViewer ddsView = new DDSViewer();
             *                  ddsView.LoadTexture(textureFile);
             *                  ddsView.Show();
             *          }*/

            //this.LoadHashlists ();

            LoadConverters();

            if (launchMain)
            {
                try {
                    frmPackageBrowser brower = new frmPackageBrowser();
                    app.Run(brower);
                }
                catch (Exception exc)
                {
                    Console.WriteLine(exc.Message);
                    Console.WriteLine(exc.StackTrace);
                    Console.Read();
                }
            }


            if (showHelp)
            {
                this.PrintHelp();
            }
        }