Update setStatusBarInnerHTML & floorChangeTime
This commit is contained in:
parent
75c12b4070
commit
c634f8fe78
@ -399,43 +399,36 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
|
||||
"_leaf": true,
|
||||
"_type": "textarea",
|
||||
"_docs": "红宝石值",
|
||||
"_data": "红宝石加攻击的数值"
|
||||
},
|
||||
"blueGem": {
|
||||
"_leaf": true,
|
||||
"_type": "textarea",
|
||||
"_docs": "蓝宝石值",
|
||||
"_data": "蓝宝石加防御的数值"
|
||||
},
|
||||
"greenGem": {
|
||||
"_leaf": true,
|
||||
"_type": "textarea",
|
||||
"_docs": "绿宝石值",
|
||||
"_data": "绿宝石加护盾的数值"
|
||||
},
|
||||
"redPotion": {
|
||||
"_leaf": true,
|
||||
"_type": "textarea",
|
||||
"_docs": "红血瓶值",
|
||||
"_data": "红血瓶加血数值"
|
||||
},
|
||||
"bluePotion": {
|
||||
"_leaf": true,
|
||||
"_type": "textarea",
|
||||
"_docs": "蓝血瓶值",
|
||||
"_data": "蓝血瓶加血数值"
|
||||
},
|
||||
"yellowPotion": {
|
||||
"_leaf": true,
|
||||
"_type": "textarea",
|
||||
"_docs": "黄血瓶值",
|
||||
"_data": "黄血瓶加血数值"
|
||||
},
|
||||
"greenPotion": {
|
||||
"_leaf": true,
|
||||
"_type": "textarea",
|
||||
"_docs": "绿血瓶值",
|
||||
"_data": "绿血瓶加血数值"
|
||||
},
|
||||
"breakArmor": {
|
||||
"_leaf": true,
|
||||
@ -476,6 +469,12 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
|
||||
"_docs": "竖状态栏自绘行数",
|
||||
"_data": "竖屏模式下,顶端状态栏canvas化后的行数。\n此项将决定竖屏的状态栏高度,如果设置则不小于1且不大于4。\n仅在statusCanvas开启时才有效"
|
||||
},
|
||||
"floorChangeTime": {
|
||||
"_leaf": true,
|
||||
"_type": "textarea",
|
||||
"_docs": "楼层切换时间",
|
||||
"_data": "默认楼层切换时间;当楼层切换没有显式设置时间时将用此值;可以被用户在系统设置内手动修改"
|
||||
}
|
||||
}
|
||||
},
|
||||
"flags": {
|
||||
|
||||
@ -1936,10 +1936,10 @@ actions.prototype._clickSwitchs = function (x, y) {
|
||||
if (x < this.CHOICES_LEFT || x > this.CHOICES_RIGHT) {
|
||||
if (selection != 1 && selection != 2 && selection != 3 && selection != 4) return;
|
||||
}
|
||||
var width = choices[selection].width;
|
||||
var leftPos = (core.__PIXELS__ - width) / 2, rightPos = (core.__PIXELS__ + width) / 2;
|
||||
var leftGrid = parseInt(leftPos / 32), rightGrid = parseInt(rightPos / 32) - 1;
|
||||
if (selection >= 0 && selection < choices.length) {
|
||||
var width = choices[selection].width;
|
||||
var leftPos = (core.__PIXELS__ - width) / 2, rightPos = (core.__PIXELS__ + width) / 2;
|
||||
var leftGrid = parseInt(leftPos / 32), rightGrid = parseInt(rightPos / 32) - 1;
|
||||
core.status.event.selection = selection;
|
||||
switch (selection) {
|
||||
case 0:
|
||||
|
||||
@ -1116,7 +1116,7 @@ control.prototype._checkBlock_ambush = function (ambush) {
|
||||
////// 更新全地图显伤 //////
|
||||
control.prototype.updateDamage = function (floorId, ctx) {
|
||||
floorId = floorId || core.status.floorId;
|
||||
if (!floorId || core.status.gameOver) return;
|
||||
if (!floorId || core.status.gameOver || main.mode != 'play') return;
|
||||
var onMap = ctx == null;
|
||||
|
||||
// 没有怪物手册
|
||||
@ -1192,7 +1192,7 @@ control.prototype._updateDamage_extraDamage = function (floorId, onMap) {
|
||||
|
||||
////// 重绘地图显伤 //////
|
||||
control.prototype.drawDamage = function (ctx) {
|
||||
if (core.status.gameOver || !core.status.damage) return;
|
||||
if (core.status.gameOver || !core.status.damage || main.mode != 'play') return;
|
||||
var onMap = false;
|
||||
if (ctx == null) {
|
||||
ctx = core.canvas.damage;
|
||||
@ -2636,7 +2636,6 @@ control.prototype.clearStatusBar = function() {
|
||||
Object.keys(core.statusBar).forEach(function (e) {
|
||||
if (core.statusBar[e].innerHTML != null) {
|
||||
core.statusBar[e].innerHTML = " ";
|
||||
core.statusBar[e].removeAttribute('_isNumber');
|
||||
core.statusBar[e].removeAttribute('_style');
|
||||
core.statusBar[e].removeAttribute('_value');
|
||||
}
|
||||
|
||||
@ -320,7 +320,8 @@ core.prototype._init_sys_flags = function () {
|
||||
core.flags.displayExtraDamage = core.getLocalStorage('extraDamage', core.flags.displayExtraDamage);
|
||||
// 行走速度
|
||||
core.values.moveSpeed = core.getLocalStorage('moveSpeed', 100);
|
||||
core.values.floorChangeTime = core.getLocalStorage('floorChangeTime', 500);
|
||||
core.values.floorChangeTime = core.getLocalStorage('floorChangeTime', core.values.floorChangeTime);
|
||||
if (core.values.floorChangeTime == null) core.values.floorChangeTime = 500;
|
||||
if (main.mode != 'editor') {
|
||||
core.domStyle.scale = core.getLocalStorage('scale', 1);
|
||||
if (core.domStyle.scale != 1) {
|
||||
|
||||
@ -704,12 +704,7 @@ utils.prototype.getCookie = function (name) {
|
||||
////// 设置statusBar的innerHTML,会自动斜体和放缩,也可以增加自定义css //////
|
||||
utils.prototype.setStatusBarInnerHTML = function (name, value, css) {
|
||||
if (!core.statusBar[name]) return;
|
||||
var isNumber = false;
|
||||
if (typeof value == 'number') {
|
||||
value = this.formatBigNumber(value);
|
||||
isNumber = true;
|
||||
}
|
||||
// 判定是否斜体
|
||||
if (typeof value == 'number') value = this.formatBigNumber(value);
|
||||
var italic = /^[-a-zA-Z0-9`~!@#$%^&*()_=+\[{\]}\\|;:'",<.>\/?]*$/.test(value);
|
||||
var style = 'font-style: ' + (italic ? 'italic' : 'normal') + '; ';
|
||||
style += 'text-shadow: #000 1px 0 0, #000 0 1px 0, #000 -1px 0 0, #000 0 -1px 0; ';
|
||||
@ -717,31 +712,17 @@ utils.prototype.setStatusBarInnerHTML = function (name, value, css) {
|
||||
var length = this.strlen(value) || 1;
|
||||
style += 'font-size: ' + Math.min(1, 7 / length) + 'em; ';
|
||||
if (css) style += css;
|
||||
var _isNumber = core.statusBar[name].getAttribute('_isNumber') == "1";
|
||||
var _style = core.statusBar[name].getAttribute('_style');
|
||||
var _value = core.statusBar[name].getAttribute('_value');
|
||||
if (isNumber) {
|
||||
if (_isNumber && _style == style) {
|
||||
if (value == _value) return;
|
||||
core.statusBar[name].innerText = value;
|
||||
} else {
|
||||
core.statusBar[name].innerHTML = "<span class='_status' style='" + style + "'>" + value + "</span>";
|
||||
core.statusBar[name].setAttribute('_isNumber', '1');
|
||||
core.statusBar[name].setAttribute('_style', style);
|
||||
}
|
||||
core.statusBar[name].setAttribute('_value', value);
|
||||
if (_style == style) {
|
||||
if (value == _value) return;
|
||||
core.statusBar[name].children[0].innerText = value;
|
||||
} else {
|
||||
if (!_isNumber && _style == style) {
|
||||
if (value == _value) return;
|
||||
core.statusBar[name].children[0].innerText = value;
|
||||
} else {
|
||||
core.statusBar[name].innerHTML = "<span class='_status' style='" + style + "'></span>";
|
||||
core.statusBar[name].children[0].innerText = value;
|
||||
core.statusBar[name].setAttribute('_isNumber', '0');
|
||||
core.statusBar[name].setAttribute('_style', style);
|
||||
}
|
||||
core.statusBar[name].setAttribute('_value', value);
|
||||
core.statusBar[name].innerHTML = "<span class='_status' style='" + style + "'></span>";
|
||||
core.statusBar[name].children[0].innerText = value;
|
||||
core.statusBar[name].setAttribute('_style', style);
|
||||
}
|
||||
core.statusBar[name].setAttribute('_value', value);;
|
||||
}
|
||||
|
||||
utils.prototype.strlen = function (str) {
|
||||
|
||||
@ -449,7 +449,8 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
||||
"purify": 3,
|
||||
"hatred": 2,
|
||||
"animateSpeed": 400,
|
||||
"statusCanvasRowsOnMobile": 3
|
||||
"statusCanvasRowsOnMobile": 3,
|
||||
"floorChangeTime": 500
|
||||
},
|
||||
"flags": {
|
||||
"statusBarItems": [
|
||||
|
||||
Loading…
Reference in New Issue
Block a user