恢复drawTip

This commit is contained in:
unanmed 2023-04-26 12:51:09 +08:00
parent 1552fb7dcb
commit 34154e77c1

View File

@ -942,19 +942,40 @@ ui.prototype.clearUI = function () {
////// 左上角绘制一段提示 //////
ui.prototype.drawTip = function (text, id, frame) {
let t =
text +
' [' +
core.status.hero.loc.x +
',' +
core.status.hero.loc.y +
',' +
core.status.floorId +
'] ';
if (core.status.floorId === 'tower6')
t += core.searchBlockWithFilter(v => v.event.cls === 'enemys').length;
console.log(t);
text = core.replaceText(text) || '';
var realText = this._getRealContent(text);
var one = {
text: text,
textX: 21,
width: 26 + core.calWidth('data', realText, '16px Arial'),
opacity: 0.1,
stage: 1,
frame: frame || 0,
time: 0
};
if (id != null) {
var info = core.getBlockInfo(id);
if (info == null || !info.image || info.bigImage) {
// 检查状态栏图标
if (core.statusBar.icons[id] instanceof Image) {
info = {
image: core.statusBar.icons[id],
posX: 0,
posY: 0,
height: 32
};
} else info = null;
}
if (info != null) {
one.image = info.image;
one.posX = info.posX;
one.posY = info.posY;
one.height = info.height;
one.textX += 24;
one.width += 24;
}
}
core.animateFrame.tip = one;
};
ui.prototype._drawTip_drawOne = function (tip) {