Ejemplo n.º 1
0
 protected MainForm InitEditor()
 {
     var workspace = new Workspace();
     MainForm main = new MainForm(workspace);
     DualityEditorApp.Init(main, this.recover, workspace);
     return main;
 }
Ejemplo n.º 2
0
		public void BeforeTest(TestDetails details)
		{
			Console.WriteLine("----- Beginning Duality Editor environment setup -----");

			// Set environment directory to Duality binary directory
			this.oldEnvDir = Environment.CurrentDirectory;
			string codeBaseURI = typeof(DualityEditorApp).Assembly.CodeBase;
			string codeBasePath = codeBaseURI.StartsWith("file:") ? codeBaseURI.Remove(0, "file:".Length) : codeBaseURI;
			codeBasePath = codeBasePath.TrimStart('/');
			Environment.CurrentDirectory = Path.GetDirectoryName(codeBasePath);

			// Add some Console logs manually for NUnit
			if (!Log.Core.Outputs.OfType<TextWriterLogOutput>().Any(o => o.Target == Console.Out))
			{
				if (this.consoleLogOutput == null) this.consoleLogOutput = new TextWriterLogOutput(Console.Out);
				Log.AddGlobalOutput(this.consoleLogOutput);
			}

			// Create a dummy window for the editor
			if (this.dummyWindow == null)
				this.dummyWindow = new MainForm();

			// Initialize the Duality Editor
			DualityEditorApp.Init(this.dummyWindow, false);

			Console.WriteLine("----- Duality Editor environment setup complete -----");
		}
Ejemplo n.º 3
0
        protected override void InitPlugin(MainForm main)
        {
            base.InitPlugin(main);

            // Request menu
            this.menuItemSceneView = main.RequestMenu(GeneralRes.MenuName_View, SceneViewRes.MenuItemName_SceneView);
            this.menuItemSceneView.Image = SceneViewResCache.IconSceneView.ToBitmap();
            this.menuItemSceneView.Click += this.menuItemSceneView_Click;
        }
Ejemplo n.º 4
0
        protected override void InitPlugin(MainForm main)
        {
            base.InitPlugin(main);

            // Request menus
            this.menuItemResHacker = main.RequestMenu(Path.Combine(GeneralRes.MenuName_Tools, ResourceHackerRes.MenuItemName_ResourceHacker));

            // Configure menus
            this.menuItemResHacker.Image = ResourceHackerResCache.IconResourceHacker;
            this.menuItemResHacker.Click += new EventHandler(this.menuItemResHacker_Click);
        }
Ejemplo n.º 5
0
        protected override void InitPlugin(MainForm main)
        {
            base.InitPlugin(main);

            // Request menu
            this.menuItemCamView = main.RequestMenu(GeneralRes.MenuName_View, CamViewRes.MenuItemName_CamView);
            this.menuItemCamView.Image = CamViewResCache.IconEye.ToBitmap();
            this.menuItemCamView.Click += this.menuItemCamView_Click;

            Sandbox.Entering += this.Sandbox_Entering;
        }
Ejemplo n.º 6
0
        protected override void InitPlugin(MainForm main)
        {
            base.InitPlugin(main);

            // Request menus
            this.menuItemHelpAdvisor = main.RequestMenu(Path.Combine(GeneralRes.MenuName_Help, HelpAdvisorRes.MenuItemName_Advisor));

            // Configure menus
            this.menuItemHelpAdvisor.Image = HelpAdvisorResCache.IconHelp;
            this.menuItemHelpAdvisor.Click += new EventHandler(this.menuItemHelpAdvisor_Click);
        }
        protected override void InitPlugin(MainForm main)
        {
            base.InitPlugin(main);

            // Request menu
            MenuModelItem fileItem = main.MainMenu.RequestItem(GeneralRes.MenuName_File);
            fileItem.AddItem(new MenuModelItem
            {
                Name = PackageManagerFrontendRes.MenuItemName_PackageView,
                Icon = PackageManagerFrontendResCache.IconPackage.ToBitmap(),
                ActionHandler = this.menuItemLogView_Click
            });
        }
Ejemplo n.º 8
0
		protected override void InitPlugin(MainForm main)
		{
			base.InitPlugin(main);

			// Request menus
			MenuModelItem viewItem = main.MainMenu.RequestItem(GeneralRes.MenuName_Help);
			viewItem.AddItem(new MenuModelItem
			{
				Name = HelpAdvisorRes.MenuItemName_Advisor,
				Icon = HelpAdvisorResCache.IconHelp,
				ActionHandler = this.menuItemHelpAdvisor_Click
			});
		}
Ejemplo n.º 9
0
		protected override void InitPlugin(MainForm main)
		{
			base.InitPlugin(main);
			
			// Request menu
			MenuModelItem viewItem = main.MainMenu.RequestItem(GeneralRes.MenuName_View);
			viewItem.AddItem(new MenuModelItem
			{
				Name = LogViewRes.MenuItemName_LogView,
				Icon = LogViewResCache.IconLogView.ToBitmap(),
				ActionHandler = this.menuItemLogView_Click
			});
		}
Ejemplo n.º 10
0
        protected override void InitPlugin(MainForm main)
        {
            base.InitPlugin(main);

            // Request menus
            this.menuItemAppData = main.RequestMenu(GeneralRes.MenuName_Settings, EditorBaseRes.MenuItemName_AppData);
            this.menuItemUserData = main.RequestMenu(GeneralRes.MenuName_Settings, EditorBaseRes.MenuItemName_UserData);
            this.menuItemAppData.Click += this.menuItemAppData_Click;
            this.menuItemUserData.Click += this.menuItemUserData_Click;

            FileEventManager.ResourceModified += this.FileEventManager_ResourceChanged;
            DualityEditorApp.ObjectPropertyChanged += this.DualityEditorApp_ObjectPropertyChanged;
        }
Ejemplo n.º 11
0
 protected MainForm InitEditor()
 {
     try
     {
         MainForm main = new MainForm();
         DualityEditorApp.Init(main, this.recover);
         return main;
     }
     catch (Exception e)
     {
         Log.Editor.Write("An error occurred while initializing the editor: {0}", Log.Exception(e));
         return null;
     }
 }
        public ProcessingBigTaskDialog(MainForm owner, string caption, string desc, TaskAction task, object data)
        {
            this.InitializeComponent();

            this.owner = owner;
            this.taskCaption = caption;
            this.taskDesc = desc;
            this.task = task;
            this.data = data;

            this.Text = this.taskCaption;
            this.descLabel.Text = this.taskDesc;
            this.stateDescLabel.Text = "";
        }
Ejemplo n.º 13
0
		protected override void InitPlugin(MainForm main)
		{
			base.InitPlugin(main);

			// Request menu
			MenuModelItem viewItem = main.MainMenu.RequestItem(GeneralRes.MenuName_View);
			viewItem.AddItem(new MenuModelItem
			{
				Name = CamViewRes.MenuItemName_CamView,
				Icon = CamViewResCache.IconEye.ToBitmap(),
				ActionHandler = this.menuItemCamView_Click
			});

			Sandbox.Entering += this.Sandbox_Entering;
		}
Ejemplo n.º 14
0
		public ProcessingBigTaskDialog(MainForm owner, string caption, string desc, TaskAction task, object data)
		{
			this.InitializeComponent();

			if (owner == null) this.StartPosition = FormStartPosition.CenterScreen;

			this.targetForm = (Form)owner ?? this;
			this.taskCaption = caption;
			this.taskDesc = desc;
			this.task = task;
			this.data = data;

			this.Text = this.taskCaption;
			this.descLabel.Text = this.taskDesc;
			this.stateDescLabel.Text = "";
		}
Ejemplo n.º 15
0
		public void AfterTest(TestDetails details)
		{
			Console.WriteLine("----- Beginning Duality Editor environment teardown -----");
			
			// Remove NUnit Console logs
			Log.RemoveGlobalOutput(this.consoleLogOutput);
			this.consoleLogOutput = null;

			if (this.dummyWindow != null)
			{
				ContentProvider.ClearContent();
				ContentProvider.DisposeDefaultContent();
			    this.dummyWindow.Dispose();
			    this.dummyWindow = null;
			}

			DualityEditorApp.Terminate(false);
			Environment.CurrentDirectory = this.oldEnvDir;

			Console.WriteLine("----- Duality Editor environment teardown complete -----");
		}
Ejemplo n.º 16
0
		protected override void InitPlugin(MainForm main)
		{
			base.InitPlugin(main);

			// Request menus
			MenuModelItem settingsItem = main.MainMenu.RequestItem(GeneralRes.MenuName_Settings);
			settingsItem.SortValue = MenuModelItem.SortValue_OverBottom;
			settingsItem.AddItems(new[]
			{
				new MenuModelItem
				{
					Name = EditorBaseRes.MenuItemName_AppData,
					ActionHandler = this.menuItemAppData_Click
				},
				new MenuModelItem
				{
					Name = EditorBaseRes.MenuItemName_UserData,
					ActionHandler = this.menuItemUserData_Click
				}
			});

			FileEventManager.ResourceModified += this.FileEventManager_ResourceChanged;
			DualityEditorApp.ObjectPropertyChanged += this.DualityEditorApp_ObjectPropertyChanged;
		}
Ejemplo n.º 17
0
        protected override void InitPlugin(MainForm main)
        {
            base.InitPlugin(main);

            // Request menus
            this.menuItemProjectView = main.RequestMenu(GeneralRes.MenuName_View, EditorBaseRes.MenuItemName_ProjectView);
            this.menuItemSceneView = main.RequestMenu(GeneralRes.MenuName_View, EditorBaseRes.MenuItemName_SceneView);
            this.menuItemObjView = main.RequestMenu(GeneralRes.MenuName_View, EditorBaseRes.MenuItemName_ObjView);
            this.menuItemCamView = main.RequestMenu(GeneralRes.MenuName_View, EditorBaseRes.MenuItemName_CamView);
            this.menuItemLogView = main.RequestMenu(GeneralRes.MenuName_View, EditorBaseRes.MenuItemName_LogView);
            this.menuItemAppData = main.RequestMenu(GeneralRes.MenuName_Settings, EditorBaseRes.MenuItemName_AppData);
            this.menuItemUserData = main.RequestMenu(GeneralRes.MenuName_Settings, EditorBaseRes.MenuItemName_UserData);

            // Configure menus
            this.menuItemProjectView.Image = EditorBaseResCache.IconProjectView.ToBitmap();
            this.menuItemSceneView.Image = EditorBaseResCache.IconSceneView.ToBitmap();
            this.menuItemObjView.Image = EditorBaseResCache.IconObjView.ToBitmap();
            this.menuItemCamView.Image = EditorBaseResCache.IconEye.ToBitmap();
            this.menuItemLogView.Image = EditorBaseResCache.IconLogView.ToBitmap();

            this.menuItemProjectView.Click += this.menuItemProjectView_Click;
            this.menuItemSceneView.Click += this.menuItemSceneView_Click;
            this.menuItemObjView.Click += this.menuItemObjView_Click;
            this.menuItemCamView.Click += this.menuItemCamView_Click;
            this.menuItemLogView.Click += this.menuItemLogView_Click;
            this.menuItemAppData.Click += this.menuItemAppData_Click;
            this.menuItemUserData.Click += this.menuItemUserData_Click;

            Sandbox.Entering += this.Sandbox_Entering;
            FileEventManager.ResourceModified += this.FileEventManager_ResourceChanged;
            //	FileEventManager.ResourceCreated += this.FileEventManager_ResourceChanged;
            //	FileEventManager.ResourceDeleted += this.FileEventManager_ResourceChanged;
            //	FileEventManager.ResourceRenamed += this.FileEventManager_ResourceChanged;
            DualityEditorApp.ObjectPropertyChanged += this.DualityEditorApp_ObjectPropertyChanged;
        }
Ejemplo n.º 18
0
 public ReloadCorePluginDialog(MainForm owner)
 {
     this.InitializeComponent();
     this.owner = owner;
 }
Ejemplo n.º 19
0
 /// <summary>
 /// This method is called when all plugins and the editors user data and layout are loaded. May initialize GUI.
 /// </summary>
 /// <param name="main"></param>
 protected internal virtual void InitPlugin(MainForm main)
 {
 }
Ejemplo n.º 20
0
		private static void CloseMainForm(MainForm form)
		{
			Application.Exit();
		}
Ejemplo n.º 21
0
        protected override void InitPlugin(MainForm main)
        {
            base.InitPlugin(main);

            // Request menu
            this.menuItemObjView = main.RequestMenu(GeneralRes.MenuName_View, ObjectInspectorRes.MenuItemName_ObjView);
            this.menuItemObjView.Image = ObjectInspectorResCache.IconObjView.ToBitmap();
            this.menuItemObjView.Click += this.menuItemObjView_Click;
        }
        protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);

            this.owner.SetTaskbarOverlayIcon(GeneralResCache.IconCog, this.taskCaption);

            this.workerInterface = new WorkerInterface();
            this.workerInterface.owner = this;
            this.workerInterface.MainForm = this.owner;
            this.workerInterface.Task = this.task;
            this.workerInterface.Data = this.data;

            this.worker = new Thread(WorkerThreadProc);
            this.worker.Start(this.workerInterface);

            this.progressTimer.Start();
        }
Ejemplo n.º 23
0
		protected MainForm InitEditor()
		{
			MainForm main = new MainForm();
			DualityEditorApp.Init(main, this.recover);
			return main;
		}