コード例 #1
0
        static void Main(string[] args)
        {
            log.Info("Starting editor...");

            ThreadAsserts.IsMainThread();

#if DEBUG
            WinFormExceptionHelper.AddUnhandledExceptionHooks();
#endif

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

            // Check for a valid path to the development content
            if (ContentPaths.Dev == null)
            {
                const string errmsg =
                    @"Could not find the path to the development content (ContentPaths.Dev). The file containing this path should be located at:
    \Content\Data\devpath.txt

The path to the development content is required by the editor. See the file mentioned above for details.";
                MessageBox.Show(errmsg, "Error finding content path", MessageBoxButtons.OK);
                return;
            }

            // Ensure the content is copied over
            if (!ContentPaths.TryCopyContent(userArgs: CommonConfig.TryCopyContentArgs))
            {
                const string errmsg =
                    "Failed to copy the content from the dev to build path." +
                    " Content in the build path will likely not update to reflect changes made in the content in the dev path.";
                if (log.IsErrorEnabled)
                {
                    log.ErrorFormat(errmsg);
                }
                Debug.Fail(errmsg);
            }

            // Initialize stuff
            EngineSettingsInitializer.Initialize();
            try
            {
                GlobalState.Initialize();

                // Get the command-line switches
                var switches   = CommandLineSwitchHelper.GetCommandsUsingEnum <CommandLineSwitch>(args).ToArray();
                var showEditor = !HandleSwitches(switches);

                if (showEditor)
                {
                    // Start up the application
                    Application.Run(new MainForm());
                }
            }
            finally
            {
                GlobalState.Destroy();
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: wtfcolt/game
 static void CopyContent()
 {
     if (ContentPaths.TryCopyContent(userArgs: CommonConfig.TryCopyContentArgs))
     {
         if (log.IsInfoEnabled)
         {
             log.Info("TryCopyContent succeeded");
         }
     }
     else
     {
         if (log.IsInfoEnabled)
         {
             log.Info("TryCopyContent failed");
         }
     }
 }