Example #1
0
        private void selectIndex(int index)
        {
            ArcsCollisionRecord col = collisionEntry.entries[index];

            ArcsDatabase db = TDCGExplorer.TDCGExplorer.ArcsDB;
            // 衝突した先のtahを取得する.
            ArcsTahEntry from = db.GetTah(col.fromTahID);
            ArcsTahEntry to   = db.GetTah(col.toTahID);
            // 既に同じ名前で追加していないか調べる.
            ArcsTahFilesEntry fromfile = db.GetTahFilesEntry(col.fromFilesID);
            ArcsTahFilesEntry tofile   = db.GetTahFilesEntry(col.toFilesID);

            string text =
                @"<p>" +
                @"<h2> " + TextResource.CollisionHTML_CollisionFrom + " : " + from.shortname + "</h2>" +
                @"<adress>" + TextResource.Directory + " : " + Path.GetDirectoryName(from.path) + "</adress>" +
                @"<h3> " + TextResource.CollisionHTML_CollisionTo + " : " + to.shortname + "</h3>" +
                @"<adress>" + TextResource.Directory + " : " + Path.GetDirectoryName(to.path) + "</adress>" +
                @"<pre>" + fromfile.GetDisplayPath().ToLower() + " --> " + tofile.GetDisplayPath().ToLower() + "</pre>" +
                @"<pre>" + TextResource.HashCode + " : " + tofile.hash.ToString("x8") + "</pre>";

            webBrowser.DocumentText = text;

            try
            {
                string filename = fromfile.GetDisplayPath().ToLower();
                if (Path.GetExtension(filename) == ".tso")
                {
                    // TSOを表示する.
                    using (GenericTAHStream tahstream = new GenericTAHStream(new GenericArcsTahInfo(from), fromfile))
                    {
                        Cursor.Current = Cursors.WaitCursor;
                        TDCGExplorer.TDCGExplorer.MainFormWindow.makeTSOViwer();
                        TDCGExplorer.TDCGExplorer.MainFormWindow.clearTSOViewer();
                        TDCGExplorer.TDCGExplorer.MainFormWindow.Viewer.LoadTSOFile(tahstream.stream);
                        if (TDCGExplorer.TDCGExplorer.SystemDB.loadinitialpose)
                        {
                            TDCGExplorer.TDCGExplorer.MainFormWindow.doInitialTmoLoad();                                                    // 初期tmoを読み込む.
                        }
                        // カメラをセンター位置に.
                        TSOCameraAutoCenter camera = new TSOCameraAutoCenter(TDCGExplorer.TDCGExplorer.MainFormWindow.Viewer);
                        camera.UpdateCenterPosition(fromfile.path.ToUpper());
                        // 次回カメラが必ずリセットされる様にする.
                        TDCGExplorer.TDCGExplorer.MainFormWindow.setNeedCameraReset();
                        Cursor.Current = Cursors.Default;
                        //TDCGExplorer.TDCGExplorer.FigureLoad = false;
                    }
                }
            }
            catch (Exception)
            {
            }
        }
Example #2
0
        private void toolStripMenuItemEditTah_Click(object sender, EventArgs e)
        {
            if (TDCGExplorer.TDCGExplorer.BusyTest() == true)
            {
                return;
            }

            ArcsCollisionRecord col  = collisionEntry.entries[0];
            ArcsDatabase        db   = TDCGExplorer.TDCGExplorer.ArcsDB;
            ArcsTahEntry        from = db.GetTah(col.fromTahID);

            LBFileTahUtl.OpenTahEditor(new GenericArcsTahInfo(from));
        }