newline in drawEquipbox_statusChanged
This commit is contained in:
parent
b28bf8cadf
commit
d1bc5ef79e
27
libs/ui.js
27
libs/ui.js
@ -2037,19 +2037,19 @@ ui.prototype._drawEquipbox_getStatusChanged = function (info, equip, equipType)
|
|||||||
ui.prototype._drawEquipbox_drawStatusChanged = function (info, y, equip, equipType) {
|
ui.prototype._drawEquipbox_drawStatusChanged = function (info, y, equip, equipType) {
|
||||||
var compare = this._drawEquipbox_getStatusChanged(info, equip, equipType);
|
var compare = this._drawEquipbox_getStatusChanged(info, equip, equipType);
|
||||||
if (compare == null) return;
|
if (compare == null) return;
|
||||||
var drawOffset = 10;
|
var obj = { drawOffset: 10, y: y };
|
||||||
|
|
||||||
// --- 变化值...
|
// --- 变化值...
|
||||||
core.setFont('ui', this._buildFont(14, true));
|
core.setFont('ui', this._buildFont(14, true));
|
||||||
for (var name in compare) {
|
for (var name in compare) {
|
||||||
var img = core.statusBar.icons[name];
|
var img = core.statusBar.icons[name];
|
||||||
var text = core.getStatusName(name);
|
var text = core.getStatusName(name);
|
||||||
if (img && core.flags.iconInEquipbox) { // 绘制图标
|
if (img && core.flags.iconInEquipbox) { // 绘制图标
|
||||||
core.drawImage('ui', img, 0, 0, 32, 32, drawOffset, y - 13, 16, 16);
|
core.drawImage('ui', img, 0, 0, 32, 32, obj.drawOffset, y - 13, 16, 16);
|
||||||
drawOffset += 20;
|
obj.drawOffset += 20;
|
||||||
}
|
}
|
||||||
else { // 绘制文字
|
else { // 绘制文字
|
||||||
core.fillText('ui', text + " ", drawOffset, y, '#CCCCCC');
|
this._drawEquipbox_drawStatusChanged_draw(text + " ", '#CCCCCC', obj);
|
||||||
drawOffset += core.calWidth('ui', text + " ");
|
|
||||||
}
|
}
|
||||||
var nowValue = core.getStatus(name) * core.getBuff(name), newValue = (nowValue + compare[name]) * core.getBuff(name);
|
var nowValue = core.getStatus(name) * core.getBuff(name), newValue = (nowValue + compare[name]) * core.getBuff(name);
|
||||||
if (equip.equip.percentage) {
|
if (equip.equip.percentage) {
|
||||||
@ -2059,13 +2059,22 @@ ui.prototype._drawEquipbox_drawStatusChanged = function (info, y, equip, equipTy
|
|||||||
}
|
}
|
||||||
nowValue = core.formatBigNumber(nowValue);
|
nowValue = core.formatBigNumber(nowValue);
|
||||||
newValue = core.formatBigNumber(newValue);
|
newValue = core.formatBigNumber(newValue);
|
||||||
core.fillText('ui', nowValue + "->", drawOffset, y, '#CCCCCC');
|
this._drawEquipbox_drawStatusChanged_draw(nowValue+"->", '#CCCCCC', obj);
|
||||||
drawOffset += core.calWidth('ui', nowValue + "->");
|
this._drawEquipbox_drawStatusChanged_draw(newValue, compare[name]>0?'#00FF00':'#FF0000', obj);
|
||||||
core.fillText('ui', newValue, drawOffset, y, compare[name]>0?'#00FF00':'#FF0000');
|
obj.drawOffset += 8;
|
||||||
drawOffset += core.calWidth('ui', newValue) + 8;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ui.prototype._drawEquipbox_drawStatusChanged_draw = function (text, color, obj) {
|
||||||
|
var len = core.calWidth('ui', text);
|
||||||
|
if (obj.drawOffset + len >= core.__PIXELS__) { // 换行
|
||||||
|
obj.y += 19;
|
||||||
|
obj.drawOffset = 10;
|
||||||
|
}
|
||||||
|
core.fillText('ui', text, obj.drawOffset, obj.y, color);
|
||||||
|
obj.drawOffset += len;
|
||||||
|
}
|
||||||
|
|
||||||
ui.prototype._drawEquipbox_drawEquiped = function (info, line) {
|
ui.prototype._drawEquipbox_drawEquiped = function (info, line) {
|
||||||
core.setTextAlign('ui', 'center');
|
core.setTextAlign('ui', 'center');
|
||||||
var per_line = this.HSIZE - 3, width = Math.floor(this.PIXEL / (per_line + 0.25));
|
var per_line = this.HSIZE - 3, width = Math.floor(this.PIXEL / (per_line + 0.25));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user