public EditorForm()
        {
            var currentDirectory = Directory.GetCurrentDirectory();
            var parentDirectory  = Directory.GetParent(currentDirectory);

            m_ProjectDirectory = parentDirectory.FullName;
            m_AssetsDirectory  = m_ProjectDirectory + "\\Assets";

            InitializeComponent();
            try
            {
                // This is how we get the instance handle for our C# app.
                System.IntPtr hInstance = Marshal.GetHINSTANCE(this.GetType().Module);

                // This is how we get the window handle for the panel we'll be rendering into.
                IntPtr hwnd = this.DisplayPanel.Handle;

                // Call into our Dll main function, which will set up an instance of the EditorApp project.
                NativeMethods.EditorMain(hInstance, IntPtr.Zero, hwnd, 1, this.DisplayPanel.Width, this.DisplayPanel.Height);

                InitializeAssetTree();

                m_messageFilter        = new MessageHandler(this.Handle, this.DisplayPanel.Handle, this);
                m_ActorComponentEditor = new ActorComponentEditor(Panel_ActorComponents, m_ProjectDirectory);
            }
            catch (Exception e)
            {
                MessageBox.Show("Error: " + e.ToString());
                // If something goes wrong with the initialization, free the library
                // TODO QT: Why is this commented out???? Maybe Quoc knows...
                // NativeMethods.FreeLibrary(m_pDll);
            }
        }
        public BombastEditorForm()
        {
            InitializeComponent();

            try
            {
                UpdateFormComponents();

                m_messageHandler = new MessageHandler(EditorViewportPanel, this);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.ToString());
            }

            m_actorComponentEditor = new ActorComponentEditor(actorComponentsPanel, m_projectDirectory);

            var defaultProject = Properties.Settings.Default.DefaultProjectPath;

            if (!string.IsNullOrEmpty(defaultProject))
            {
                OpenProject(defaultProject);
            }

            if (Properties.Settings.Default.RecentlyOpenedProjects == null)
            {
                Properties.Settings.Default.RecentlyOpenedProjects = new List <string>();
            }

            UpdateRecentProjectMenuItem();
        }
示例#3
0
        public EditorForm()
        {

            var currentDirectory = Directory.GetCurrentDirectory();
            var parentDirectory = Directory.GetParent(currentDirectory);
            m_ProjectDirectory = parentDirectory.FullName;
            m_AssetsDirectory = m_ProjectDirectory + "\\Assets";

            InitializeComponent();
            try
            {
                // This is how we get the instance handle for our C# app.
                System.IntPtr hInstance = Marshal.GetHINSTANCE(this.GetType().Module);
                
                // This is how we get the window handle for the panel we'll be rendering into.
                IntPtr hwnd = this.DisplayPanel.Handle;

                // Call into our Dll main function, which will set up an instance of the EditorApp project.
                NativeMethods.EditorMain(hInstance, IntPtr.Zero, hwnd, 1, this.DisplayPanel.Width, this.DisplayPanel.Height);

                InitializeAssetTree();

                m_messageFilter = new MessageHandler(this.DisplayPanel, this);
                m_ActorComponentEditor = new ActorComponentEditor(Panel_ActorComponents, m_ProjectDirectory);
            }
            catch (Exception e)
            {
                MessageBox.Show("Error: " + e.ToString());
            }
        }