Ejemplo n.º 1
0
        private void MakeTreeView()
        {
            PoseDataNode posenode = new PoseDataNode(filename);

            PoseTreeView.Nodes.Add(posenode);
            // tahを展開する.
            if (posedata.scene)
            {
                PoseDataCameraNode camera = new PoseDataCameraNode(TextResource.Camera, posedata.camera);
                posenode.Nodes.Add(camera);
                foreach (TDCGExplorer.PNGPoseFigureData data in posedata.figures)
                {
                    PoseDataFigureNode figure = new PoseDataFigureNode(TextResource.Figure, data);
                    posenode.Nodes.Add(figure);
                    PoseDataLightNode light = new PoseDataLightNode(TextResource.Light, data.light);
                    figure.Nodes.Add(light);
                    PoseDataTMONode tmo = new PoseDataTMONode(TextResource.TMO, data.tmo);
                    figure.Nodes.Add(tmo);
                    PoseDataTSONode tso = new PoseDataTSONode(TextResource.TSO, data.tsos);
                    figure.Nodes.Add(tso);
                }
            }
            else
            {
                PoseDataCameraNode camera = new PoseDataCameraNode(TextResource.Camera, posedata.camera);
                PoseDataLightNode  light  = new PoseDataLightNode(TextResource.Light, posedata.figures[0].light);
                PoseDataTMONode    tmo    = new PoseDataTMONode(TextResource.TMO, posedata.figures[0].tmo);
                posenode.Nodes.Add(camera);
                posenode.Nodes.Add(light);
                posenode.Nodes.Add(tmo);
            }
            posenode.ExpandAll();
        }
Ejemplo n.º 2
0
        private void toolStripMenuItemMakeTahFile_Click(object sender, EventArgs e)
        {
            if (TDCGExplorer.TDCGExplorer.BusyTest() == true)
            {
                return;
            }

            PoseDataTSONode node = PoseTreeView.SelectedNode as PoseDataTSONode;

            if (node == null)
            {
                MessageBox.Show(TextResource.OnlyTSOFile, TextResource.Error, MessageBoxButtons.OK);
                return;
            }

            try
            {
                SimpleTextDialog dialog = new SimpleTextDialog();
                dialog.Owner      = TDCGExplorer.TDCGExplorer.MainFormWindow;
                dialog.dialogtext = TextResource.SaveTAHFile;
                dialog.labeltext  = TextResource.Filename;
                dialog.textfield  = filename;

                if (dialog.ShowDialog() == DialogResult.OK)
                {
#if false
                    // 新規TAHを作成する.
                    string dbfilename  = LBFileTahUtl.GetTahDbPath(dialog.textfield);
                    string tahfilename = Path.GetFileNameWithoutExtension(dialog.textfield);
                    if (File.Exists(dbfilename))
                    {
                        MessageBox.Show("既にデータベースファイルがあります。\n" + dbfilename + "\n削除してから操作してください。", "エラー", MessageBoxButtons.OK);
                        return;
                    }
#endif
                    // 常に新規タブで.
                    TAHEditor editor = null;
                    try
                    {
                        editor = new TAHEditor(null);
                        editor.SetInformation(Path.GetFileNameWithoutExtension(dialog.textfield) + ".tah", 1);
                        editor.makeTAHFile(dialog.textfield, node.tso);
                        TDCGExplorer.TDCGExplorer.MainFormWindow.AssignTagPageControl(editor);
                        editor.SelectAll();
                    }
                    catch (Exception)
                    {
                        if (editor != null)
                        {
                            editor.Dispose();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                TDCGExplorer.TDCGExplorer.SetToolTips(TextResource.Error + ":" + ex.Message);
            }
        }