Пример #1
0
        internal void OnMainEditorWindowLoaded(GLControl glControl)
        {
            m_glControl = glControl;

            // Delay the creation of the editor until the UI is created, so that we can fire off GL commands immediately in the editor.
            m_editor = new WWindEditor();
            PropertyChanged.Invoke(this, new PropertyChangedEventArgs("WindEditor"));

            // Set up the Editor Tick Loop
            System.Windows.Forms.Timer editorTickTimer = new System.Windows.Forms.Timer();
            editorTickTimer.Interval = 16; //ms
            editorTickTimer.Tick    += (o, args) =>
            {
                DoApplicationTick();
            };
            editorTickTimer.Enabled = true;

            // Check the command line arguments to see if they've passed a folder, if so we'll try to open that.
            // This allows debugging through Visual Studio to open a map automatically.
            var cliArguments = Environment.GetCommandLineArgs();

            if (cliArguments.Length > 1)
            {
                if (System.IO.Directory.Exists(cliArguments[1]))
                {
                    m_editor.LoadProject(cliArguments[1], cliArguments[1]);
                }
            }
        }
Пример #2
0
        internal void OnMainEditorWindowLoaded(GLControl glControl)
        {
            m_glControl = glControl;

            // Delay the creation of the editor until the UI is created, so that we can fire off GL commands immediately in the editor.
            m_editor = new WWindEditor();
            PropertyChanged.Invoke(this, new PropertyChangedEventArgs("WindEditor"));

            // Set up the Editor Tick Loop
            System.Windows.Forms.Timer editorTickTimer = new System.Windows.Forms.Timer();
            editorTickTimer.Interval = 16; //ms
            editorTickTimer.Tick    += (o, args) =>
            {
                DoApplicationTick();
            };
            editorTickTimer.Enabled = true;
        }