Ejemplo n.º 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();
            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());
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes the <see cref="GlobalState"/> class.
        /// </summary>
        static GlobalState()
        {
            Input.Initialize();

            _instance = new GlobalState();
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MapState"/> class.
 /// </summary>
 /// <param name="parent">The <see cref="GlobalState"/>.</param>
 internal MapState(GlobalState parent)
 {
     _parent        = parent;
     _mapDrawFilter = MapDrawFilterInternal;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MapState"/> class.
 /// </summary>
 /// <param name="parent">The <see cref="GlobalState"/>.</param>
 internal MapState(GlobalState parent)
 {
     _parent = parent;
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Initializes the <see cref="GlobalState"/> class.
        /// </summary>
        static GlobalState()
        {
            Input.Initialize();

            _instance = new GlobalState();
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MapState"/> class.
 /// </summary>
 /// <param name="parent">The <see cref="GlobalState"/>.</param>
 internal MapState(GlobalState parent)
 {
     _parent = parent;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MapState"/> class.
 /// </summary>
 /// <param name="parent">The <see cref="GlobalState"/>.</param>
 internal MapState(GlobalState parent)
 {
     _parent = parent;
     _mapDrawFilter = MapDrawFilterInternal;
 }