Merge pull request #355 from ckcz123/v2.x

V2.x
This commit is contained in:
Zhang Chen 2019-04-17 22:57:29 +08:00 committed by GitHub
commit c35e9f70af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 18 deletions

View File

@ -1706,6 +1706,7 @@ core.drawTip(text, id)
在左上角以气泡的形式绘制一段提示。
text为文字内容仅支持${}的表达式计算,不支持换行和变色。
id可选为同时绘制的图标ID如果不为null则会同时绘制该图标仅对32x32的素材有效
也可以使用状态栏的图标ID例如lv, hp, up, save, settings等。
core.drawText(content, callback)

View File

@ -673,11 +673,11 @@ function omitedcheckUpdateFunction(event) {
var searchInput = document.getElementById("searchBlock");
searchInput.onfocus = function () {
editor_blockly.reopenToolbox(9);
editor_blockly.reopenToolbox(10);
}
searchInput.oninput = function () {
editor_blockly.reopenToolbox(9);
editor_blockly.reopenToolbox(10);
}
editor_blockly.searchBlock = function (value) {

View File

@ -1480,29 +1480,21 @@ control.prototype._replayAction_key = function (action) {
////// 自动存档 //////
control.prototype.autosave = function (removeLast) {
var inEvent = false; // 检测是否是事件中的自动存档
if (core.status.event.id!=null) {
if (core.status.event.id!='action') return;
inEvent = true;
}
var x=null;
if (removeLast) x=core.status.route.pop();
if (inEvent) {
core.setFlag("__events__", core.clone(core.status.event.data));
}
else {
if (removeLast) {
x=core.status.route.pop();
core.status.route.push("turn:"+core.getHeroLoc('direction'));
}
if (core.status.event.id == 'action') // 事件中的自动存档
core.setFlag("__events__", core.clone(core.status.event.data));
core.saves.autosave.data = core.saveData();
core.saves.autosave.updated = true;
core.saves.ids[0] = true;
if (inEvent) {
core.removeFlag("__events__");
}
else {
core.removeFlag("__events__");
if (removeLast) {
core.status.route.pop();
if (x) core.status.route.push(x);
}
if (x) core.status.route.push(x);
}
/////// 实际进行自动存档 //////

View File

@ -275,7 +275,13 @@ ui.prototype.drawTip = function (text, id) {
core.setTextAlign('data', 'left');
if (id != null) {
var info = core.getBlockInfo(id);
if (info == null || !info.image || info.height != 32) id = null;
if (info == null || !info.image || info.height != 32) {
// 检查状态栏图标
if (core.statusBar.icons[id] instanceof Image) {
id = {image: core.statusBar.icons[id], posX: 0, posY: 0};
}
else id = null;
}
else id = info;
}
if (!id) {