From 14cc5e79385cb39abff780b418e665eaec902b16 Mon Sep 17 00:00:00 2001
From: tengge1 <930372551@qq.com>
Date: Mon, 9 Sep 2019 19:29:08 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86=E5=9C=BA=E6=99=AF=E7=AA=97?=
=?UTF-8?q?=E5=8F=A3=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ShadowEditor.Web/locales/zh-CN.json | 3 +-
ShadowEditor.Web/src/editor/menu/ToolMenu.jsx | 10 ++++--
.../menu/window/CleanUpScenesWindow.jsx | 36 +++++++++++++++++++
.../menu/window/css/CleanUpScenesWindow.css | 11 ++++++
4 files changed, 57 insertions(+), 3 deletions(-)
create mode 100644 ShadowEditor.Web/src/editor/menu/window/CleanUpScenesWindow.jsx
create mode 100644 ShadowEditor.Web/src/editor/menu/window/css/CleanUpScenesWindow.css
diff --git a/ShadowEditor.Web/locales/zh-CN.json b/ShadowEditor.Web/locales/zh-CN.json
index 3e7785fa..24d22fb9 100644
--- a/ShadowEditor.Web/locales/zh-CN.json
+++ b/ShadowEditor.Web/locales/zh-CN.json
@@ -696,5 +696,6 @@
"preserveDrawingBuffer": "保留绘制缓冲区",
"stencil": "模板",
"Screenshot": "截图",
- "Video": "视频"
+ "Video": "视频",
+ "Clean Up Scenes": "清理场景"
}
\ No newline at end of file
diff --git a/ShadowEditor.Web/src/editor/menu/ToolMenu.jsx b/ShadowEditor.Web/src/editor/menu/ToolMenu.jsx
index 87c6e0f6..6f326c5d 100644
--- a/ShadowEditor.Web/src/editor/menu/ToolMenu.jsx
+++ b/ShadowEditor.Web/src/editor/menu/ToolMenu.jsx
@@ -1,7 +1,6 @@
import { classNames, PropTypes, MenuBar, MenuItem, MenuItemSeparator } from '../../third_party';
import TextureGeneratorWindow from './window/TextureGeneratorWindow.jsx';
-import Converter from '../../serialization/Converter';
-import Ajax from '../../utils/Ajax';
+import CleanUpScenesWindow from './window/CleanUpScenesWindow.jsx';
/**
* 工具菜单
@@ -15,6 +14,7 @@ class ToolMenu extends React.Component {
this.handleArrangeMap = this.handleArrangeMap.bind(this);
this.handleArrangeMesh = this.handleArrangeMesh.bind(this);
this.handleArrangeThumbnail = this.handleArrangeThumbnail.bind(this);
+ this.handleCleanUpScenes = this.handleCleanUpScenes.bind(this);
this.handleExportEditor = this.handleExportEditor.bind(this);
}
@@ -25,6 +25,7 @@ class ToolMenu extends React.Component {
+
;
@@ -91,6 +92,11 @@ class ToolMenu extends React.Component {
});
}
+ handleCleanUpScenes() {
+ const win = app.createElement(CleanUpScenesWindow);
+ app.addElement(win);
+ }
+
handleExportEditor() {
app.confirm({
title: _t('Query'),
diff --git a/ShadowEditor.Web/src/editor/menu/window/CleanUpScenesWindow.jsx b/ShadowEditor.Web/src/editor/menu/window/CleanUpScenesWindow.jsx
new file mode 100644
index 00000000..0124b3fa
--- /dev/null
+++ b/ShadowEditor.Web/src/editor/menu/window/CleanUpScenesWindow.jsx
@@ -0,0 +1,36 @@
+import './css/CleanUpScenesWindow.css';
+import { Window, Content, Buttons, Button } from '../../../third_party';
+
+/**
+ * 清理场景窗口
+ * @author tengge / https://github.com/tengge1
+ */
+class CleanUpScenesWindow extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.handleClose = this.handleClose.bind(this);
+ }
+
+ render() {
+ return
+
+
+
+
+
+
+ ;
+ }
+
+ handleClose() {
+ app.removeElement(this);
+ }
+}
+
+export default CleanUpScenesWindow;
\ No newline at end of file
diff --git a/ShadowEditor.Web/src/editor/menu/window/css/CleanUpScenesWindow.css b/ShadowEditor.Web/src/editor/menu/window/css/CleanUpScenesWindow.css
new file mode 100644
index 00000000..2da22897
--- /dev/null
+++ b/ShadowEditor.Web/src/editor/menu/window/css/CleanUpScenesWindow.css
@@ -0,0 +1,11 @@
+.Window.CleanUpScenesWindow>.wrap>.content {
+ left: 0;
+ top: 24px;
+ right: 0;
+ bottom: 32px;
+ overflow-y: auto;
+}
+
+.Window.CleanUpScenesWindow>.wrap>.content>.Form>.FormControl>.Label {
+ width: 180px;
+}
\ No newline at end of file