Merge branch 'v2.0' of https://github.com/ckcz123/mota-js into v2.0
This commit is contained in:
commit
334f7e932e
11 files changed
+51
-31
No files matched your search
+2
-2
@@ -759,8 +759,8 @@ core.prototype.animateBlock = function (loc,type,time,callback) {
|
||||
}
|
||||
|
||||
////// 将某个块从禁用变成启用状态 //////
|
||||
core.prototype.showBlock = function(x, y, floodId) {
|
||||
core.maps.showBlock(x,y,floodId);
|
||||
core.prototype.showBlock = function(x, y, floorId) {
|
||||
core.maps.showBlock(x,y,floorId);
|
||||
}
|
||||
|
||||
////// 将某个块从启用变成禁用状态,但是并不删除它 //////
|
||||
|
||||
+3
-2
@@ -1396,10 +1396,11 @@ events.prototype.changeFloor = function (floorId, stair, heroLoc, time, callback
|
||||
if (index<core.floorIds.length-1) floorId = core.floorIds[index+1];
|
||||
else floorId=core.status.floorId;
|
||||
}
|
||||
if (!core.isset(time)) time = core.values.floorChangeTime;
|
||||
if (!core.isset(time)) time = 800;
|
||||
|
||||
var displayAnimate=(!core.isset(time) || time>=100) && !core.status.replay.replaying;
|
||||
var displayAnimate = time>=100 && !core.status.replay.replaying;
|
||||
|
||||
time = time || 800;
|
||||
time /= 20;
|
||||
core.lockControl();
|
||||
core.stopHero();
|
||||
|
||||
+1
-1
@@ -238,7 +238,7 @@ loader.prototype.loadMusic = function () {
|
||||
console.log(ee);
|
||||
core.material.sounds[t] = null;
|
||||
}
|
||||
}, function () {
|
||||
}, function (e) {
|
||||
console.log(e);
|
||||
core.material.sounds[t] = null;
|
||||
}, null, 'arraybuffer');
|
||||
|
||||
@@ -403,6 +403,11 @@ ui.prototype.calTextBoxWidth = function (canvas, content, min_width, max_width)
|
||||
|
||||
// 如果不存在手动换行,则二分自动换行
|
||||
if (allLines.length == 1) {
|
||||
var w = core.canvas[canvas].measureText(allLines[0]).width;
|
||||
if (w<min_width*2.3) return core.clamp(w / 1.4, min_width, max_width);
|
||||
if (w<max_width*2.2) return core.clamp(w / 2.4, min_width, max_width);
|
||||
return core.clamp(w / 3.4, min_width, max_width);
|
||||
/*
|
||||
var prefer_lines = 3;
|
||||
var start = Math.floor(min_width), end = Math.floor(max_width);
|
||||
while (start < end) {
|
||||
@@ -413,6 +418,7 @@ ui.prototype.calTextBoxWidth = function (canvas, content, min_width, max_width)
|
||||
start = mid + 1;
|
||||
}
|
||||
return mid;
|
||||
*/
|
||||
}
|
||||
// 存在手动换行:以最长的为准
|
||||
else {
|
||||
|
||||
+7
-13
@@ -735,14 +735,10 @@ utils.prototype.copy = function (data) {
|
||||
|
||||
////// 动画显示某对象 //////
|
||||
utils.prototype.show = function (obj, speed, callback) {
|
||||
if (!core.isset(speed)) {
|
||||
obj.style.display = 'block';
|
||||
return;
|
||||
}
|
||||
obj.style.display = 'block';
|
||||
if (main.mode!='play'){
|
||||
if (!core.isset(speed) && main.mode!='play') {
|
||||
obj.style.opacity = 1;
|
||||
if (core.isset(callback)) {callback();}
|
||||
if (core.isset(callback)) callback();
|
||||
return;
|
||||
}
|
||||
obj.style.opacity = 0;
|
||||
@@ -761,15 +757,13 @@ utils.prototype.show = function (obj, speed, callback) {
|
||||
|
||||
////// 动画使某对象消失 //////
|
||||
utils.prototype.hide = function (obj, speed, callback) {
|
||||
if (!core.isset(speed)) {
|
||||
obj.style.display = 'none';
|
||||
return;
|
||||
}
|
||||
if (main.mode!='play'){
|
||||
obj.style.display = 'none';
|
||||
if (core.isset(callback)) {callback();}
|
||||
obj.style.display = 'none';
|
||||
if (!core.isset(speed) || main.mode!='play'){
|
||||
obj.style.opacity = 0;
|
||||
if (core.isset(callback)) callback();
|
||||
return;
|
||||
}
|
||||
obj.style.opacity = 1;
|
||||
var opacityVal = 1;
|
||||
var hideAnimate = window.setInterval(function () {
|
||||
opacityVal -= 0.03;
|
||||
|
||||
Reference in new issue
Block a user