note user the shitty 3D preview when double layer skin is uploaded
This commit is contained in:
parent
41085d2846
commit
9d29cf380b
|
|
@ -2,7 +2,7 @@
|
||||||
* @Author: prpr
|
* @Author: prpr
|
||||||
* @Date: 2016-01-21 13:56:40
|
* @Date: 2016-01-21 13:56:40
|
||||||
* @Last Modified by: prpr
|
* @Last Modified by: prpr
|
||||||
* @Last Modified time: 2016-02-05 21:20:30
|
* @Last Modified time: 2016-02-07 10:25:41
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
@ -22,10 +22,15 @@ function handleFiles(files, type) {
|
||||||
if(files.length > 0) {
|
if(files.length > 0) {
|
||||||
var file = files[0];
|
var file = files[0];
|
||||||
if(file.type === "image/png") {
|
if(file.type === "image/png") {
|
||||||
var fr = new FileReader();
|
var reader = new FileReader();
|
||||||
fr.onload = function (e) {
|
reader.onload = function (e) {
|
||||||
var img = new Image();
|
var img = new Image();
|
||||||
img.onload = function () {
|
img.onload = function () {
|
||||||
|
if (this.width == this.height) {
|
||||||
|
showMsg("alert-info", "提示:看起来你上传了一张双层皮肤,皮肤站本身是支持的,"+
|
||||||
|
"然而 3D 皮肤预览并不支持,所以不要在意变得奇怪的预览(笑)直接上传,"+
|
||||||
|
"就可以在 2D 预览中看到正确的双层皮肤啦。");
|
||||||
|
}
|
||||||
if (type == "skin") {
|
if (type == "skin") {
|
||||||
MSP.changeSkin(img.src);
|
MSP.changeSkin(img.src);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -37,7 +42,7 @@ function handleFiles(files, type) {
|
||||||
};
|
};
|
||||||
img.src = this.result;
|
img.src = this.result;
|
||||||
};
|
};
|
||||||
fr.readAsDataURL(file);
|
reader.readAsDataURL(file);
|
||||||
} else {
|
} else {
|
||||||
showMsg("alert-danger", "错误:皮肤文件必须为 PNG 格式");
|
showMsg("alert-danger", "错误:皮肤文件必须为 PNG 格式");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user