示例#1
0
        static void Main(string[] args)
        {
            Console.Title = "Dreary";
            Debug.Listeners.Add(new ConsoleTraceListener());
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Form gameForm   = new DrearySplash();
            bool nofagsmode = false;

            if (args.Length != 0)
            {
                foreach (string i in args)
                {
                    switch (i)
                    {
                    case "-nosplash":
                        Form1 gf = new Form1();
                        if (File.Exists("game.dll"))
                        {
                            gf.dllMode = true;
                            DrearyGameDll gameDll = new DrearyGameDll("game.dll");
                            gf.gameDll = gameDll;
                            gf.throwFatalInsteadOfMsg = nofagsmode;
                        }
                        gameForm = gf;
                        break;

                    case "-nofatals":
                        nofagsmode = true;
                        break;

                    case "-h":
                        Console.WriteLine("Dreary Command Line Arguments\n" +
                                          "\n" +
                                          "\t-nosplash : Disables the splash screen\n" +
                                          "\t-nofatals : Disables the Fatal Error messages, better for debug\n" +
                                          "\t-progtest : Starts program testing mode\n" +
                                          "\t-progauto : Automatically tests dreary\n" +
                                          "\t-h        : Shows this help message");
                        Application.Exit();
                        break;

                    case "-progtest":
                        ProgTest.Run();
                        break;

                    case "-progauto":
                        ProgTest.RunAutomated();
                        break;
                    }
                }
            }
            Console.Title = "Dreary";
            Application.Run(gameForm);
        }
示例#2
0
        void tmr_Tick(object sender, EventArgs e)
        {
            tmr.Stop();
            Form1 mf = new Form1();

            if (File.Exists("game.dll"))
            {
                mf.dllMode = true;
                DrearyGameDll gameDll = new DrearyGameDll("game.dll");
                mf.gameDll = gameDll;
                mf.throwFatalInsteadOfMsg = false;
            }
            mf.Show();
            Hide();
            TopMost = false;
        }