Ejemplo n.º 1
0
        private string mapName; // 当前场景名
        // end ahpho
        public BaseDoc(BaseForm parent, string filename/*, ref AtlIEKG3DScene baseFormScene*/)
        {
            m_form = parent;
            m_view = parent.VIEW;
            m_strFileName = filename;

            if (EditorLayer.UseSO3Logic)
            {
                // Init LogicEditor
                EngineLayer.ATLBase.InitLogicalEditorBase();

                LogicsLayer.SO3world.LoadEditorScene(filename);

                LogicsLayer.SO3world.AttachLogicalSceneTo3DScene();

                LogicsLayer.SO3world.NewLogicSceneConnectionAndBindLogicalSceneAndSceneEditor();
            }

            LogicsLayer.SO3world.NewLogicalDataAndAdviseWithSceneEditor();

            string strIniFile = m_strFileName + ".Logical";
            LogicsLayer.SO3world.LoadLogicalData(strIniFile);

            // 加载树所要的数据
            LogicsLayer.SO3world.GetLogicalDataPtr(ref m_DocLogical);
            LogicHelper.Init(m_DocLogical);
            mapName = FileFolderHelper.GetMapName(m_strFileName);
            m_AllLogicObj = LogicHelper.DoImportOneTarget(strIniFile, mapName);
        }
Ejemplo n.º 2
0
        public BaseForm(string filename, MainForm parent)
        {
            InitializeComponent();

            InitVars();

            m_parent = parent;
            m_doc = new BaseDoc(this, filename);
            m_view = new BaseView(this, this.PANEL.Handle);
            this.PANEL.m_baseForm = this;
            m_doc.DocLogical.SetMainViewHwnd((int)this.PANEL.Handle);
            this.MouseWheel += new MouseEventHandler(this.BaseForm_MouseWheel);
            this.PanelView.GotFocus += new EventHandler(this.PanelView_GotFocus);
            this.PanelView.LostFocus += new EventHandler(this.PanelView_LostFocus);
            this.PanelView.MouseDown += new MouseEventHandler(this.PanelView_MouseDown);
            this.PanelView.Resize += new EventHandler(this.PanelView_Resize);
            this.KeyPreview = true;

            // 顶视图
            InitTopView_Tga(filename);
            InitTopView_Old();

            // lua脚本
            InitLua();

            // ahpho suntao
            // 初始化路径面板
            InitPatrol();

            // 初始化交通面板
            InitTraffic();

            //
            InitPolyComponents();
            InitPoly();

            // 初始化sql连接
            InitSqlConnection();

            // 初始化Npc面板
            InitNpc();
            EngineLayer.ATLBase.OnResizeNpcWindow();

            // 初始化Doodad面板
            InitDoodad();
            EngineLayer.ATLBase.OnResizeDoodadWindow();

            // 初始化预览面板
            InitPreviewCanvas();
            // end ahpho

            // loadtree
            DateTime t_begin = DateTime.Now;
            LogicHelper.LoadTree(m_doc.m_AllLogicObj, this.treeView1, m_bShowAllNpcDoodad);
            TimeSpan t_delta = DateTime.Now - t_begin;
            Debug.WriteLine(t_delta.ToString());
            //MessageBox.Show(t_delta.ToString());

            // init timer
            InitRenderTimer();

            // 读取路径和阵型信息
            DataColumn orderIDColumn = new DataColumn("ID");
            DataColumn orderNameColumn = new DataColumn("Name");
            DataColumn orderCountColumn = new DataColumn("Count");

            npcOrderTable.Columns.Clear();
            npcOrderTable.Columns.Add(orderIDColumn);
            npcOrderTable.Columns.Add(orderNameColumn);
            npcOrderTable.Columns.Add(orderCountColumn);

            InitNpcOrderTable();

            DataColumn patrolPathIDColumn = new DataColumn("ID");
            DataColumn patrolPathNameColumn = new DataColumn("Name");

            patrolPathTable.Columns.Clear();
            patrolPathTable.Columns.Add(patrolPathIDColumn);
            patrolPathTable.Columns.Add(patrolPathNameColumn);

            InitPatrolPathTable();

            InitCameraUI();

            m_CheckRelive = new CheckRelive();
            m_CheckRelive.Init(filename, m_doc.DocLogical, SceneSceneEditor);

        }