From d148a65d160df112e4b6e80841b70d0cea33a5cc Mon Sep 17 00:00:00 2001 From: liteng <930372551@qq.com> Date: Sun, 16 Dec 2018 16:52:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=A8=E7=94=BB=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + ShadowEditor.Model/Category/CategoryType.cs | 5 ++++ .../src/editor/bottom/AnimationPanel.js | 18 ++++++------- .../src/editor/bottom/BottomPanel.js | 27 +++++++++++++++++++ ShadowEditor.Web/src/event/EventList.js | 1 + 5 files changed, 43 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index bfc18cda..a5045526 100644 --- a/.gitignore +++ b/.gitignore @@ -86,3 +86,4 @@ typings/ /ShadowEditor.Model/bin /ShadowEditor.Model/obj /THREE/THREE.csproj.user +/ShadowEditor.Web/Upload/Animation diff --git a/ShadowEditor.Model/Category/CategoryType.cs b/ShadowEditor.Model/Category/CategoryType.cs index 5b0baab6..9e1ec03e 100644 --- a/ShadowEditor.Model/Category/CategoryType.cs +++ b/ShadowEditor.Model/Category/CategoryType.cs @@ -40,5 +40,10 @@ namespace ShadowEditor.Model.Category /// 音频 /// Audio, + + /// + /// 动画 + /// + Animation, } } diff --git a/ShadowEditor.Web/src/editor/bottom/AnimationPanel.js b/ShadowEditor.Web/src/editor/bottom/AnimationPanel.js index 54393483..756ddd0f 100644 --- a/ShadowEditor.Web/src/editor/bottom/AnimationPanel.js +++ b/ShadowEditor.Web/src/editor/bottom/AnimationPanel.js @@ -24,7 +24,7 @@ AnimationPanel.prototype.render = function () { }; AnimationPanel.prototype.onShowPanel = function (tabName) { - if (tabName !== 'map') { + if (tabName !== 'animation') { return; } @@ -121,7 +121,7 @@ AnimationPanel.prototype.updateCategory = function () { var category = UI.get('category', this.id); category.clear(); - Ajax.getJson(`/api/Category/List?type=Map`, obj => { + Ajax.getJson(`/api/Category/List?type=Animation`, obj => { category.options = {}; obj.Data.forEach(n => { category.options[n.ID] = n.Name; @@ -133,7 +133,7 @@ AnimationPanel.prototype.updateCategory = function () { AnimationPanel.prototype.updateList = function () { var search = UI.get('search', this.id); - Ajax.getJson(`/api/Map/List`, obj => { + Ajax.getJson(`/api/Animation/List`, obj => { this.data = obj.Data; search.setValue(''); this.onSearch(); @@ -210,7 +210,7 @@ AnimationPanel.prototype.onClick = function (event, index, btn, control) { // ------------------------------------- 添加 ------------------------------------ AnimationPanel.prototype.onAddMap = function (data) { - this.app.call(`selectMap`, this, data); + this.app.call(`selectAnimation`, this, data); }; // ----------------------------------- 上传 ---------------------------------------- @@ -230,7 +230,7 @@ AnimationPanel.prototype.onUpload = function () { }; AnimationPanel.prototype.onCommitUpload = function () { - UploadUtils.upload(`file_${this.id}`, `/api/Map/Add`, event => { + UploadUtils.upload(`file_${this.id}`, `/api/Animation/Add`, event => { if (event.target.status === 200) { var response = event.target.response; var obj = JSON.parse(response); @@ -253,9 +253,9 @@ AnimationPanel.prototype.onEdit = function (data) { this.editWindow = new EditWindow({ app: this.app, parent: document.body, - type: 'Map', - typeName: '贴图', - saveUrl: '/api/Map/Edit', + type: 'Animation', + typeName: '动画', + saveUrl: '/api/Animation/Edit', callback: this.update.bind(this) }); this.editWindow.render(); @@ -269,7 +269,7 @@ AnimationPanel.prototype.onEdit = function (data) { AnimationPanel.prototype.onDelete = function (data) { UI.confirm('询问', `是否删除${data.Name}?`, (event, btn) => { if (btn === 'ok') { - Ajax.post(`/api/Map/Delete?ID=${data.ID}`, json => { + Ajax.post(`/api/Animation/Delete?ID=${data.ID}`, json => { var obj = JSON.parse(json); if (obj.Code === 200) { this.update(); diff --git a/ShadowEditor.Web/src/editor/bottom/BottomPanel.js b/ShadowEditor.Web/src/editor/bottom/BottomPanel.js index 2b32dbf4..4c45cb71 100644 --- a/ShadowEditor.Web/src/editor/bottom/BottomPanel.js +++ b/ShadowEditor.Web/src/editor/bottom/BottomPanel.js @@ -5,6 +5,7 @@ import ModelPanel from './ModelPanel'; import MapPanel from './MapPanel'; import MaterialPanel from './MaterialPanel'; import AudioPanel from './AudioPanel'; +import AnimationPanel from './AnimationPanel'; import ParticlePanel from './ParticlePanel'; import LogPanel from './LogPanel'; @@ -76,6 +77,13 @@ BottomPanel.prototype.render = function () { onClick: () => { this.selectTab('audio'); } + }, { + xtype: 'text', + id: 'animationTab', + text: '动画', + onClick: () => { + this.selectTab('animation'); + } }, { xtype: 'text', id: 'particleTab', @@ -168,6 +176,17 @@ BottomPanel.prototype.render = function () { app: this.app }) ] + }, { + xtype: 'div', + id: 'animationPanel', + style: { + height: 'calc(100% - 40px)' + }, + children: [ + new AnimationPanel({ + app: this.app + }) + ] }, { xtype: 'div', id: 'particlePanel', @@ -214,6 +233,7 @@ BottomPanel.prototype.onSelectPanel = function (tabName) { var mapTab = UI.get('mapTab'); var materialTab = UI.get('materialTab'); var audioTab = UI.get('audioTab'); + var animationTab = UI.get('animationTab'); var particleTab = UI.get('particleTab'); var logTab = UI.get('logTab'); @@ -223,6 +243,7 @@ BottomPanel.prototype.onSelectPanel = function (tabName) { var mapPanel = UI.get('mapPanel'); var materialPanel = UI.get('materialPanel'); var audioPanel = UI.get('audioPanel'); + var animationPanel = UI.get('animationPanel'); var particlePanel = UI.get('particlePanel'); var logPanel = UI.get('logPanel'); @@ -232,6 +253,7 @@ BottomPanel.prototype.onSelectPanel = function (tabName) { mapTab.dom.className = ''; materialTab.dom.className = ''; audioTab.dom.className = ''; + animationTab.dom.className = ''; particleTab.dom.className = ''; logTab.dom.className = ''; @@ -241,6 +263,7 @@ BottomPanel.prototype.onSelectPanel = function (tabName) { mapPanel.dom.style.display = 'none'; materialPanel.dom.style.display = 'none'; audioPanel.dom.style.display = 'none'; + animationPanel.dom.style.display = 'none'; particlePanel.dom.style.display = 'none'; logPanel.dom.style.display = 'none'; @@ -269,6 +292,10 @@ BottomPanel.prototype.onSelectPanel = function (tabName) { audioTab.dom.className = 'selected'; audioPanel.dom.style.display = ''; break; + case 'animation': + animationTab.dom.className = 'selected'; + animationPanel.dom.style.display = ''; + break; case 'particle': particleTab.dom.className = 'selected'; particlePanel.dom.style.display = ''; diff --git a/ShadowEditor.Web/src/event/EventList.js b/ShadowEditor.Web/src/event/EventList.js index bec86eab..c65b28c7 100644 --- a/ShadowEditor.Web/src/event/EventList.js +++ b/ShadowEditor.Web/src/event/EventList.js @@ -95,6 +95,7 @@ var EventList = [ 'selectMap', // 选择贴图 'selectMaterial', // 选择材质 'selectAudio', // 选择音频 + 'selectAnimation', // 选择动画 'selectParticle', // 选择粒子 ];