Fix searchBlock bug

This commit is contained in:
ckcz123 2020-06-28 22:28:28 +08:00
parent 064ebfb69d
commit 1879d69670
2 changed files with 8 additions and 5 deletions

View File

@ -414,7 +414,7 @@ editor_blockly = function () {
editor_blockly.reopenToolbox = function(index) {
if (index < 0) index += editor_blockly.workspace.toolbox_.tree_.children_.length;
editor_blockly.workspace.toolbox_.tree_.setSelectedItem(editor_blockly.workspace.toolbox_.tree_.children_[index]);
editor_blockly.workspace.getFlyout_().show(editor_blockly.workspace.toolbox_.tree_.children_[index].blocks);
editor_blockly.workspace.getFlyout().show(editor_blockly.workspace.toolbox_.tree_.children_[index].blocks);
}
editor_blockly.closeToolbox = function() {

View File

@ -1864,10 +1864,7 @@ ui.prototype.drawBook = function (index) {
core.setAlpha('ui', 1);
if (enemys.length == 0) {
core.setTextAlign('ui', 'center');
core.fillText('ui', "本层无怪物", this.HPIXEL, this.HPIXEL + 14, '#999999', this._buildFont(50, true));
core.fillText('ui', '返回游戏', this.PIXEL - 46, this.PIXEL - 13,'#DDDDDD', this._buildFont(15, true));
return;
return this._drawBook_drawEmpty();
}
index = core.clamp(index, 0, enemys.length - 1);
@ -1904,6 +1901,12 @@ ui.prototype._drawBook_drawBackground = function () {
core.fillRect('ui', 0, 0, this.PIXEL, this.PIXEL);
}
ui.prototype._drawBook_drawEmpty = function () {
core.setTextAlign('ui', 'center');
core.fillText('ui', "本层无怪物", this.HPIXEL, this.HPIXEL + 14, '#999999', this._buildFont(50, true));
core.fillText('ui', '返回游戏', this.PIXEL - 46, this.PIXEL - 13,'#DDDDDD', this._buildFont(15, true));
}
ui.prototype._drawBook_drawOne = function (floorId, index, enemy, pageinfo, selected) {
// --- 区域规划每个区域总高度默认为62宽度为 PIXEL
var top = pageinfo.per_height * index + pageinfo.padding_top; // 最上面margin默认是12px