Fix setFg Bug
This commit is contained in:
parent
fd245019fd
commit
c029388e30
@ -1467,10 +1467,8 @@ control.prototype.setFg = function(color, time, callback) {
|
||||
|
||||
if (!core.isset(color))
|
||||
color = [0,0,0,0];
|
||||
if (color.length==3)
|
||||
color.push(1);
|
||||
if (color[3]<0) color[3]=0;
|
||||
if (color[3]>1) color[3]=1;
|
||||
if (!core.isset(color[3])) color[3] = 1;
|
||||
color[3] = core.clamp(color[3],0,1);
|
||||
|
||||
if (time==0) {
|
||||
// 直接变色
|
||||
@ -2524,6 +2522,7 @@ control.prototype.getLvName = function () {
|
||||
|
||||
////// 设置某个自定义变量或flag //////
|
||||
control.prototype.setFlag = function(flag, value) {
|
||||
if (!core.isset(value)) return this.removeFlag(flag);
|
||||
if (!core.isset(core.status.hero)) return;
|
||||
core.status.hero.flags[flag]=value;
|
||||
}
|
||||
|
||||
@ -1414,13 +1414,10 @@ events.prototype.changeFloor = function (floorId, stair, heroLoc, time, callback
|
||||
if (core.isset(color)) {
|
||||
// 直接变色
|
||||
core.clearMap('curtain');
|
||||
core.fillRect('curtain',0,0,416,core.arrayToRGBA(color));
|
||||
core.fillRect('curtain',0,0,416,416,core.arrayToRGBA(color));
|
||||
core.status.curtainColor = color;
|
||||
}
|
||||
else {
|
||||
core.clearMap('curtain');
|
||||
core.setAlpha('curtain', 0);
|
||||
}
|
||||
else core.clearMap('curtain');
|
||||
|
||||
// 更改天气
|
||||
var weather = core.getFlag('__weather__', null);
|
||||
|
||||
@ -1121,8 +1121,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
||||
ctx.msImageSmoothingEnabled = false;
|
||||
ctx.imageSmoothingEnabled = false;
|
||||
core.clearMap('curtain');
|
||||
core.setOpacity('curtain', 1);
|
||||
core.setAlpha('curtain', 1);
|
||||
|
||||
// 绘制色调层,默认不透明度
|
||||
if (!core.isset(color)) color = 0.9;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user