From 8d0fc3c281f2d100217660abe44bfb249b9cceba Mon Sep 17 00:00:00 2001 From: liteng <930372551@qq.com> Date: Tue, 22 Jan 2019 19:26:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=BA=E6=99=AF=E7=BB=84=E4=BB=B6=E5=A4=9A?= =?UTF-8?q?=E8=AF=AD=E8=A8=80=E5=8C=96=E5=AE=8C=E6=88=90=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ShadowEditor.Web/lang/zh-CN.js | 5 +++++ ShadowEditor.Web/src/component/SceneComponent.js | 10 +++++----- ShadowEditor.Web/src/language/Language.js | 7 ++++++- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ShadowEditor.Web/lang/zh-CN.js b/ShadowEditor.Web/lang/zh-CN.js index cfe6ad72..d7577bad 100644 --- a/ShadowEditor.Web/lang/zh-CN.js +++ b/ShadowEditor.Web/lang/zh-CN.js @@ -165,3 +165,8 @@ L_FOG_COLOR = '雾颜色'; L_FOG_NEAR = '雾近点'; L_FOG_FAR = '雾远点'; L_FOG_DENSITY = '雾浓度'; +L_CLICK_MAP_PANEL = '请点击贴图面板中的立体贴图!'; +L_ONLY_SELECT_CUBE_TEXTURE = '只允许选择立体贴图!'; +L_CUBE_TEXTURE_FETCH_FAILED = '立体贴图获取失败!'; +L_UPLOAD_ALL_BEFORE_SAVE = '请上传所有立体贴图后再点击保存!'; +L_CUBE_TEXTURE_EXISTED = '立体贴图已经存在于服务端,无需重复上传。'; diff --git a/ShadowEditor.Web/src/component/SceneComponent.js b/ShadowEditor.Web/src/component/SceneComponent.js index ef80377d..7bb55d27 100644 --- a/ShadowEditor.Web/src/component/SceneComponent.js +++ b/ShadowEditor.Web/src/component/SceneComponent.js @@ -401,13 +401,13 @@ SceneComponent.prototype.onChangeBackgroundType = function () { // 切换背景 SceneComponent.prototype.onLoadCubeTexture = function () { // 加载立体贴图 this.app.call(`selectBottomPanel`, this, 'map'); - UI.msg('请点击贴图面板中的立体贴图!'); + UI.msg(L_CLICK_MAP_PANEL); this.app.on(`selectMap.${this.id}`, this.onSelectCubeMap.bind(this)); }; SceneComponent.prototype.onSelectCubeMap = function (model) { if (model.Type !== 'cube') { - UI.msg('只允许选择立体贴图!'); + UI.msg(L_ONLY_SELECT_CUBE_TEXTURE); return; } @@ -423,7 +423,7 @@ SceneComponent.prototype.onSelectCubeMap = function (model) { resolve(texture); }, undefined, error => { console.error(error); - UI.msg('立体贴图获取失败!'); + UI.msg(L_CUBE_TEXTURE_FETCH_FAILED); }); }); }); @@ -448,7 +448,7 @@ SceneComponent.prototype.onSaveCubeTexture = function () { // 保存立体贴图 var textureNegZ = UI.get('backgroundNegZ', this.id).getValue(); if (!texturePosX || !textureNegX || !texturePosY || !textureNegY || !texturePosZ || !textureNegZ) { - UI.msg(`请上传所有立体贴图后再点击保存!`); + UI.msg(L_UPLOAD_ALL_BEFORE_SAVE); return; } @@ -460,7 +460,7 @@ SceneComponent.prototype.onSaveCubeTexture = function () { // 保存立体贴图 var negZSrc = textureNegZ.image.src; if (posXSrc.startsWith('http') || negXSrc.startsWith('http') || posYSrc.startsWith('http') || negYSrc.startsWith('http') || posZSrc.startsWith('http') || negZSrc.startsWith('http')) { - UI.msg(`立体贴图已经存在于服务端,无需重复上传。`); + UI.msg(L_CUBE_TEXTURE_EXISTED); return; } diff --git a/ShadowEditor.Web/src/language/Language.js b/ShadowEditor.Web/src/language/Language.js index ce0caa2c..39465734 100644 --- a/ShadowEditor.Web/src/language/Language.js +++ b/ShadowEditor.Web/src/language/Language.js @@ -162,7 +162,12 @@ Object.assign(window, { L_LINEAR: 'Linear', L_EXPONENTIAL: 'Exponential', L_FOG_COLOR: 'FogColor', - L_FOG_NEAR = 'FogNear', + L_FOG_NEAR: 'FogNear', L_FOG_FAR: 'FogFar', L_FOG_DENSITY: 'FogDensity', + L_CLICK_MAP_PANEL: 'Please click the map in the Map Panel.', + L_ONLY_SELECT_CUBE_TEXTURE: 'You should select Cube Texture.', + L_CUBE_TEXTURE_FETCH_FAILED: 'Cube Texture fetch failed.', + L_UPLOAD_ALL_BEFORE_SAVE: 'Please upload all the textures before save.', + L_CUBE_TEXTURE_EXISTED: 'Cube texture has already been uploaded.', }); \ No newline at end of file