Exemplo n.º 1
0
        private void RegisterBehaviorTreeList(BehaviorTreeListDock dock)
        {
            Debug.Check(behaviorTreeList == null);

            behaviorTreeList = dock.behaviorTreeList;
            behaviorTreeList.BehaviorRenamed += new Brainiac.Design.BehaviorTreeList.BehaviorRenamedEventDelegate(behaviorTreeList_BehaviorRenamed);
            behaviorTreeList.ClearBehaviors  += new Brainiac.Design.BehaviorTreeList.ClearBehaviorsEventDelegate(behaviorTreeList_ClearBehaviors);
            behaviorTreeList.ShowBehavior    += new Brainiac.Design.BehaviorTreeList.ShowBehaviorEventDelegate(behaviorTreeList_ShowBehavior);
        }
Exemplo n.º 2
0
		private void RegisterBehaviorTreeList(BehaviorTreeListDock dock)
		{
			Debug.Check(behaviorTreeList ==null);

			behaviorTreeList= dock.behaviorTreeList;
			behaviorTreeList.BehaviorRenamed += new Brainiac.Design.BehaviorTreeList.BehaviorRenamedEventDelegate(behaviorTreeList_BehaviorRenamed);
			behaviorTreeList.ClearBehaviors += new Brainiac.Design.BehaviorTreeList.ClearBehaviorsEventDelegate(behaviorTreeList_ClearBehaviors);
			behaviorTreeList.ShowBehavior += new Brainiac.Design.BehaviorTreeList.ShowBehaviorEventDelegate(behaviorTreeList_ShowBehavior);
		}
Exemplo n.º 3
0
        /// <summary>
        /// Used to store layout.
        /// </summary>
        private WeifenLuo.WinFormsUI.Docking.IDockContent GetContentFromPersistString(string persistString)
        {
            // we skip the behaviour views for now
            if (persistString == "Brainiac.Design.BehaviorTreeViewDock")
            {
                return(null);
            }

            // we only create the generic property dock
            if (PropertiesDock.Count > 0 && persistString == "Brainiac.Design.PropertiesDock")
            {
                return(null);
            }

            // find the type of the dock which is supposed to be created
            Type type = Type.GetType(persistString);

            if (type == null)
            {
                type = Plugin.GetType(persistString);
            }

            // when we have no type we skip the window
            if (type == null)
            {
                return(null);
            }

            // create new window
            WeifenLuo.WinFormsUI.Docking.IDockContent dockContent = (WeifenLuo.WinFormsUI.Docking.IDockContent)type.InvokeMember(string.Empty, System.Reflection.BindingFlags.CreateInstance, null, null, new object[0]);

            // register the behaviour tree list when created
            BehaviorTreeListDock treeListDock = dockContent as BehaviorTreeListDock;

            if (treeListDock != null)
            {
                RegisterBehaviorTreeList(treeListDock);
            }

            return(dockContent);
        }
Exemplo n.º 4
0
        internal MainWindow()
        {
            // add the designers resource manager to the list of all available resource managers
            Plugin.AddResourceManager(Resources.ResourceManager);

            InitializeComponent();

            // display the file version
            string[] vernums = ProductVersion.Split('.');

            Text += " " + vernums[0] + "." + vernums[1];

            if (vernums[2] != "0")
            {
                Text += (char)(int.Parse(vernums[2]) + 0x60);
            }

            if (vernums.Length > 3 && vernums[3] != "0")
            {
                Text += " (" + vernums[3] + ')';
            }

            // create docking panels
            __dockPanel = dockPanel;

            // if we have no stored layout generate a default one
            if (!System.IO.File.Exists(__layoutFile))
            {
                BehaviorTreeListDock btlDock = new BehaviorTreeListDock();
                RegisterBehaviorTreeList(btlDock);
                btlDock.Show(dockPanel, WeifenLuo.WinFormsUI.Docking.DockState.DockLeft);

                new PropertiesDock().Show(dockPanel, WeifenLuo.WinFormsUI.Docking.DockState.DockRight);
            }

            _edgePenReadOnly = new Pen(Brushes.LightGray, 3.0f);
            //_edgePenReadOnly.DashCap= System.Drawing.Drawing2D.DashCap.Round;
            //_edgePenReadOnly.DashStyle= System.Drawing.Drawing2D.DashStyle.Dash;
            //_edgePenReadOnly.DashPattern= new float[] { 4.0f, 3.0f };
        }
Exemplo n.º 5
0
        internal MainWindow()
        {
            // add the designers resource manager to the list of all available resource managers
            Plugin.AddResourceManager(Resources.ResourceManager);

            InitializeComponent();

            // display the file version
            string[] vernums= ProductVersion.Split('.');

            Text+= " "+ vernums[0] +"."+ vernums[1];

            if(vernums[2] !="0")
                Text+= (char) (int.Parse(vernums[2]) +0x60);

            if(vernums.Length >3 && vernums[3] !="0")
                Text+= " ("+ vernums[3] +')';

            // create docking panels
            __dockPanel= dockPanel;

            // if we have no stored layout generate a default one
            if(!System.IO.File.Exists(__layoutFile))
            {
                BehaviorTreeListDock btlDock= new BehaviorTreeListDock();
                RegisterBehaviorTreeList(btlDock);
                btlDock.Show(dockPanel, WeifenLuo.WinFormsUI.Docking.DockState.DockLeft);

                new PropertiesDock().Show(dockPanel, WeifenLuo.WinFormsUI.Docking.DockState.DockRight);
            }

            _edgePenReadOnly= new Pen(Brushes.LightGray, 3.0f);
            //_edgePenReadOnly.DashCap= System.Drawing.Drawing2D.DashCap.Round;
            //_edgePenReadOnly.DashStyle= System.Drawing.Drawing2D.DashStyle.Dash;
            //_edgePenReadOnly.DashPattern= new float[] { 4.0f, 3.0f };
        }