示例#1
0
        public void ImportFromDae()
        {
            if (m_CollisionMesh == null)
            {
                MessageBox.Show("You must select a room before you can import collision for it.", "No collision mesh selected");
                return;
            }

            var ofd = new CommonOpenFileDialog()
            {
                Title            = "Import DAE",
                DefaultExtension = "dae",
            };

            ofd.Filters.Add(new CommonFileDialogFilter("Collada", ".dae"));
            if (WSettingsManager.GetSettings().LastCollisionDaePath.FilePath != "")
            {
                ofd.InitialDirectory = WSettingsManager.GetSettings().LastCollisionDaePath.FilePath;
            }

            if (ofd.ShowDialog() == CommonFileDialogResult.Ok)
            {
                WRoom currRoom = World.Map.FocusedScene as WRoom;
                m_CollisionMesh.FromDAEFile(ofd.FileName, currRoom.RoomIndex);

                m_CollisionTree.ItemsSource = new ObservableCollection <CollisionGroupNode>()
                {
                    ActiveCollisionMesh.RootNode
                };

                WSettingsManager.GetSettings().LastCollisionDaePath.FilePath = Path.GetDirectoryName(ofd.FileName);
                WSettingsManager.SaveSettings();
            }
        }
示例#2
0
        public void ExportToDae()
        {
            if (m_CollisionMesh == null)
            {
                MessageBox.Show("You must select a room before you can export its collision.", "No collision mesh selected");
                return;
            }

            var sfd = new CommonSaveFileDialog()
            {
                Title                        = "Export DAE",
                DefaultExtension             = "dae",
                AlwaysAppendDefaultExtension = true,
            };

            sfd.Filters.Add(new CommonFileDialogFilter("Collada", ".dae"));
            if (WSettingsManager.GetSettings().LastCollisionDaePath.FilePath != "")
            {
                sfd.InitialDirectory = WSettingsManager.GetSettings().LastCollisionDaePath.FilePath;
            }

            if (sfd.ShowDialog() == CommonFileDialogResult.Ok)
            {
                m_CollisionMesh.ToDAEFile(sfd.FileName);

                WSettingsManager.GetSettings().LastCollisionDaePath.FilePath = Path.GetDirectoryName(sfd.FileName);
                WSettingsManager.SaveSettings();
            }
        }
示例#3
0
        private void OnRequestSaveOtherFormatMessageData()
        {
            var sfd = new CommonSaveFileDialog()
            {
                Title                        = "Export Script Archive",
                DefaultExtension             = "txt",
                AlwaysAppendDefaultExtension = true,
            };

            sfd.Filters.Add(new CommonFileDialogFilter("Archives", "txt"));
            if (WSettingsManager.GetSettings().LastScriptArchivePath.FilePath != "")
            {
                sfd.InitialDirectory = WSettingsManager.GetSettings().LastScriptArchivePath.FilePath;
            }

            if (sfd.ShowDialog() == CommonFileDialogResult.Ok)
            {
                SaveMessageOther(sfd.FileName);

                WSettingsManager.GetSettings().LastScriptArchivePath.FilePath = Path.GetDirectoryName(sfd.FileName);
                WSettingsManager.SaveSettings();
            }
        }
        private void OnUserAcceptSettings()
        {
            WSettingsManager.SaveSettings();

            CloseOptionsMenuWindow();
        }